Changeset 160330 in webkit
- Timestamp:
- Dec 9, 2013 2:06:45 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r160323 r160330 1 2013-12-09 Ryosuke Niwa <rniwa@webkit.org> 2 3 Implement Document.cloneNode() 4 https://bugs.webkit.org/show_bug.cgi?id=11646 5 6 Reviewed by Darin Adler. 7 8 * dom/xhtml/level3/core/documentgetinputencoding04-expected.txt: 9 * dom/xhtml/level3/core/documentgetxmlencoding05-expected.txt: 10 * dom/xhtml/level3/core/nodeisequalnode01-expected.txt: 11 * dom/xhtml/level3/core/nodeisequalnode21-expected.txt: 12 * dom/xhtml/level3/core/nodeisequalnode25-expected.txt: 13 * dom/xhtml/level3/core/nodeisequalnode26-expected.txt: 14 * fast/dom/Document/clone-node-expected.txt: Added. 15 * fast/dom/Document/clone-node.html: Added. 16 * fast/dom/HTMLDocument/clone-node-quirks-mode-expected.txt: Added. 17 * fast/dom/HTMLDocument/clone-node-quirks-mode.html: Added. 18 * svg/custom/clone-node-expected.txt: Added. 19 * svg/custom/clone-node.html: Added. 20 1 21 2013-12-09 Mario Sanchez Prada <mario.prada@samsung.com> 2 22 -
trunk/LayoutTests/dom/xhtml/level3/core/documentgetinputencoding04-expected.txt
r33979 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentgetinputencoding04 2 Status error 3 Message Line 98: TypeError 2 Status Success -
trunk/LayoutTests/dom/xhtml/level3/core/documentgetxmlencoding05-expected.txt
r33979 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/documentgetxmlencoding05 2 Status error 3 Message Line 98: TypeError 2 Status Success -
trunk/LayoutTests/dom/xhtml/level3/core/nodeisequalnode01-expected.txt
r30431 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode01 2 Status failure 3 Message nodeisequalnode01: assertTrue failed 2 Status Success -
trunk/LayoutTests/dom/xhtml/level3/core/nodeisequalnode21-expected.txt
r11962 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode21 2 Status failure 3 Message nodeisequalnode21: assertTrue failed 2 Status Success -
trunk/LayoutTests/dom/xhtml/level3/core/nodeisequalnode25-expected.txt
r33979 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode25 2 2 Status error 3 Message Line 12 3: TypeError3 Message Line 125: TypeError -
trunk/LayoutTests/dom/xhtml/level3/core/nodeisequalnode26-expected.txt
r33979 r160330 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodeisequalnode26 2 2 Status error 3 Message Line 12 3: TypeError3 Message Line 125: TypeError -
trunk/Source/WebCore/ChangeLog
r160327 r160330 1 2013-12-09 Ryosuke Niwa <rniwa@webkit.org> 2 3 Implement Document.cloneNode() 4 https://bugs.webkit.org/show_bug.cgi?id=11646 5 6 Reviewed by Darin Adler. 7 8 Merge https://chromium.googlesource.com/chromium/blink/+/dc7879025e01d63be9fcf6a84ca6c9b8b5768a80 9 10 Implement the behavior specified in the current DOM4 working draft: 11 http://www.w3.org/TR/2013/WD-dom-20131107/#dom-node-clonenode 12 13 Tests: fast/dom/Document/clone-node.html 14 fast/dom/HTMLDocument/clone-node-quirks-mode.html 15 svg/custom/clone-node.html 16 17 * dom/Document.cpp: 18 (WebCore::Document::cloneNode): 19 (WebCore::Document::cloneDocumentWithoutChildren): 20 (WebCore::Document::cloneDataFromDocument): 21 * dom/Document.h: 22 * html/HTMLDocument.cpp: 23 (WebCore::HTMLDocument::cloneDocumentWithoutChildren): 24 * html/HTMLDocument.h: 25 * svg/SVGDocument.cpp: 26 (WebCore::SVGDocument::cloneDocumentWithoutChildren): 27 * svg/SVGDocument.h: 28 1 29 2013-12-09 Andreas Kling <akling@apple.com> 2 30 -
trunk/Source/WebCore/dom/Document.cpp
r159856 r160330 3026 3026 } 3027 3027 3028 PassRefPtr<Node> Document::cloneNode(bool /*deep*/) 3029 { 3030 // Spec says cloning Document nodes is "implementation dependent" and we do not support it. 3031 return nullptr; 3028 PassRefPtr<Node> Document::cloneNode(bool deep) 3029 { 3030 RefPtr<Document> clone = cloneDocumentWithoutChildren(); 3031 clone->cloneDataFromDocument(*this); 3032 if (deep) 3033 cloneChildNodes(clone.get()); 3034 return clone.release(); 3035 } 3036 3037 PassRefPtr<Document> Document::cloneDocumentWithoutChildren() const 3038 { 3039 return isXHTMLDocument() ? createXHTML(nullptr, url()) : create(nullptr, url()); 3040 } 3041 3042 void Document::cloneDataFromDocument(const Document& other) 3043 { 3044 ASSERT(m_url == other.url()); 3045 m_baseURL = other.baseURL(); 3046 m_baseURLOverride = other.baseURLOverride(); 3047 m_documentURI = other.documentURI(); 3048 3049 setCompatibilityMode(other.compatibilityMode()); 3050 setSecurityOrigin(other.securityOrigin()); 3051 setDecoder(other.decoder()); 3032 3052 } 3033 3053 -
trunk/Source/WebCore/dom/Document.h
r159246 r160330 1189 1189 void clearXMLVersion() { m_xmlVersion = String(); } 1190 1190 1191 virtual PassRefPtr<Document> cloneDocumentWithoutChildren() const; 1192 1191 1193 private: 1192 1194 friend class Node; … … 1215 1217 virtual bool childTypeAllowed(NodeType) const OVERRIDE; 1216 1218 virtual PassRefPtr<Node> cloneNode(bool deep) OVERRIDE; 1219 void cloneDataFromDocument(const Document&); 1217 1220 1218 1221 virtual void refScriptExecutionContext() OVERRIDE { ref(); } -
trunk/Source/WebCore/html/HTMLDocument.cpp
r160157 r160330 366 366 } 367 367 368 } 368 PassRefPtr<Document> HTMLDocument::cloneDocumentWithoutChildren() const 369 { 370 return create(nullptr, url()); 371 } 372 373 } -
trunk/Source/WebCore/html/HTMLDocument.h
r160072 r160330 89 89 virtual PassRefPtr<DocumentParser> createParser(); 90 90 91 virtual PassRefPtr<Document> cloneDocumentWithoutChildren() const OVERRIDE FINAL; 92 91 93 DocumentOrderedMap m_documentNamedItem; 92 94 DocumentOrderedMap m_windowNamedItem; -
trunk/Source/WebCore/svg/SVGDocument.cpp
r159036 r160330 101 101 } 102 102 103 PassRefPtr<Document> SVGDocument::cloneDocumentWithoutChildren() const 104 { 105 return create(nullptr, url()); 106 } 107 103 108 } 104 109 -
trunk/Source/WebCore/svg/SVGDocument.h
r159036 r160330 54 54 virtual bool childShouldCreateRenderer(const Node&) const OVERRIDE; 55 55 56 virtual PassRefPtr<Document> cloneDocumentWithoutChildren() const OVERRIDE; 57 56 58 FloatPoint m_translate; 57 59 };
Note: See TracChangeset
for help on using the changeset viewer.