Index: Source/core/dom/shadow/ShadowRoot.cpp |
diff --git a/Source/core/dom/shadow/ShadowRoot.cpp b/Source/core/dom/shadow/ShadowRoot.cpp |
index c9f7909eae3983efad4456902a4d9475f4412efb..d5a579c82a6b38f6deb0f720dfe2e3b9ef348c86 100644 |
--- a/Source/core/dom/shadow/ShadowRoot.cpp |
+++ b/Source/core/dom/shadow/ShadowRoot.cpp |
@@ -161,6 +161,14 @@ bool ShadowRoot::childTypeAllowed(NodeType type) const |
} |
} |
+InsertionPoint* ShadowRoot::shadowInsertionPoint() const |
+{ |
+ ASSERT(!owner()->needsDistributionRecalc()); |
+ if (isOldest()) |
+ return 0; |
+ return olderShadowRoot()->shadowInsertionPointOfYoungerShadowRoot(); |
+} |
+ |
void ShadowRoot::recalcStyle(StyleRecalcChange change) |
{ |
// ShadowRoot doesn't support custom callbacks. |
@@ -177,13 +185,14 @@ void ShadowRoot::recalcStyle(StyleRecalcChange change) |
// FIXME: This doesn't handle :hover + div properly like Element::recalcStyle does. |
Text* lastTextNode = 0; |
+ InsertionPoint* shadowInsertionPointInShadowTree = shadowInsertionPoint(); |
for (Node* child = lastChild(); child; child = child->previousSibling()) { |
if (child->isTextNode()) { |
toText(child)->recalcTextStyle(change, lastTextNode); |
lastTextNode = toText(child); |
} else if (child->isElementNode()) { |
if (shouldRecalcStyle(change, child)) |
- toElement(child)->recalcStyle(change, lastTextNode); |
+ toElement(child)->recalcStyle(change, lastTextNode, shadowInsertionPointInShadowTree); |
if (child->renderer()) |
lastTextNode = 0; |
} |