Closed Bug 222733 Opened 21 years ago Closed 21 years ago

document.config should be renamed to document.domConfig to match the changes in DOM Level 3 Core (not yet published)

Categories

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

defect

Tracking

()

RESOLVED FIXED

People

(Reporter: cdkotran, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5) Gecko/20031007 The following code segment as found on http://upcsuccess.com works in 1.4 and under IE (used for comparison). Under Mozilla 1.5, it no longer works. <a class='link' title='UPC Training' href='javascript:void(0);' onClick="window.open('http://www.upctraining.com','Training',config='menubar=1,titlebar=0,toolbar=0,status=0,location=0,directories=0,width=700,height=460,maximize=yes,resizable=yes,scrollbars=yes');">Training</a> Reproducible: Always Steps to Reproduce: 1.Visit http://upcsuccess.com with Mozilla 1.4 2.Goto bottom (footer) of page. 3.Click on Training OR any other link with an OnClick event. 4.All works fine. 5.Repeat steps with Mozilla 1.5 and no new windows open. Actual Results: The onClick event either did not fire or the window.open did not open a new window. Expected Results: Mozilla should have opened a new window.
Proposed: Invalid. Your JavaScript is buggy. Try this: <a class='link' title='UPC Training' href='http://www.upctraining.com' onClick="window.open(this.href,'Training','menubar=1,titlebar=0,toolbar=0,status=0,location=0,directories=0,width=700,height=460,maximize=yes,resizable=yes,scrollbars=yes');return false;">Training</a>
Hmm... This should sorta work, actually. Are there errors in the JS console?
With code provided in comment 0: > Error: setting a property that has only a getter
Oh, I see. The problem is that we implemented parts of the DOM3 specification, and there is a "config" property on the Document object now. So the code used to set the "config" variable and the return value of the assignment statement (the string) got passed to the window.open() call. But now assigning to "config" without qualifying it finds document.config (correctly) and assigns to it... which throws an exception, since document.config is readonly. Over to evangelism.
Assignee: events → english-us
Status: UNCONFIRMED → NEW
Component: Event Handling → English US
Ever confirmed: true
OS: Windows XP → All
Product: Browser → Tech Evangelism
QA Contact: ian → english-us
Hardware: PC → All
Version: Trunk → unspecified
This is going to cause lots of problems. I do not know where this started but a quick look on google shows lots of hits for people using/recommending that the way to set the new window features is to pass a config='blah' as a parameter to window.open. There are even links to educational materials which *taught* people to do this. http://www.google.com/search?q=javascript+window.open+config&hl=en&lr=&ie=UTF-8&oe=UTF-8&start=10&sa=N Why is the config='blah' being used to assign to a variable in the first place? This is the first time I have seen that behavior mentioned. If document.config is a property that will stay, then we *must* remove the behavior that an expression in the window.open parameter list is executed in this way.
Priority: -- → P1
Doh. Ok, the expression is evaluated before the window.open call so that is where the assignment is happening. Is document.config something we can make replaceable or can we just ignore assignments to it?
brendan: replaceable?
Jst, can you take this as a DOM bug and make document.config replaceable? Or give it back to evang, but I bet it's worldwide (so that seems like a non-starter). /be
Assignee: english-us → jst
I have been thinking about this a bit more and feel that the most appropriate change is to the specification. Document overlaps with the DOM 0 use of HTMLDocument on the web. DOM 3 should not be adding new "unqualified" properties/methods to Document as they can potentially cause conflicts with existing code in the wild as this case illustrates. Since we will be the first (and perhaps) only browser to implement them, these properties/methods will show up as errors in Mozilla and not other browsers which will increase the cost of supporting Mozilla. I feel that if the W3 wants to add new properties/methods to Document that will live in HTMLDocument, then they should be qualified by a prefix or by another object as in Document.w3dom3Config or Document.w3dom3.config or something similar.
The DOM WG discussed this issue in the last telecon (yesterday) and it was decided that Document.config should be renamed to Document.domConfig to make conflicts with existing code on the web less likely. I would suggest that we simply follow that and see how far that gets us, if we run into more problems like this, then we'll make Document.domConfig or whatever replaceable to eliminate this problem once n' for all. Thoughts?
Summary: window.open appears to have a problem in 1.5 that doesn't exist in 1.4 → document.config should be renamed to document.domConfig to match the changes in DOM Level 3 Core (not yet published)
sounds good to me
Sounds perfect.
Component: English US → DOM Core
Product: Tech Evangelism → Browser
QA Contact: english-us → ian
Version: unspecified → Trunk
*** Bug 225058 has been marked as a duplicate of this bug. ***
Attachment #135059 - Flags: superreview?(jst)
Attachment #135059 - Flags: review?(jst)
Comment on attachment 135059 [details] [diff] [review] Patch to that effect r+sr=jst
Attachment #135059 - Flags: superreview?(jst)
Attachment #135059 - Flags: superreview+
Attachment #135059 - Flags: review?(jst)
Attachment #135059 - Flags: review+
.
Assignee: jst → bz-vacation
Fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
*** Bug 225058 has been marked as a duplicate of this bug. ***
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: