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

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

Issue 2247773004: [WIP] CSS Motion Path: offset-anchor and offset-position Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: offsetAnchor Created 4 years, 4 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 ef1ab3cf7ccbbe200a8d81e6721fd1ec322a133f..bed53b629764315c2da3d21a21fd90488b8b60c9 100644
--- a/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
+++ b/third_party/WebKit/Source/core/css/ComputedStyleCSSValueMapping.cpp
@@ -579,6 +579,18 @@ static CSSPrimitiveValue* valueForLineHeight(const ComputedStyle& style)
return zoomAdjustedPixelValue(floatValueForLength(length, style.getFontDescription().computedSize()), style);
}
+static CSSValue* valueForOffsetPosition(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)
@@ -2522,6 +2534,10 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
}
return list;
}
+ case CSSPropertyOffsetAnchor:
+ return valueForOffsetPosition(style.offsetAnchor(), style);
+ case CSSPropertyOffsetPosition:
+ return valueForOffsetPosition(style.offsetPosition(), style);
case CSSPropertyWebkitRtlOrdering:
return CSSPrimitiveValue::createIdentifier(style.rtlOrdering() ? CSSValueVisual : CSSValueLogical);
case CSSPropertyWebkitTapHighlightColor:
@@ -2712,19 +2728,22 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
case CSSPropertyMotion:
return valuesForShorthandProperty(motionShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
- case CSSPropertyMotionPath:
- if (const StylePath* styleMotionPath = style.motionPath())
+ case CSSPropertyOffset:
+ return valuesForShorthandProperty(offsetShorthand(), style, layoutObject, styledNode, allowVisitedStyle);
+
+ case CSSPropertyOffsetPath:
+ if (const StylePath* styleMotionPath = style.offsetPath())
return styleMotionPath->computedCSSValue();
return CSSPrimitiveValue::createIdentifier(CSSValueNone);
- case CSSPropertyMotionOffset:
- return zoomAdjustedPixelValueForLength(style.motionOffset(), style);
+ case CSSPropertyOffsetDistance:
+ return zoomAdjustedPixelValueForLength(style.offsetDistance(), style);
- case CSSPropertyMotionRotation: {
+ case CSSPropertyOffsetRotation: {
CSSValueList* list = CSSValueList::createSpaceSeparated();
- if (style.motionRotation().type == MotionRotationAuto)
+ if (style.offsetRotation().type == OffsetRotationAuto)
list->append(*CSSPrimitiveValue::createIdentifier(CSSValueAuto));
- list->append(*CSSPrimitiveValue::create(style.motionRotation().angle, CSSPrimitiveValue::UnitType::Degrees));
+ list->append(*CSSPrimitiveValue::create(style.offsetRotation().angle, CSSPrimitiveValue::UnitType::Degrees));
return list;
}
@@ -3009,3 +3028,4 @@ const CSSValue* ComputedStyleCSSValueMapping::get(CSSPropertyID propertyID, cons
}
} // namespace blink
+

Powered by Google App Engine
This is Rietveld 408576698