Closed Bug 358670 Opened 18 years ago Closed 15 years ago

Make Firefox 2.0.0.x warn when I use nodes in the wrong document

Categories

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

1.8 Branch
enhancement
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jruderman, Assigned: peterv)

References

Details

Attachments

(1 file)

Trunk will soon throw WRONG_DOCUMENT_ERR when nodes are used in the wrong document, in order to comply with DOM specs and make interoperability with Safari easier. (See bug 47903.) Firefox 2.0.0.x should put a warning in the Error Console in the same situation, so extension and web developers will be more likely to notice their bugs before Firefox 3 comes out and breaks their code. (Originally suggested by bz, bug 47903 comment 39.)
OS: Mac OS X 10.4 → All
Hardware: Macintosh → All
Version: Trunk → 1.8 Branch
Yeah, I should have done this for FF 2.
Assignee: general → peterv
Attached patch v1 (deleted) — Splinter Review
Blocks: 366336
Blocks: 361709
Comment on attachment 247570 [details] [diff] [review] v1 >+ errorText.AppendASCII("Passing a node that has the wrong ownerDocument to " >+ "a DOM method. Future versions will throw " >+ "DOCUMENT_ERR exceptions, either create the node in " >+ "the right document or use adoptNode or importNode " >+ "to get a node with the right ownerDocument."); This is a comma splice, I believe; how about: Passing a node that has the wrong ownerDocument to a DOM method; future Gecko versions will throw DOCUMENT_ERR exceptions. Either create the node in the right document or use adoptNode or importNode to get a node with the right ownerDocument. (i.e., replace the period with a semicolon, uncapitalize "Future", change the comma after "exceptions" to a period, and capitalize "either"; I also added Gecko for greater clarity, but that's just my opinion that it's better that way)
Blocks: 369615
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → WONTFIX
Why is this WONTFIX? Surely if the peril to developers of not knowing that their code is in violation of holy exception writ was worth risking major site breakage, it's still worth warning them about it. s/"Future versions"/"Strictly specification-compliant implementations"/ and go?
Status: RESOLVED → REOPENED
Resolution: WONTFIX → ---
Fine, I'm just pessimistic of the effect a warning like this will have.
Status: REOPENED → ASSIGNED
Component: DOM: Core → DOM: Core & HTML
QA Contact: ian → general
If this is still an option, I think it would be worth the experiment to see if we developers can be persuaded to move towards the spec (although perhaps rewording the warning might be warranted now). It's obviously rather too late for 2.x, but warnings won't break any sites, and another step away from browser-specific code could benefit web development and the ordinary user in the long run. Isn't part of the purpose of adopting web specifications to progress away from the demand on web developers to write several variations on numerous fragments (sometimes totalling a sizable portion) of web code?
Too late for Firefox 2.
Status: ASSIGNED → RESOLVED
Closed: 17 years ago15 years ago
Resolution: --- → WONTFIX
Understandable, but is there a definitive answer on whether this will ever be seen in 3.something, or has the prospect of trying to persuade web developers to move towards the spec on this been abandoned?
It was made to throw in bug 47903, but that was reverted in bug 418755.
Yeah, I could see how throwing would cause excessive collateral damage, because of how long it was taken for granted that Firefox would not do so. What I was asking is, do you think it would be worthwhile at this point to simple add a warning or message in the console -- since web developers (presumably) watch it while testing their sites?
Given bug 418755 comment 28, seems unlikely.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: