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

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

Issue 167603002: Implement 'will-change' parsing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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
Index: Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/Source/core/css/resolver/StyleBuilderCustom.cpp b/Source/core/css/resolver/StyleBuilderCustom.cpp
index a30084fe0034412b92288c9e67c730e7b1aa52c2..d1daf005af4a31d68161da18c57e598b4bbba292 100644
--- a/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -864,6 +864,43 @@ void StyleBuilderFunctions::applyValueCSSPropertyTextUnderlinePosition(StyleReso
state.style()->setTextUnderlinePosition(static_cast<TextUnderlinePosition>(t));
}
+void StyleBuilderFunctions::applyInitialCSSPropertyWillChange(StyleResolverState& state)
+{
+ state.style()->setWillChangeContents(false);
+ state.style()->setWillChangeScrollPosition(false);
+ state.style()->setWillChangeProperties(Vector<CSSPropertyID>());
+}
+
+void StyleBuilderFunctions::applyInheritCSSPropertyWillChange(StyleResolverState& state)
+{
+ state.style()->setWillChangeContents(state.parentStyle()->willChangeContents());
+ state.style()->setWillChangeScrollPosition(state.parentStyle()->willChangeScrollPosition());
+ state.style()->setWillChangeProperties(state.parentStyle()->willChangeProperties());
+}
+
+void StyleBuilderFunctions::applyValueCSSPropertyWillChange(StyleResolverState& state, CSSValue* value)
+{
+ ASSERT(value->isValueList());
+ bool willChangeContents = false;
+ bool willChangeScrollPosition = false;
+ Vector<CSSPropertyID> willChangeProperties;
+
+ for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
+ CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(i.value());
+ if (CSSPropertyID propertyID = primitiveValue->getPropertyID())
+ willChangeProperties.append(propertyID);
+ else if (primitiveValue->getValueID() == CSSValueContents)
+ willChangeContents = true;
+ else if (primitiveValue->getValueID() == CSSValueScrollPosition)
+ willChangeScrollPosition = true;
+ else
+ ASSERT_NOT_REACHED();
+ }
+ state.style()->setWillChangeContents(willChangeContents);
+ state.style()->setWillChangeScrollPosition(willChangeScrollPosition);
+ state.style()->setWillChangeProperties(willChangeProperties);
+}
+
// Everything below this line is from the old StyleResolver::applyProperty
// and eventually needs to move into new StyleBuilderFunctions calls intead.
@@ -1944,6 +1981,7 @@ void StyleBuilder::oldApplyProperty(CSSPropertyID id, StyleResolverState& state,
case CSSPropertyWhiteSpace:
case CSSPropertyWidows:
case CSSPropertyWidth:
+ case CSSPropertyWillChange:
case CSSPropertyWordBreak:
case CSSPropertyWordSpacing:
case CSSPropertyWordWrap:

Powered by Google App Engine
This is Rietveld 408576698