Closed Bug 701328 Opened 10 years ago Closed 10 years ago

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

Categories

(Core :: DOM: Core & HTML, defect)

8 Branch
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: dmitry.krivaltsevich, Unassigned)

References

Details

Attachments

(1 file)

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'.
Attachment #573471 - Attachment mime type: text/plain → text/html
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
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.
(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
(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
Closed: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.