Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Unified Diff: Source/core/dom/shadow/ShadowRoot.cpp

Issue 77863002: Update styleRecalc so that it traverses shadow insertion points in 2 pass algorithms (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Make styleRecalc traverse shadow trees in 2 pass algorithm Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/shadow/ShadowRoot.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« Source/core/dom/Element.cpp ('K') | « Source/core/dom/shadow/ShadowRoot.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698