Skip to content

Commit ec84d41

Browse files
committed
<third_party/WebKit> Cherry-pick fix for CVE-2015-6777
Fix an optimisation in ContainerNode::notifyNodeInsertedInternal [email protected] BUG=544020 Review URL: https://codereview.chromium.org/1420653003 Change-Id: I397ca8da475d34fa599ad297334e59eaaab7d920 Cr-Commit-Position: refs/heads/master@{#355240} Reviewed-by: Michael Brüning <[email protected]>
1 parent f5c64cc commit ec84d41

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

chromium/third_party/WebKit/Source/core/dom/ContainerNode.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -799,8 +799,8 @@ void ContainerNode::notifyNodeInsertedInternal(Node& root, NodeVector& postInser
799799

800800
for (Node& node : NodeTraversal::inclusiveDescendantsOf(root)) {
801801
// As an optimization we don't notify leaf nodes when when inserting
802-
// into detached subtrees.
803-
if (!inDocument() && !node.isContainerNode())
802+
// into detached subtrees that are not in a shadow tree.
803+
if (!inDocument() && !isInShadowTree() && !node.isContainerNode())
804804
continue;
805805
if (Node::InsertionShouldCallDidNotifySubtreeInsertions == node.insertedInto(this))
806806
postInsertionNotificationTargets.append(&node);

chromium/third_party/WebKit/Source/core/dom/Element.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ inline Node::InsertionNotificationRequest Node::insertedInto(ContainerNode* inse
775775
{
776776
ASSERT(!childNeedsStyleInvalidation());
777777
ASSERT(!needsStyleInvalidation());
778-
ASSERT(insertionPoint->inDocument() || isContainerNode());
778+
ASSERT(insertionPoint->inDocument() || insertionPoint->isInShadowTree() || isContainerNode());
779779
if (insertionPoint->inDocument())
780780
setFlag(InDocumentFlag);
781781
if (parentOrShadowHostNode()->isInShadowTree())

0 commit comments

Comments
 (0)