Closed Bug 698061 Opened 10 years ago Closed 10 years ago
.import Node should comply with optional argument omitted
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2 Steps to reproduce: document.importNode(someElement); (FF7) Actual results: Error not enough arguments Expected results: It should have made the second argument (deep Clone) optional as defined in DOM4 http://www.w3.org/TR/domcore/#dom-document-importnode
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
Version: 7 Branch → Trunk
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I think the backwards incompatible behavior of DOM4 is ok.
(In reply to Jake Verbaten from comment #0) > http://www.w3.org/TR/domcore/#dom-document-importnode Btw, please don't use old versions of specs. http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html is better.
OS: Windows 7 → All
Hardware: x86_64 → All
Summary: document.importNode doesn't comply with optional arguments → document.importNode should comply with optional argument omitted
Thank you for pointing out there is Editors draft!
Chrome handles the optional parameter in a wrong way. It defaults to false, but the spec defaults to true (which is IMO the most obvious thing to do in this case).
See Also: → https://bugs.webkit.org/show_bug.cgi?id=71190
Comment on attachment 570566 [details] [diff] [review] patch r=me There's actually lot's of arguments that have been marked as optional in DOM4. We should go through and fix them all. I'll file a separate bug for that.
Attachment #570566 - Flags: review?(jonas) → review+
Need to be careful with the default value of the optional parameters. Also, need to review each case. DOM4, as any other spec, contains random insanity :)
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Documented this change in https://developer.mozilla.org/en/DOM/document.importNode#section_2
You need to log in before you can comment on or make changes to this bug.