ShadowRoot shouldn't be adopted by any Document.
authormorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 04:52:47 +0000 (04:52 +0000)
committermorrita@google.com <morrita@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Apr 2012 04:52:47 +0000 (04:52 +0000)
commit2740b60c0c0d9c87d029054df9522479c48372fd
tree323281140744d538dfe3dec0b7f4309b44362c85
parent880be07495428c0cd8e55c9a32abbbbe8e2eeca9
ShadowRoot shouldn't be adopted by any Document.
https://bugs.webkit.org/show_bug.cgi?id=84127

Reviewed by Dimitri Glazkov.

Source/WebCore:

ShadowRoot cannot cannot be removed from its host, which means
ShadowRoot cannot be adopted by any Document directly because the
adoptNode() tries to remove it from its parent but it doesn't make
sense for ShadowRoot.

This change adds a guard to check such a case.

Test: fast/dom/shadow/adopt-node-with-shadow-root.html

* dom/Document.cpp:
(WebCore::Document::adoptNode):

LayoutTests:

* fast/dom/shadow/adopt-node-with-shadow-root-expected.txt: Added.
* fast/dom/shadow/adopt-node-with-shadow-root.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@114481 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt [new file with mode: 0644]
LayoutTests/fast/dom/shadow/adopt-node-with-shadow-root.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp