The default bug view has changed. See this FAQ.

An javascript global variable named 'contextMenu' is inaccessible in the HTML element event handlers

RESOLVED INVALID

Status

()

Core
DOM: Core & HTML
RESOLVED INVALID
5 years ago
5 years ago

People

(Reporter: Dmitry Krivaltsevich, Unassigned)

Tracking

8 Branch
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 573471 [details]
contextMenu bug demonstration

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20100101 Firefox/8.0
Build ID: 20111104165243

Steps to reproduce:

Here is short HTML for demonstration:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
</head>
<body>
<script type="text/javascript">
	var contextMenu = 'hello!';
</script>
<input type="button" value="click me" onclick="alert(contextMenu)" />
</body>
</html>					  


Actual results:

User should click 'click me' button and see alert messages with text 'hello'.


Expected results:

Firefox 8 displays alert message with text 'null'.

Updated

5 years ago
Attachment #573471 - Attachment mime type: text/plain → text/html

Comment 1

5 years ago
Confirming.

Can this variable name clash with the contextMenu feature developed in bug 617528? That one is marked as landed in Firefox 8.
Status: UNCONFIRMED → NEW
Component: General → DOM: Core & HTML
Depends on: 617528
Ever confirmed: true
OS: Windows 7 → All
Product: Firefox → Core
QA Contact: general → general
Hardware: x86_64 → All

Comment 2

5 years ago
not sure if this is a bug
Yeah, that's unfortunately simply how things work :( I.e. this is what specifications require.
Yeah, this is yet another case when adding new properties to elements break existing pages.

Comment 5

5 years ago
(In reply to Olli Pettay [:smaug] from comment #4)
> Yeah, this is yet another case when adding new properties to elements break
> existing pages.

and a good reason for reworking of the command API spec as we already discussed
Olli, Jonas, do we have a tracker for issues like this?

Reporter, did you run into this on existing site?  If so, which one?
Blocks: 617528
No longer depends on: 617528
(Reporter)

Comment 7

5 years ago
(In reply to Boris Zbarsky (:bz) from comment #6)
> Olli, Jonas, do we have a tracker for issues like this?
> 
> Reporter, did you run into this on existing site?  If so, which one?

Our clients found this issue on existing business-application which we've developed.
Blocks: 702210
OK.  Marking invalid, since the spec requires this behavior... if you feel that the spec needs changing, please raise the issue with the HTML working group?
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.