| Index: third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
|
| diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
|
| index 44d2b01cba41f3f26c053d890631d70f069083d4..26bceeca5f8239e5d8bbb85b5016304057a4acaf 100644
|
| --- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
|
| +++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp
|
| @@ -506,6 +506,18 @@ String StylePropertySerializer::GetPropertyValue(
|
| }
|
| case CSSPropertyBorderRadius:
|
| return Get4Values(borderRadiusShorthand());
|
| + case CSSPropertyScrollPadding:
|
| + return Get4Values(scrollPaddingShorthand());
|
| + case CSSPropertyScrollPaddingBlock:
|
| + return Get2Values(scrollPaddingBlockShorthand());
|
| + case CSSPropertyScrollPaddingInline:
|
| + return Get2Values(scrollPaddingInlineShorthand());
|
| + case CSSPropertyScrollSnapMargin:
|
| + return Get4Values(scrollSnapMarginShorthand());
|
| + case CSSPropertyScrollSnapMarginBlock:
|
| + return Get2Values(scrollSnapMarginBlockShorthand());
|
| + case CSSPropertyScrollSnapMarginInline:
|
| + return Get2Values(scrollSnapMarginInlineShorthand());
|
| default:
|
| return String();
|
| }
|
| @@ -653,6 +665,32 @@ String StylePropertySerializer::FontVariantValue() const {
|
| return result.ToString();
|
| }
|
|
|
| +String StylePropertySerializer::Get2Values(
|
| + const StylePropertyShorthand& shorthand) const {
|
| + // Assume the properties are in the usual order start, end.
|
| + int start_value_index =
|
| + property_set_.FindPropertyIndex(shorthand.properties()[0]);
|
| + int end_value_index =
|
| + property_set_.FindPropertyIndex(shorthand.properties()[1]);
|
| +
|
| + if (start_value_index == -1 || end_value_index == -1)
|
| + return String();
|
| +
|
| + PropertyValueForSerializer start =
|
| + property_set_.PropertyAt(start_value_index);
|
| + PropertyValueForSerializer end = property_set_.PropertyAt(end_value_index);
|
| +
|
| + bool show_end = !DataEquivalent(start.Value(), end.Value());
|
| +
|
| + StringBuilder result;
|
| + result.Append(start.Value()->CssText());
|
| + if (show_end) {
|
| + result.Append(' ');
|
| + result.Append(end.Value()->CssText());
|
| + }
|
| + return result.ToString();
|
| +}
|
| +
|
| String StylePropertySerializer::Get4Values(
|
| const StylePropertyShorthand& shorthand) const {
|
| // Assume the properties are in the usual order top, right, bottom, left.
|
|
|