| Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
|
| index 2c6c1efdda5aa3c77c31b92e3c24d99d21ade6af..be66909ce78e4ed842f24922bf1f7bb7d8d243b7 100644
|
| --- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
|
| +++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
|
| @@ -1247,41 +1247,43 @@ TransformOrigin StyleBuilderConverter::ConvertTransformOrigin(
|
| StyleBuilderConverter::ConvertComputedLength<float>(state, list.Item(2)));
|
| }
|
|
|
| -ScrollSnapPoints StyleBuilderConverter::ConvertSnapPoints(
|
| - StyleResolverState& state,
|
| - const CSSValue& value) {
|
| - // Handles: none | repeat(<length>)
|
| - ScrollSnapPoints points;
|
| - points.has_repeat = false;
|
| -
|
| - if (!value.IsFunctionValue())
|
| - return points;
|
| +ScrollSnapType StyleBuilderConverter::ConvertSnapType(StyleResolverState&,
|
| + const CSSValue& value) {
|
| + ScrollSnapType snapType = ComputedStyle::InitialScrollSnapType();
|
| + if (value.IsValuePair()) {
|
| + const CSSValuePair& pair = ToCSSValuePair(value);
|
| + snapType.is_none = false;
|
| + snapType.axis = ToCSSIdentifierValue(pair.First()).ConvertTo<SnapAxis>();
|
| + snapType.strictness =
|
| + ToCSSIdentifierValue(pair.Second()).ConvertTo<SnapStrictness>();
|
| + return snapType;
|
| + }
|
|
|
| - const CSSFunctionValue& repeat_function = ToCSSFunctionValue(value);
|
| - SECURITY_DCHECK(repeat_function.length() == 1);
|
| - points.repeat_offset =
|
| - ConvertLength(state, ToCSSPrimitiveValue(repeat_function.Item(0)));
|
| - points.has_repeat = true;
|
| + if (ToCSSIdentifierValue(value).GetValueID() == CSSValueNone) {
|
| + snapType.is_none = true;
|
| + return snapType;
|
| + }
|
|
|
| - return points;
|
| + snapType.is_none = false;
|
| + snapType.axis = ToCSSIdentifierValue(value).ConvertTo<SnapAxis>();
|
| + return snapType;
|
| }
|
|
|
| -Vector<LengthPoint> StyleBuilderConverter::ConvertSnapCoordinates(
|
| - StyleResolverState& state,
|
| - const CSSValue& value) {
|
| - // Handles: none | <position>#
|
| - Vector<LengthPoint> coordinates;
|
| -
|
| - if (!value.IsValueList())
|
| - return coordinates;
|
| -
|
| - const CSSValueList& value_list = ToCSSValueList(value);
|
| - coordinates.ReserveInitialCapacity(value_list.length());
|
| - for (auto& snap_coordinate : value_list) {
|
| - coordinates.UncheckedAppend(ConvertPosition(state, *snap_coordinate));
|
| +ScrollSnapAlign StyleBuilderConverter::ConvertSnapAlign(StyleResolverState&,
|
| + const CSSValue& value) {
|
| + ScrollSnapAlign snapAlign = ComputedStyle::InitialScrollSnapAlign();
|
| + if (value.IsValuePair()) {
|
| + const CSSValuePair& pair = ToCSSValuePair(value);
|
| + snapAlign.alignmentX =
|
| + ToCSSIdentifierValue(pair.First()).ConvertTo<SnapAlignment>();
|
| + snapAlign.alignmentY =
|
| + ToCSSIdentifierValue(pair.Second()).ConvertTo<SnapAlignment>();
|
| + } else {
|
| + snapAlign.alignmentX =
|
| + ToCSSIdentifierValue(value).ConvertTo<SnapAlignment>();
|
| + snapAlign.alignmentY = snapAlign.alignmentX;
|
| }
|
| -
|
| - return coordinates;
|
| + return snapAlign;
|
| }
|
|
|
| PassRefPtr<TranslateTransformOperation> StyleBuilderConverter::ConvertTranslate(
|
|
|