Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
ShadowRoot.cloneNode() must always throw a DATA_CLONE_ERR exception.
https://bugs.webkit.org/show_bug.cgi?id=91704 Reviewed by Dimitri Glazkov. Source/WebCore: According to the spec, ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception. The existing implementation returned null object instead. We change the cloneNode() interface so that we can throw an exception from cloneNode(). Test: fast/dom/shadow/shadowroot-clonenode.html * dom/Attr.cpp: (WebCore::Attr::cloneNode): * dom/Attr.h: * dom/CDATASection.cpp: (WebCore::CDATASection::cloneNode): * dom/CDATASection.h: (CDATASection): * dom/Comment.cpp: (WebCore::Comment::cloneNode): * dom/Comment.h: (Comment): * dom/Document.cpp: (WebCore::Document::cloneNode): * dom/Document.h: (Document): * dom/DocumentFragment.cpp: (WebCore::DocumentFragment::cloneNode): * dom/DocumentFragment.h: (DocumentFragment): * dom/DocumentType.cpp: (WebCore::DocumentType::cloneNode): * dom/DocumentType.h: (DocumentType): * dom/Element.cpp: (WebCore::Element::cloneNode): * dom/Element.h: (Element): * dom/EntityReference.cpp: (WebCore::EntityReference::cloneNode): * dom/EntityReference.h: (EntityReference): * dom/Node.h: (Node): (WebCore::Node::cloneNode): * dom/Node.idl: * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::cloneNode): * dom/ProcessingInstruction.h: (ProcessingInstruction): * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::cloneNode): * dom/ShadowRoot.h: (ShadowRoot): * dom/Text.cpp: (WebCore::Text::cloneNode): * dom/Text.h: (Text): LayoutTests: * fast/dom/shadow/shadowroot-clonenode-expected.txt: Added. * fast/dom/shadow/shadowroot-clonenode.html: Added. Canonical link: https://commits.webkit.org/112364@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@126127 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Shinya Kawanaka
committed
Aug 21, 2012
1 parent
3b62f2c
commit ce7c380
Showing
28 changed files
with
137 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
LayoutTests/fast/dom/shadow/shadowroot-clonenode-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Calling ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS exceptionCode is DOMException.DATA_CLONE_ERR | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!DOCTYPE> | ||
<html> | ||
<script src="../../js/resources/js-test-pre.js"></script> | ||
<script src="resources/polyfill.js"></script> | ||
|
||
<pre id="console"></pre> | ||
|
||
<script> | ||
description('Calling ShadowRoot.cloneNode() should throw a DATA_CLONE_ERR exception.'); | ||
|
||
var host = document.createElement('div'); | ||
var shadowRoot = new WebKitShadowRoot(host); | ||
|
||
var exceptionCode = null; | ||
try { | ||
shadowRoot.cloneNode() | ||
} catch (e) { | ||
exceptionCode = e.code; | ||
} | ||
|
||
shouldBe('exceptionCode', 'DOMException.DATA_CLONE_ERR') | ||
|
||
finishJSTest(); | ||
</script> | ||
<script src="../../js/resources/js-test-post.js"></script> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters