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

Unified Diff: sky/engine/core/css/resolver/StyleResolver.cpp

Issue 1068393002: remove CSS 'all' property. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/css/resolver/StyleResolver.cpp
diff --git a/sky/engine/core/css/resolver/StyleResolver.cpp b/sky/engine/core/css/resolver/StyleResolver.cpp
index ebb8229f65e5ce98357e11f79106924fc53c6576..dfa466916aa9e4f0c4eb8e056a6d28ead62af811 100644
--- a/sky/engine/core/css/resolver/StyleResolver.cpp
+++ b/sky/engine/core/css/resolver/StyleResolver.cpp
@@ -393,44 +393,6 @@ bool StyleResolver::isPropertyForPass(CSSPropertyID property)
return firstCSSPropertyId<pass>() <= property && property <= lastCSSPropertyId<pass>();
}
-// 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)
-{
- bool isUnsetValue = !allValue->isInitialValue() && !allValue->isInheritedValue();
- unsigned startCSSProperty = firstCSSPropertyId<pass>();
- unsigned endCSSProperty = lastCSSPropertyId<pass>();
-
- for (unsigned i = startCSSProperty; i <= endCSSProperty; ++i) {
- CSSPropertyID propertyId = static_cast<CSSPropertyID>(i);
-
- // StyleBuilder does not allow any expanded shorthands.
- if (isExpandedShorthandForAll(propertyId))
- continue;
-
- // all shorthand spec says:
- // The all property is a shorthand that resets all CSS properties
- // except direction and unicode-bidi.
- // c.f. http://dev.w3.org/csswg/css-cascade/#all-shorthand
- // We skip applyProperty when a given property is unicode-bidi or
- // direction.
- if (!CSSProperty::isAffectedByAllProperty(propertyId))
- continue;
-
- CSSValue* value;
- if (!isUnsetValue) {
- value = allValue;
- } else {
- if (CSSPropertyMetadata::isInheritedProperty(propertyId))
- value = cssValuePool().createInheritedValue().get();
- else
- value = cssValuePool().createExplicitInitialValue().get();
- }
- StyleBuilder::applyProperty(propertyId, state, value);
- }
-}
-
template <StyleResolver::StyleApplicationPass pass>
void StyleResolver::applyProperties(StyleResolverState& state, const StylePropertySet* properties, bool inheritedOnly)
{
@@ -438,12 +400,6 @@ void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper
for (unsigned i = 0; i < propertyCount; ++i) {
StylePropertySet::PropertyReference current = properties->propertyAt(i);
- CSSPropertyID property = current.id();
- if (property == CSSPropertyAll) {
- applyAllProperty<pass>(state, current.value());
- continue;
- }
-
if (inheritedOnly && !current.isInherited()) {
// If the property value is explicitly inherited, we need to apply further non-inherited properties
// as they might override the value inherited here. For this reason we don't allow declarations with
@@ -452,6 +408,7 @@ void StyleResolver::applyProperties(StyleResolverState& state, const StyleProper
continue;
}
+ CSSPropertyID property = current.id();
if (!isPropertyForPass<pass>(property))
continue;
if (pass == HighPriorityProperties && property == CSSPropertyLineHeight)
« no previous file with comments | « sky/engine/core/css/resolver/StyleResolver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698