Index: Source/core/css/resolver/StyleResolver.cpp |
diff --git a/Source/core/css/resolver/StyleResolver.cpp b/Source/core/css/resolver/StyleResolver.cpp |
index 68b82de9426e309f64abb8bf400a0b4a9ae9d02f..5658520f8fb0fdbcab0a7b8638e1ab77f5c054b5 100644 |
--- a/Source/core/css/resolver/StyleResolver.cpp |
+++ b/Source/core/css/resolver/StyleResolver.cpp |
@@ -1283,7 +1283,7 @@ bool StyleResolver::isPropertyForPass(CSSPropertyID property) |
// This method expands the 'all' shorthand property to longhand properties |
// and applies the expanded longhand properties. |
template <StyleResolver::StyleApplicationPass pass> |
-void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allValue) |
+void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allValue, bool inheritedOnly) |
{ |
bool isUnsetValue = !allValue->isInitialValue() && !allValue->isInheritedValue(); |
unsigned startCSSProperty = firstCSSPropertyId<pass>(); |
@@ -1305,6 +1305,11 @@ void StyleResolver::applyAllProperty(StyleResolverState& state, CSSValue* allVal |
if (!CSSProperty::isAffectedByAllProperty(propertyId)) |
continue; |
+ // When hitting matched properties' cache, only inherited properties will be |
+ // applied. |
+ if (inheritedOnly && !CSSPropertyMetadata::isInheritedProperty(propertyId)) |
+ continue; |
+ |
CSSValue* value; |
if (!isUnsetValue) { |
value = allValue; |
@@ -1329,7 +1334,7 @@ void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper |
CSSPropertyID property = current.id(); |
if (property == CSSPropertyAll) { |
- applyAllProperty<pass>(state, current.value()); |
+ applyAllProperty<pass>(state, current.value(), inheritedOnly); |
continue; |
} |