WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
11646
Implement Document.cloneNode()
https://bugs.webkit.org/show_bug.cgi?id=11646
Summary
Implement Document.cloneNode()
Jesse Costello-Good
Reported
2006-11-18 16:56:03 PST
This method currently returns null.
Attachments
Fixes the bug
(16.05 KB, patch)
2013-12-09 10:39 PST
,
Ryosuke Niwa
darin
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2006-11-19 00:57:50 PST
Per the DOM spec, "cloning Document, DocumentType, Entity, and Notation nodes is implementation dependent." I couldn't find any Mozilla documentation either, so we may have to reverse-engineer it.
Jesse Costello-Good
Comment 2
2006-12-01 16:16:53 PST
A perhaps non-obvious feature of this method is that if the target of the clone() method has a node <xsl:import href="">, the cloned document should be able to resolve the href attribute in the same way that the target would. In other words, the cloned document needs to behave the same as if it had been loaded from the same URL as the target document. Related bug:
http://bugs.webkit.org/show_bug.cgi?id=10313
Alexey Proskuryakov
Comment 3
2013-08-19 09:32:25 PDT
***
Bug 119928
has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 4
2013-08-19 09:33:03 PDT
https://chromium.googlesource.com/chromium/blink/+/dc7879025e01d63be9fcf6a84ca6c9b8b5768a80
Alexey Proskuryakov
Comment 5
2013-12-05 00:13:34 PST
***
Bug 125285
has been marked as a duplicate of this bug. ***
Ryosuke Niwa
Comment 6
2013-12-09 10:39:39 PST
Created
attachment 218776
[details]
Fixes the bug
Darin Adler
Comment 7
2013-12-09 11:30:14 PST
Comment on
attachment 218776
[details]
Fixes the bug View in context:
https://bugs.webkit.org/attachment.cgi?id=218776&action=review
> Source/WebCore/dom/Document.cpp:3039 > + return isXHTMLDocument() ? createXHTML(0, url()) : create(0, url());
nullptr please, not 0
> Source/WebCore/html/HTMLDocument.cpp:370 > + return create(0, url());
nullptr please, not 0
> Source/WebCore/svg/SVGDocument.cpp:105 > + return create(0, url());
nullptr please, not 0
> Source/WebCore/svg/SVGDocument.h:56 > + virtual PassRefPtr<Document> cloneDocumentWithoutChildren() const OVERRIDE FINAL;
Class is FINAL so no need to mark function FINAL, but I suppose there’s no harm in it.
Ryosuke Niwa
Comment 8
2013-12-09 14:03:43 PST
Committed
r160330
: <
http://trac.webkit.org/changeset/160330
>
Lucas Forschler
Comment 9
2019-02-06 09:03:48 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug