Commit 4cf82e06 authored by Renee Wright's avatar Renee Wright Committed by Commit Bot

[Ribbon] ComputedStyleCSSValueMapping remaining cases

Bug: 775360
Change-Id: I27ee051b48ca02cd6021638fb6a269a584b41384
Reviewed-on: https://chromium-review.googlesource.com/872692Reviewed-by: default avatarnainar <nainar@chromium.org>
Commit-Queue: Renée Wright <rjwright@chromium.org>
Cr-Commit-Position: refs/heads/master@{#530359}
parent 27cc0e39
...@@ -93,6 +93,8 @@ class CSSProperty : public CSSUnresolvedProperty { ...@@ -93,6 +93,8 @@ class CSSProperty : public CSSUnresolvedProperty {
const LayoutObject*, const LayoutObject*,
Node*, Node*,
bool allow_visited_style) const { return nullptr; } bool allow_visited_style) const { return nullptr; }
// FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and
// remove this non-const Node parameter.
const CSSValue* CSSValueFromComputedStyle(const ComputedStyle&, const CSSValue* CSSValueFromComputedStyle(const ComputedStyle&,
const LayoutObject*, const LayoutObject*,
Node*, Node*,
......
...@@ -357,8 +357,8 @@ const CSSValue* CSSComputedStyleDeclaration::GetPropertyCSSValue( ...@@ -357,8 +357,8 @@ const CSSValue* CSSComputedStyleDeclaration::GetPropertyCSSValue(
if (!style) if (!style)
return nullptr; return nullptr;
const CSSValue* value = ComputedStyleCSSValueMapping::Get( const CSSValue* value = property_class.CSSValueFromComputedStyle(
property_class, *style, layout_object, styled_node, allow_visited_style_); *style, layout_object, styled_node, allow_visited_style_);
if (value) if (value)
return value; return value;
......
...@@ -3833,14 +3833,14 @@ ...@@ -3833,14 +3833,14 @@
"border-image-source", "border-image-slice", "border-image-width", "border-image-source", "border-image-slice", "border-image-width",
"border-image-outset", "border-image-repeat" "border-image-outset", "border-image-repeat"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-bottom", name: "border-bottom",
longhands: [ longhands: [
"border-bottom-width", "border-bottom-style", "border-bottom-color" "border-bottom-width", "border-bottom-style", "border-bottom-color"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-color", name: "border-color",
...@@ -3848,7 +3848,7 @@ ...@@ -3848,7 +3848,7 @@
"border-top-color", "border-right-color", "border-bottom-color", "border-top-color", "border-right-color", "border-bottom-color",
"border-left-color" "border-left-color"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-image", name: "border-image",
...@@ -3863,7 +3863,7 @@ ...@@ -3863,7 +3863,7 @@
longhands: [ longhands: [
"border-left-width", "border-left-style", "border-left-color" "border-left-width", "border-left-style", "border-left-color"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-radius", name: "border-radius",
...@@ -3878,7 +3878,7 @@ ...@@ -3878,7 +3878,7 @@
longhands: [ longhands: [
"border-right-width", "border-right-style", "border-right-color" "border-right-width", "border-right-style", "border-right-color"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-spacing", name: "border-spacing",
...@@ -3893,14 +3893,14 @@ ...@@ -3893,14 +3893,14 @@
"border-top-style", "border-right-style", "border-bottom-style", "border-top-style", "border-right-style", "border-bottom-style",
"border-left-style" "border-left-style"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
keywords: ["none"], keywords: ["none"],
typedom_types: ["Image"], typedom_types: ["Image"],
}, },
{ {
name: "border-top", name: "border-top",
longhands: ["border-top-width", "border-top-style", "border-top-color"], longhands: ["border-top-width", "border-top-style", "border-top-color"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "border-width", name: "border-width",
...@@ -3908,17 +3908,17 @@ ...@@ -3908,17 +3908,17 @@
"border-top-width", "border-right-width", "border-bottom-width", "border-top-width", "border-right-width", "border-bottom-width",
"border-left-width" "border-left-width"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "flex", name: "flex",
longhands: ["flex-grow", "flex-shrink", "flex-basis"], longhands: ["flex-grow", "flex-shrink", "flex-basis"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "flex-flow", name: "flex-flow",
longhands: ["flex-direction", "flex-wrap"], longhands: ["flex-direction", "flex-wrap"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "font", name: "font",
...@@ -3935,7 +3935,7 @@ ...@@ -3935,7 +3935,7 @@
"font-variant-ligatures", "font-variant-caps", "font-variant-ligatures", "font-variant-caps",
"font-variant-numeric", "font-variant-east-asian" "font-variant-numeric", "font-variant-east-asian"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
is_descriptor: true, is_descriptor: true,
}, },
{ {
...@@ -3944,22 +3944,22 @@ ...@@ -3944,22 +3944,22 @@
"grid-template-rows", "grid-template-columns", "grid-template-areas", "grid-template-rows", "grid-template-columns", "grid-template-areas",
"grid-auto-flow", "grid-auto-rows", "grid-auto-columns" "grid-auto-flow", "grid-auto-rows", "grid-auto-columns"
], ],
property_methods: ["ParseShorthand", "IsLayoutDependent"], property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "place-content", name: "place-content",
longhands: ["align-content", "justify-content"], longhands: ["align-content", "justify-content"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "place-items", name: "place-items",
longhands: ["align-items", "justify-items"], longhands: ["align-items", "justify-items"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "place-self", name: "place-self",
longhands: ["align-self", "justify-self"], longhands: ["align-self", "justify-self"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "grid-area", name: "grid-area",
...@@ -3967,39 +3967,39 @@ ...@@ -3967,39 +3967,39 @@
"grid-row-start", "grid-column-start", "grid-row-end", "grid-row-start", "grid-column-start", "grid-row-end",
"grid-column-end" "grid-column-end"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "grid-column", name: "grid-column",
longhands: ["grid-column-start", "grid-column-end"], longhands: ["grid-column-start", "grid-column-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "grid-gap", name: "grid-gap",
longhands: ["grid-row-gap", "grid-column-gap"], longhands: ["grid-row-gap", "grid-column-gap"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "grid-row", name: "grid-row",
longhands: ["grid-row-start", "grid-row-end"], longhands: ["grid-row-start", "grid-row-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "grid-template", name: "grid-template",
longhands: [ longhands: [
"grid-template-rows", "grid-template-columns", "grid-template-areas" "grid-template-rows", "grid-template-columns", "grid-template-areas"
], ],
property_methods: ["ParseShorthand", "IsLayoutDependent"], property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "list-style", name: "list-style",
longhands: ["list-style-type", "list-style-position", "list-style-image"], longhands: ["list-style-type", "list-style-position", "list-style-image"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "margin", name: "margin",
longhands: ["margin-top", "margin-right", "margin-bottom", "margin-left"], longhands: ["margin-top", "margin-right", "margin-bottom", "margin-left"],
property_methods: ["ParseShorthand", "IsLayoutDependent"], property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "marker", name: "marker",
...@@ -4017,7 +4017,7 @@ ...@@ -4017,7 +4017,7 @@
{ {
name: "outline", name: "outline",
longhands: ["outline-color", "outline-style", "outline-width"], longhands: ["outline-color", "outline-style", "outline-width"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "overflow", name: "overflow",
...@@ -4035,7 +4035,7 @@ ...@@ -4035,7 +4035,7 @@
longhands: [ longhands: [
"padding-top", "padding-right", "padding-bottom", "padding-left" "padding-top", "padding-right", "padding-bottom", "padding-left"
], ],
property_methods: ["ParseShorthand", "IsLayoutDependent"], property_methods: ["ParseShorthand", "IsLayoutDependent", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "page-break-after", name: "page-break-after",
...@@ -4055,19 +4055,19 @@ ...@@ -4055,19 +4055,19 @@
{ {
name: "scroll-margin", name: "scroll-margin",
longhands: ["scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left"], longhands: ["scroll-margin-top", "scroll-margin-right", "scroll-margin-bottom", "scroll-margin-left"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
name: "scroll-margin-block", name: "scroll-margin-block",
longhands: ["scroll-margin-block-start", "scroll-margin-block-end"], longhands: ["scroll-margin-block-start", "scroll-margin-block-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
name: "scroll-margin-inline", name: "scroll-margin-inline",
longhands: ["scroll-margin-inline-start", "scroll-margin-inline-end"], longhands: ["scroll-margin-inline-start", "scroll-margin-inline-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
...@@ -4076,25 +4076,25 @@ ...@@ -4076,25 +4076,25 @@
"scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom", "scroll-padding-top", "scroll-padding-right", "scroll-padding-bottom",
"scroll-padding-left" "scroll-padding-left"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
name: "scroll-padding-block", name: "scroll-padding-block",
longhands: ["scroll-padding-block-start", "scroll-padding-block-end"], longhands: ["scroll-padding-block-start", "scroll-padding-block-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
name: "scroll-padding-inline", name: "scroll-padding-inline",
longhands: ["scroll-padding-inline-start", "scroll-padding-inline-end"], longhands: ["scroll-padding-inline-start", "scroll-padding-inline-end"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
runtime_flag: "CSSScrollSnapPoints", runtime_flag: "CSSScrollSnapPoints",
}, },
{ {
name: "text-decoration", name: "text-decoration",
longhands: ["text-decoration-line", "text-decoration-style", "text-decoration-color"], longhands: ["text-decoration-line", "text-decoration-style", "text-decoration-color"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "transition", name: "transition",
...@@ -4172,12 +4172,12 @@ ...@@ -4172,12 +4172,12 @@
longhands: [ longhands: [
"column-rule-width", "column-rule-style", "column-rule-color" "column-rule-width", "column-rule-style", "column-rule-color"
], ],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "columns", name: "columns",
longhands: ["column-width", "column-count"], longhands: ["column-width", "column-count"],
property_methods: ["ParseShorthand"], property_methods: ["ParseShorthand", "CSSValueFromComputedStyleInternal"],
}, },
{ {
name: "-webkit-margin-collapse", name: "-webkit-margin-collapse",
......
...@@ -5,32 +5,19 @@ ...@@ -5,32 +5,19 @@
#ifndef ComputedStyleCSSValueMapping_h #ifndef ComputedStyleCSSValueMapping_h
#define ComputedStyleCSSValueMapping_h #define ComputedStyleCSSValueMapping_h
#include "core/CSSPropertyNames.h"
#include "core/css/CSSValue.h" #include "core/css/CSSValue.h"
#include "core/css/properties/CSSProperty.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/HashMap.h"
#include "platform/wtf/text/AtomicString.h" #include "platform/wtf/text/AtomicString.h"
namespace blink { namespace blink {
class CSSVariableData; class CSSVariableData;
class ComputedStyle; class ComputedStyle;
class LayoutObject;
class Node;
class PropertyRegistry; class PropertyRegistry;
class ComputedStyleCSSValueMapping { class ComputedStyleCSSValueMapping {
STATIC_ONLY(ComputedStyleCSSValueMapping); STATIC_ONLY(ComputedStyleCSSValueMapping);
public: public:
// FIXME: Resolve computed auto alignment in applyProperty/ComputedStyle and
// remove this non-const styledNode parameter.
static const CSSValue* Get(const CSSProperty&,
const ComputedStyle&,
const LayoutObject* = nullptr,
Node* styled_node = nullptr,
bool allow_visited_style = false);
static const CSSValue* Get(const AtomicString custom_property_name, static const CSSValue* Get(const AtomicString custom_property_name,
const ComputedStyle&, const ComputedStyle&,
const PropertyRegistry*); const PropertyRegistry*);
......
...@@ -53,9 +53,9 @@ const CSSValue* ComputedStylePropertyMap::GetProperty( ...@@ -53,9 +53,9 @@ const CSSValue* ComputedStylePropertyMap::GetProperty(
const ComputedStyle* style = UpdateStyle(); const ComputedStyle* style = UpdateStyle();
if (!style) if (!style)
return nullptr; return nullptr;
return ComputedStyleCSSValueMapping::Get(CSSProperty::Get(property_id), return CSSProperty::Get(property_id)
*style, nullptr /* layout_object */, .CSSValueFromComputedStyle(*style, nullptr /* layout_object */,
StyledNode()); StyledNode(), false);
} }
const CSSValue* ComputedStylePropertyMap::GetCustomProperty( const CSSValue* ComputedStylePropertyMap::GetCustomProperty(
...@@ -77,8 +77,8 @@ void ComputedStylePropertyMap::ForEachProperty( ...@@ -77,8 +77,8 @@ void ComputedStylePropertyMap::ForEachProperty(
CSSComputedStyleDeclaration::ComputableProperties()) { CSSComputedStyleDeclaration::ComputableProperties()) {
DCHECK(property); DCHECK(property);
DCHECK(!property->IDEquals(CSSPropertyVariable)); DCHECK(!property->IDEquals(CSSPropertyVariable));
const CSSValue* value = ComputedStyleCSSValueMapping::Get( const CSSValue* value = property->CSSValueFromComputedStyle(
*property, *style, nullptr /* layout_object */, StyledNode()); *style, nullptr /* layout_object */, StyledNode(), false);
if (value) if (value)
callback(property->GetPropertyName(), *value); callback(property->GetPropertyName(), *value);
} }
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "core/css/properties/ComputedStyleUtils.h" #include "core/css/properties/ComputedStyleUtils.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/BasicShapeFunctions.h" #include "core/css/BasicShapeFunctions.h"
#include "core/css/CSSBorderImage.h" #include "core/css/CSSBorderImage.h"
#include "core/css/CSSBorderImageSliceValue.h" #include "core/css/CSSBorderImageSliceValue.h"
...@@ -2114,4 +2115,165 @@ bool ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue( ...@@ -2114,4 +2115,165 @@ bool ComputedStyleUtils::WidthOrHeightShouldReturnUsedValue(
return !object->IsSVGChild(); return !object->IsSVGChild();
} }
CSSValueList* ComputedStyleUtils::ValuesForShorthandProperty(
const StylePropertyShorthand& shorthand,
const ComputedStyle& style,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) {
CSSValueList* list = CSSValueList::CreateSpaceSeparated();
for (size_t i = 0; i < shorthand.length(); ++i) {
const CSSValue* value =
shorthand.properties()[i]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
DCHECK(value);
list->Append(*value);
}
return list;
}
CSSValueList* ComputedStyleUtils::ValuesForGridShorthand(
const StylePropertyShorthand& shorthand,
const ComputedStyle& style,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) {
CSSValueList* list = CSSValueList::CreateSlashSeparated();
for (size_t i = 0; i < shorthand.length(); ++i) {
const CSSValue* value =
shorthand.properties()[i]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
DCHECK(value);
list->Append(*value);
}
return list;
}
CSSValueList* ComputedStyleUtils::ValuesForSidesShorthand(
const StylePropertyShorthand& shorthand,
const ComputedStyle& style,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) {
CSSValueList* list = CSSValueList::CreateSpaceSeparated();
// Assume the properties are in the usual order top, right, bottom, left.
const CSSValue* top_value =
shorthand.properties()[0]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
const CSSValue* right_value =
shorthand.properties()[1]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
const CSSValue* bottom_value =
shorthand.properties()[2]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
const CSSValue* left_value =
shorthand.properties()[3]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
// All 4 properties must be specified.
if (!top_value || !right_value || !bottom_value || !left_value)
return nullptr;
bool show_left = !DataEquivalent(right_value, left_value);
bool show_bottom = !DataEquivalent(top_value, bottom_value) || show_left;
bool show_right = !DataEquivalent(top_value, right_value) || show_bottom;
list->Append(*top_value);
if (show_right)
list->Append(*right_value);
if (show_bottom)
list->Append(*bottom_value);
if (show_left)
list->Append(*left_value);
return list;
}
CSSValuePair* ComputedStyleUtils::ValuesForInlineBlockShorthand(
const StylePropertyShorthand& shorthand,
const ComputedStyle& style,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) {
const CSSValue* start_value =
shorthand.properties()[0]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
const CSSValue* end_value =
shorthand.properties()[1]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
// Both properties must be specified.
if (!start_value || !end_value)
return nullptr;
CSSValuePair* pair = CSSValuePair::Create(start_value, end_value,
CSSValuePair::kDropIdenticalValues);
return pair;
}
static CSSValue* ExpandNoneLigaturesValue() {
CSSValueList* list = CSSValueList::CreateSpaceSeparated();
list->Append(*CSSIdentifierValue::Create(CSSValueNoCommonLigatures));
list->Append(*CSSIdentifierValue::Create(CSSValueNoDiscretionaryLigatures));
list->Append(*CSSIdentifierValue::Create(CSSValueNoHistoricalLigatures));
list->Append(*CSSIdentifierValue::Create(CSSValueNoContextual));
return list;
}
CSSValue* ComputedStyleUtils::ValuesForFontVariantProperty(
const ComputedStyle& style,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) {
enum VariantShorthandCases {
kAllNormal,
kNoneLigatures,
kConcatenateNonNormal
};
StylePropertyShorthand shorthand = fontVariantShorthand();
VariantShorthandCases shorthand_case = kAllNormal;
for (size_t i = 0; i < shorthand.length(); ++i) {
const CSSValue* value =
shorthand.properties()[i]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
if (shorthand_case == kAllNormal && value->IsIdentifierValue() &&
ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone &&
shorthand.properties()[i]->IDEquals(CSSPropertyFontVariantLigatures)) {
shorthand_case = kNoneLigatures;
} else if (!(value->IsIdentifierValue() &&
ToCSSIdentifierValue(value)->GetValueID() == CSSValueNormal)) {
shorthand_case = kConcatenateNonNormal;
break;
}
}
switch (shorthand_case) {
case kAllNormal:
return CSSIdentifierValue::Create(CSSValueNormal);
case kNoneLigatures:
return CSSIdentifierValue::Create(CSSValueNone);
case kConcatenateNonNormal: {
CSSValueList* list = CSSValueList::CreateSpaceSeparated();
for (size_t i = 0; i < shorthand.length(); ++i) {
const CSSValue* value =
shorthand.properties()[i]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
DCHECK(value);
if (value->IsIdentifierValue() &&
ToCSSIdentifierValue(value)->GetValueID() == CSSValueNone) {
list->Append(*ExpandNoneLigaturesValue());
} else if (!(value->IsIdentifierValue() &&
ToCSSIdentifierValue(value)->GetValueID() ==
CSSValueNormal)) {
list->Append(*value);
}
}
return list;
}
default:
NOTREACHED();
return nullptr;
}
}
} // namespace blink } // namespace blink
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "core/css/CSSBorderImageSliceValue.h" #include "core/css/CSSBorderImageSliceValue.h"
#include "core/css/CSSIdentifierValue.h" #include "core/css/CSSIdentifierValue.h"
#include "core/css/CSSValueList.h" #include "core/css/CSSValueList.h"
#include "core/css/CSSValuePair.h"
#include "core/css/ZoomAdjustedPixelValue.h" #include "core/css/ZoomAdjustedPixelValue.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
#include "core/style/ComputedStyleConstants.h" #include "core/style/ComputedStyleConstants.h"
...@@ -169,6 +170,31 @@ class ComputedStyleUtils { ...@@ -169,6 +170,31 @@ class ComputedStyleUtils {
static CSSValue* ValueForPageBreakInside(EBreakInside); static CSSValue* ValueForPageBreakInside(EBreakInside);
static CSSValue* ValueForWebkitColumnBreakInside(EBreakInside); static CSSValue* ValueForWebkitColumnBreakInside(EBreakInside);
static bool WidthOrHeightShouldReturnUsedValue(const LayoutObject*); static bool WidthOrHeightShouldReturnUsedValue(const LayoutObject*);
static CSSValueList* ValuesForShorthandProperty(const StylePropertyShorthand&,
const ComputedStyle&,
const LayoutObject*,
Node*,
bool allow_visited_style);
static CSSValueList* ValuesForGridShorthand(const StylePropertyShorthand&,
const ComputedStyle&,
const LayoutObject*,
Node*,
bool allow_visited_style);
static CSSValueList* ValuesForSidesShorthand(const StylePropertyShorthand&,
const ComputedStyle&,
const LayoutObject*,
Node*,
bool allow_visited_style);
static CSSValuePair* ValuesForInlineBlockShorthand(
const StylePropertyShorthand&,
const ComputedStyle&,
const LayoutObject*,
Node*,
bool allow_visited_style);
static CSSValue* ValuesForFontVariantProperty(const ComputedStyle&,
const LayoutObject*,
Node*,
bool allow_visited_style);
}; };
} // namespace blink } // namespace blink
......
...@@ -13,7 +13,7 @@ namespace CSSLonghand { ...@@ -13,7 +13,7 @@ namespace CSSLonghand {
const CSSValue* TextDecorationStyle::CSSValueFromComputedStyleInternal( const CSSValue* TextDecorationStyle::CSSValueFromComputedStyleInternal(
const ComputedStyle& style, const ComputedStyle& style,
const SVGComputedStyle&, const SVGComputedStyle&,
const LayoutObject*, const LayoutObject* layout_object,
Node* styled_node, Node* styled_node,
bool allow_visited_style) const { bool allow_visited_style) const {
return ComputedStyleUtils::ValueForTextDecorationStyle( return ComputedStyleUtils::ValueForTextDecorationStyle(
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderBottom::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderBottom::ParseShorthand(
borderBottomShorthand(), important, context, range, properties); borderBottomShorthand(), important, context, range, properties);
} }
const CSSValue* BorderBottom::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
borderBottomShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderColor::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderColor::ParseShorthand(
borderColorShorthand(), important, context, range, properties); borderColorShorthand(), important, context, range, properties);
} }
const CSSValue* BorderColor::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(
borderColorShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "core/css/CSSInitialValue.h" #include "core/css/CSSInitialValue.h"
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
...@@ -69,5 +70,26 @@ bool Border::ParseShorthand( ...@@ -69,5 +70,26 @@ bool Border::ParseShorthand(
return range.AtEnd(); return range.AtEnd();
} }
const CSSValue* Border::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
const CSSValue* value = GetCSSPropertyBorderTop().CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
static const CSSProperty* kProperties[3] = {&GetCSSPropertyBorderRight(),
&GetCSSPropertyBorderBottom(),
&GetCSSPropertyBorderLeft()};
for (size_t i = 0; i < WTF_ARRAY_LENGTH(kProperties); ++i) {
const CSSValue* value_for_side = kProperties[i]->CSSValueFromComputedStyle(
style, layout_object, styled_node, allow_visited_style);
if (!DataEquivalent(value, value_for_side)) {
return nullptr;
}
}
return value;
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderLeft::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderLeft::ParseShorthand(
borderLeftShorthand(), important, context, range, properties); borderLeftShorthand(), important, context, range, properties);
} }
const CSSValue* BorderLeft::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
borderLeftShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderRight::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderRight::ParseShorthand(
borderRightShorthand(), important, context, range, properties); borderRightShorthand(), important, context, range, properties);
} }
const CSSValue* BorderRight::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
borderRightShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderStyle::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderStyle::ParseShorthand(
borderStyleShorthand(), important, context, range, properties); borderStyleShorthand(), important, context, range, properties);
} }
const CSSValue* BorderStyle::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(
borderStyleShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderTop::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderTop::ParseShorthand(
borderTopShorthand(), important, context, range, properties); borderTopShorthand(), important, context, range, properties);
} }
const CSSValue* BorderTop::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
borderTopShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool BorderWidth::ParseShorthand( ...@@ -20,5 +22,16 @@ bool BorderWidth::ParseShorthand(
borderWidthShorthand(), important, context, range, properties); borderWidthShorthand(), important, context, range, properties);
} }
const CSSValue* BorderWidth::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(
borderWidthShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ColumnRule::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ColumnRule::ParseShorthand(
columnRuleShorthand(), important, context, range, properties); columnRuleShorthand(), important, context, range, properties);
} }
const CSSValue* ColumnRule::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
columnRuleShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
#include "core/css/properties/shorthands/Columns.h" #include "core/css/properties/shorthands/Columns.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSIdentifierValue.h" #include "core/css/CSSIdentifierValue.h"
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -39,5 +42,16 @@ bool Columns::ParseShorthand( ...@@ -39,5 +42,16 @@ bool Columns::ParseShorthand(
return true; return true;
} }
const CSSValue* Columns::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
columnsShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
#include "core/css/properties/shorthands/Flex.h" #include "core/css/properties/shorthands/Flex.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/CSSIdentifierValue.h" #include "core/css/CSSIdentifierValue.h"
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSParserLocalContext.h" #include "core/css/parser/CSSParserLocalContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -92,5 +95,15 @@ bool Flex::ParseShorthand(bool important, ...@@ -92,5 +95,15 @@ bool Flex::ParseShorthand(bool important,
return true; return true;
} }
const CSSValue* Flex::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
flexShorthand(), style, layout_object, styled_node, allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool FlexFlow::ParseShorthand( ...@@ -20,5 +22,16 @@ bool FlexFlow::ParseShorthand(
flexFlowShorthand(), important, context, range, properties); flexFlowShorthand(), important, context, range, properties);
} }
const CSSValue* FlexFlow::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
flexFlowShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#include "core/css/parser/FontVariantEastAsianParser.h" #include "core/css/parser/FontVariantEastAsianParser.h"
#include "core/css/parser/FontVariantLigaturesParser.h" #include "core/css/parser/FontVariantLigaturesParser.h"
#include "core/css/parser/FontVariantNumericParser.h" #include "core/css/parser/FontVariantNumericParser.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -105,5 +107,15 @@ bool FontVariant::ParseShorthand( ...@@ -105,5 +107,15 @@ bool FontVariant::ParseShorthand(
return true; return true;
} }
const CSSValue* FontVariant::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForFontVariantProperty(
style, layout_object, styled_node, allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -75,5 +77,16 @@ bool GridArea::ParseShorthand( ...@@ -75,5 +77,16 @@ bool GridArea::ParseShorthand(
return true; return true;
} }
const CSSValue* GridArea::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForGridShorthand(gridAreaShorthand(), style,
layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -41,5 +43,16 @@ bool GridColumn::ParseShorthand( ...@@ -41,5 +43,16 @@ bool GridColumn::ParseShorthand(
return true; return true;
} }
const CSSValue* GridColumn::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForGridShorthand(
gridColumnShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace { namespace {
...@@ -178,5 +180,15 @@ bool Grid::IsLayoutDependent(const ComputedStyle* style, ...@@ -178,5 +180,15 @@ bool Grid::IsLayoutDependent(const ComputedStyle* style,
return layout_object && layout_object->IsLayoutGrid(); return layout_object && layout_object->IsLayoutGrid();
} }
const CSSValue* Grid::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForGridShorthand(
gridShorthand(), style, layout_object, styled_node, allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -35,5 +37,16 @@ bool GridGap::ParseShorthand( ...@@ -35,5 +37,16 @@ bool GridGap::ParseShorthand(
return true; return true;
} }
const CSSValue* GridGap::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
gridGapShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -41,5 +43,16 @@ bool GridRow::ParseShorthand( ...@@ -41,5 +43,16 @@ bool GridRow::ParseShorthand(
return true; return true;
} }
const CSSValue* GridRow::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForGridShorthand(gridRowShorthand(), style,
layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -4,10 +4,13 @@ ...@@ -4,10 +4,13 @@
#include "core/css/properties/shorthands/GridTemplate.h" #include "core/css/properties/shorthands/GridTemplate.h"
#include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSParserContext.h" #include "core/css/parser/CSSParserContext.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -51,5 +54,16 @@ bool GridTemplate::IsLayoutDependent(const ComputedStyle* style, ...@@ -51,5 +54,16 @@ bool GridTemplate::IsLayoutDependent(const ComputedStyle* style,
return layout_object && layout_object->IsLayoutGrid(); return layout_object && layout_object->IsLayoutGrid();
} }
const CSSValue* GridTemplate::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForGridShorthand(
gridTemplateShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ListStyle::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ListStyle::ParseShorthand(
listStyleShorthand(), important, context, range, properties); listStyleShorthand(), important, context, range, properties);
} }
const CSSValue* ListStyle::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
listStyleShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
...@@ -30,5 +31,16 @@ bool Margin::IsLayoutDependent(const ComputedStyle* style, ...@@ -30,5 +31,16 @@ bool Margin::IsLayoutDependent(const ComputedStyle* style,
!style->MarginRight().IsFixed()); !style->MarginRight().IsFixed());
} }
const CSSValue* Margin::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(marginShorthand(), style,
layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool Outline::ParseShorthand( ...@@ -20,5 +22,16 @@ bool Outline::ParseShorthand(
outlineShorthand(), important, context, range, properties); outlineShorthand(), important, context, range, properties);
} }
const CSSValue* Outline::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
outlineShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/layout/LayoutObject.h" #include "core/layout/LayoutObject.h"
#include "core/style/ComputedStyle.h" #include "core/style/ComputedStyle.h"
...@@ -30,5 +31,16 @@ bool Padding::IsLayoutDependent(const ComputedStyle* style, ...@@ -30,5 +31,16 @@ bool Padding::IsLayoutDependent(const ComputedStyle* style,
!style->PaddingRight().IsFixed()); !style->PaddingRight().IsFixed());
} }
const CSSValue* Padding::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(paddingShorthand(), style,
layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -42,5 +44,18 @@ bool PlaceContent::ParseShorthand( ...@@ -42,5 +44,18 @@ bool PlaceContent::ParseShorthand(
return true; return true;
} }
const CSSValue* PlaceContent::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
// TODO (jfernandez): The spec states that we should return the specified
// value.
return ComputedStyleUtils::ValuesForShorthandProperty(
placeContentShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -45,5 +47,18 @@ bool PlaceItems::ParseShorthand( ...@@ -45,5 +47,18 @@ bool PlaceItems::ParseShorthand(
return true; return true;
} }
const CSSValue* PlaceItems::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
// TODO (jfernandez): The spec states that we should return the specified
// value.
return ComputedStyleUtils::ValuesForShorthandProperty(
placeItemsShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/CSSParsingUtils.h" #include "core/css/properties/CSSParsingUtils.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -41,5 +43,18 @@ bool PlaceSelf::ParseShorthand( ...@@ -41,5 +43,18 @@ bool PlaceSelf::ParseShorthand(
return true; return true;
} }
const CSSValue* PlaceSelf::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
// TODO (jfernandez): The spec states that we should return the specified
// value.
return ComputedStyleUtils::ValuesForShorthandProperty(
placeSelfShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollMarginBlock::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollMarginBlock::ParseShorthand(
scrollMarginBlockShorthand(), important, context, range, properties); scrollMarginBlockShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollMarginBlock::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForInlineBlockShorthand(
scrollMarginBlockShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollMargin::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollMargin::ParseShorthand(
scrollMarginShorthand(), important, context, range, properties); scrollMarginShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollMargin::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(
scrollMarginShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollMarginInline::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollMarginInline::ParseShorthand(
scrollMarginInlineShorthand(), important, context, range, properties); scrollMarginInlineShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollMarginInline::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForInlineBlockShorthand(
scrollMarginInlineShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollPaddingBlock::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollPaddingBlock::ParseShorthand(
scrollPaddingBlockShorthand(), important, context, range, properties); scrollPaddingBlockShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollPaddingBlock::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForInlineBlockShorthand(
scrollPaddingBlockShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollPadding::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollPadding::ParseShorthand(
scrollPaddingShorthand(), important, context, range, properties); scrollPaddingShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollPadding::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForSidesShorthand(
scrollPaddingShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool ScrollPaddingInline::ParseShorthand( ...@@ -20,5 +22,16 @@ bool ScrollPaddingInline::ParseShorthand(
scrollPaddingInlineShorthand(), important, context, range, properties); scrollPaddingInlineShorthand(), important, context, range, properties);
} }
const CSSValue* ScrollPaddingInline::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForInlineBlockShorthand(
scrollPaddingInlineShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
#include "core/StylePropertyShorthand.h" #include "core/StylePropertyShorthand.h"
#include "core/css/parser/CSSPropertyParserHelpers.h" #include "core/css/parser/CSSPropertyParserHelpers.h"
#include "core/css/properties/ComputedStyleUtils.h"
#include "core/style/ComputedStyle.h"
namespace blink { namespace blink {
namespace CSSShorthand { namespace CSSShorthand {
...@@ -20,5 +22,16 @@ bool TextDecoration::ParseShorthand( ...@@ -20,5 +22,16 @@ bool TextDecoration::ParseShorthand(
textDecorationShorthand(), important, context, range, properties); textDecorationShorthand(), important, context, range, properties);
} }
const CSSValue* TextDecoration::CSSValueFromComputedStyleInternal(
const ComputedStyle& style,
const SVGComputedStyle&,
const LayoutObject* layout_object,
Node* styled_node,
bool allow_visited_style) const {
return ComputedStyleUtils::ValuesForShorthandProperty(
textDecorationShorthand(), style, layout_object, styled_node,
allow_visited_style);
}
} // namespace CSSShorthand } // namespace CSSShorthand
} // namespace blink } // namespace blink
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment