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; |