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

Unified Diff: Source/core/css/invalidation/StyleInvalidator.cpp

Issue 286903024: Skip child ShadowRoots when invalidation does not have boundary crossing rules (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build Created 6 years, 7 months 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
« no previous file with comments | « Source/core/css/invalidation/StyleInvalidator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/invalidation/StyleInvalidator.cpp
diff --git a/Source/core/css/invalidation/StyleInvalidator.cpp b/Source/core/css/invalidation/StyleInvalidator.cpp
index 39fb027fdba4805885ac8874bede480d3cc688ce..3874c2b93e68f63610c8ad2889e925bec1a61e84 100644
--- a/Source/core/css/invalidation/StyleInvalidator.cpp
+++ b/Source/core/css/invalidation/StyleInvalidator.cpp
@@ -71,6 +71,8 @@ StyleInvalidator::~StyleInvalidator()
void StyleInvalidator::RecursionData::pushInvalidationSet(const DescendantInvalidationSet& invalidationSet)
{
ASSERT(!m_wholeSubtreeInvalid);
+ if (invalidationSet.treeBoundaryCrossing())
+ m_treeBoundaryCrossing = true;
if (invalidationSet.wholeSubtreeInvalid()) {
m_wholeSubtreeInvalid = true;
return;
@@ -115,14 +117,16 @@ bool StyleInvalidator::invalidateChildren(Element& element)
{
bool someChildrenNeedStyleRecalc = false;
for (ShadowRoot* root = element.youngestShadowRoot(); root; root = root->olderShadowRoot()) {
- for (Element* child = ElementTraversal::firstWithin(*root); child; child = ElementTraversal::nextSibling(*child)) {
+ if (!m_recursionData.treeBoundaryCrossing() && !root->childNeedsStyleInvalidation() && !root->needsStyleInvalidation())
+ continue;
+ for (Element* child = ElementTraversal::firstChild(*root); child; child = ElementTraversal::nextSibling(*child)) {
bool childRecalced = invalidate(*child);
someChildrenNeedStyleRecalc = someChildrenNeedStyleRecalc || childRecalced;
}
root->clearChildNeedsStyleInvalidation();
root->clearNeedsStyleInvalidation();
}
- for (Element* child = ElementTraversal::firstWithin(element); child; child = ElementTraversal::nextSibling(*child)) {
+ for (Element* child = ElementTraversal::firstChild(element); child; child = ElementTraversal::nextSibling(*child)) {
bool childRecalced = invalidate(*child);
someChildrenNeedStyleRecalc = someChildrenNeedStyleRecalc || childRecalced;
}
« no previous file with comments | « Source/core/css/invalidation/StyleInvalidator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698