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

Unified Diff: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp

Issue 2352273002: CSS Motion Path: offset-anchor and offset-position (Closed)
Patch Set: rebase Created 4 years, 3 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: third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
diff --git a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
index 13087ebb9e5028c08d8540cae7bd85d5381a7f81..d362ad3ed16f1828ee47cc99cdce66ee2ddaf6cc 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -577,6 +577,18 @@ static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style)
return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescription().computedSize()), style);
}
+static CSSValue* valueForPosition(const LengthPoint& position, const ComputedStyle& style)
+{
+ DCHECK((position.x() == Auto) == (position.y() == Auto));
+ if (position.x() == Auto) {
+ return CSSPrimitiveValue::createIdentifier(CSSValueAuto);
+ }
+ CSSValueList* list = CSSValueList::createSpaceSeparated();
+ list->append(*zoomAdjustedPixelValueForLength(position.x(), style));
+ list->append(*zoomAdjustedPixelValueForLength(position.y(), style));
+ return list;
+}
+
static CSSValueID identifierForFamily(const AtomicString& family)
{
if (family == FontFamilyNames::webkit_cursive)
@@ -2730,6 +2742,12 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
case CSSPropertyOffset:
return valuesForShorthandProperty(offsetShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
+ case CSSPropertyOffsetAnchor:
+ return valueForPosition(style.offsetAnchor(), style);
+
+ case CSSPropertyOffsetPosition:
+ return valueForPosition(style.offsetPosition(), style);
+
case CSSPropertyOffsetPath:
if (const StylePath* styleMotionPath = style.offsetPath())
return styleMotionPath->computedCSSValue();
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSProperties.in ('k') | third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698