The default bug view has changed. See this FAQ.

document.importNode should comply with optional argument omitted

RESOLVED FIXED in mozilla10

Status

()

Core
DOM: Core & HTML
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: Jake Verbaten, Assigned: smaug)

Tracking

({dev-doc-complete})

Trunk
mozilla10
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

6 years ago
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

Updated

6 years ago
Component: General → DOM: Core & HTML
Product: Firefox → Core
QA Contact: general → general
Version: 7 Branch → Trunk
(Assignee)

Updated

6 years ago
Assignee: nobody → Olli.Pettay
(Assignee)

Updated

6 years ago
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
(Assignee)

Comment 1

6 years ago
I think the backwards incompatible behavior of DOM4 is ok.
(Assignee)

Comment 2

6 years ago
...patch coming.
(Assignee)

Comment 3

6 years ago
(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.

Updated

6 years ago
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
(Reporter)

Comment 4

6 years ago
Thank you for pointing out there is Editors draft!
(Assignee)

Comment 5

6 years ago
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).
(Assignee)

Updated

6 years ago
(Assignee)

Comment 6

6 years ago
Created attachment 570566 [details] [diff] [review]
patch
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+
(Assignee)

Comment 8

6 years ago
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 :)
(Assignee)

Comment 9

6 years ago
https://hg.mozilla.org/mozilla-central/rev/d93d320aee64
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED

Updated

6 years ago
Target Milestone: --- → mozilla10
Documented this change in https://developer.mozilla.org/en/DOM/document.importNode#section_2
Keywords: dev-doc-needed → dev-doc-complete
You need to log in before you can comment on or make changes to this bug.