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

Unified Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 719723002: applyAllProperty should not apply non-inherited properties when inheritedOnly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698