Chromium Code Reviews| Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp |
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp |
| index 2357ad74eb163a9073b0a2a55d3c5e32ed02e8c0..61ec4687e9b44bad3d8fadf3a5a0700d50aeec7a 100644 |
| --- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp |
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp |
| @@ -1533,7 +1533,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc |
| bool applyInheritedOnly = false; |
| const CachedMatchedProperties* cachedMatchedProperties = cacheHash ? m_matchedPropertiesCache.find(cacheHash, state, matchResult.matchedProperties()) : nullptr; |
| - if (cachedMatchedProperties && MatchedPropertiesCache::isCacheable(*state.style(), *state.parentStyle())) { |
| + if (cachedMatchedProperties && MatchedPropertiesCache::isCacheable(*state.style(), *state.parentStyle(), state.parentNode())) { |
|
hayato
2016/08/30 02:01:05
Could you explain briefly what parentStyle means i
esprehn
2016/08/30 21:37:10
Can we just pass State into isCacheable? Passing a
|
| INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), matchedPropertyCacheHit, 1); |
| // We can build up the style by copying non-inherited properties from an earlier style object built using the same exact |
| // style declarations. We then only need to apply the inherited properties, if any, as their values can depend on the |
| @@ -1627,7 +1627,7 @@ void StyleResolver::applyMatchedProperties(StyleResolverState& state, const Matc |
| loadPendingResources(state); |
| - if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCacheable(*state.style(), *state.parentStyle())) { |
| + if (!cachedMatchedProperties && cacheHash && MatchedPropertiesCache::isCacheable(*state.style(), *state.parentStyle(), state.parentNode())) { |
| ASSERT(RuntimeEnabledFeatures::styleMatchedPropertiesCacheEnabled()); |
| INCREMENT_STYLE_STATS_COUNTER(document().styleEngine(), matchedPropertyCacheAdded, 1); |
| m_matchedPropertiesCache.add(*state.style(), *state.parentStyle(), cacheHash, matchResult.matchedProperties()); |