Last Comment Bug 698061 - document.importNode should comply with optional argument omitted
: document.importNode should comply with optional argument omitted
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla10
Assigned To: Olli Pettay [:smaug]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-28 11:48 PDT by Jake Verbaten
Modified: 2011-12-09 08:32 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (7.38 KB, patch)
2011-10-30 13:36 PDT, Olli Pettay [:smaug]
jonas: review+
Details | Diff | Splinter Review

Description Jake Verbaten 2011-10-28 11:48:49 PDT
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
Comment 1 Olli Pettay [:smaug] 2011-10-29 17:11:57 PDT
I think the backwards incompatible behavior of DOM4 is ok.
Comment 2 Olli Pettay [:smaug] 2011-10-29 17:13:11 PDT
...patch coming.
Comment 3 Olli Pettay [:smaug] 2011-10-29 17:19:29 PDT
(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.
Comment 4 Jake Verbaten 2011-10-29 18:41:24 PDT
Thank you for pointing out there is Editors draft!
Comment 5 Olli Pettay [:smaug] 2011-10-30 09:45:58 PDT
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).
Comment 6 Olli Pettay [:smaug] 2011-10-30 13:36:44 PDT
Created attachment 570566 [details] [diff] [review]
patch
Comment 7 Jonas Sicking (:sicking) PTO Until July 5th 2011-10-30 14:03:01 PDT
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.
Comment 8 Olli Pettay [:smaug] 2011-10-30 14:06:11 PDT
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 :)
Comment 9 Olli Pettay [:smaug] 2011-10-30 14:33:02 PDT
https://hg.mozilla.org/mozilla-central/rev/d93d320aee64
Comment 10 Marek Stępień [:marcoos, inactive] 2011-11-23 11:47:10 PST
Documented this change in https://developer.mozilla.org/en/DOM/document.importNode#section_2

Note You need to log in before you can comment on or make changes to this bug.