Closed Bug 698061 Opened 13 years ago Closed 13 years ago

document.importNode should comply with optional argument omitted

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: raynos2, Assigned: smaug)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

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
Assignee: nobody → Olli.Pettay
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I think the backwards incompatible behavior of DOM4 is ok.
...patch coming.
(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.
Keywords: dev-doc-needed
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).
Attached patch patchSplinter Review
Attachment #570566 - Flags: review?(jonas)
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 :)
https://hg.mozilla.org/mozilla-central/rev/d93d320aee64
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: