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

Unified Diff: Source/core/css/CSSComputedStyleDeclaration.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/CSSComputedStyleDeclaration.cpp
diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp
index 28463bec6a3180ba3ac191da7cb5d6b745b52abc..8a7e5c5f6c95d18fd7ae69914d64b0ab4194ae67 100644
--- a/Source/core/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/core/css/CSSComputedStyleDeclaration.cpp
@@ -205,6 +205,7 @@ static const CSSPropertyID staticComputableProperties[] = {
CSSPropertyWhiteSpace,
CSSPropertyWidows,
CSSPropertyWidth,
+ CSSPropertyWillChange,
CSSPropertyWordBreak,
CSSPropertyWordSpacing,
CSSPropertyWordWrap,
@@ -1083,6 +1084,20 @@ static PassRefPtr<CSSValue> valueForAnimationDirection(CSSAnimationData::Animati
}
}
+static PassRefPtr<CSSValue> valueForWillChange(const Vector<CSSPropertyID>& willChangeProperties, bool willChangeContents, bool willChangeScrollPosition)
+{
+ RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
+ if (willChangeContents)
+ list->append(cssValuePool().createIdentifierValue(CSSValueContents));
+ if (willChangeScrollPosition)
+ list->append(cssValuePool().createIdentifierValue(CSSValueScrollPosition));
+ for (size_t i = 0; i < willChangeProperties.size(); ++i)
+ list->append(cssValuePool().createIdentifierValue(willChangeProperties[i]));
+ if (!list->length())
+ list->append(cssValuePool().createIdentifierValue(CSSValueAuto));
+ return list.release();
+}
+
static PassRefPtr<CSSValue> createLineBoxContainValue(unsigned lineBoxContain)
{
if (!lineBoxContain)
@@ -2253,6 +2268,8 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
return zoomAdjustedPixelValue(sizingBox(renderer).width(), *style);
}
return zoomAdjustedPixelValueForLength(style->width(), *style);
+ case CSSPropertyWillChange:
+ return valueForWillChange(style->willChangeProperties(), style->willChangeContents(), style->willChangeScrollPosition());
case CSSPropertyWordBreak:
return cssValuePool().createValue(style->wordBreak());
case CSSPropertyWordSpacing:

Powered by Google App Engine
This is Rietveld 408576698