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

Unified Diff: third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp

Issue 2283933003: Don't cache matched properties for elements without a flat-tree parent. (Closed)
Patch Set: Trying to mend test failure. Created 4 years, 4 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
Index: third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
index 3c86ee5319e15af2cd90d07ca020db16d4aa610b..072e2e98e815bb5ea40a3ead768904b076434e7b 100644
--- a/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/MatchedPropertiesCache.cpp
@@ -113,7 +113,7 @@ void MatchedPropertiesCache::clearViewportDependent()
m_cache.removeAll(toRemove);
}
-bool MatchedPropertiesCache::isCacheable(const ComputedStyle& style, const ComputedStyle& parentStyle)
+bool MatchedPropertiesCache::isCacheable(const ComputedStyle& style, const ComputedStyle& parentStyle, const ContainerNode* flatTreeParent)
{
if (style.unique() || (style.styleType() != PseudoIdNone && parentStyle.unique()))
return false;
@@ -122,7 +122,9 @@ bool MatchedPropertiesCache::isCacheable(const ComputedStyle& style, const Compu
if (style.getWritingMode() != ComputedStyle::initialWritingMode() || style.direction() != ComputedStyle::initialDirection())
return false;
// The cache assumes static knowledge about which properties are inherited.
- if (parentStyle.hasExplicitlyInheritedProperties())
+ // Without a flat tree parent, StyleBuilder::applyProperty will not
+ // setHasExplicitlyInheritedProperties on the parent style.
+ if (!flatTreeParent || parentStyle.hasExplicitlyInheritedProperties())
return false;
if (style.hasVariableReferenceFromNonInheritedProperty())
return false;

Powered by Google App Engine
This is Rietveld 408576698