Commit 4cb768e1 authored by Zhuoyu Qian's avatar Zhuoyu Qian Committed by Commit Bot

Change CSSContentDistributionValue functions return CSSValueIDs.

As the comment in CSSContentDistributionValue.h by sashab@,
makes Distribution/GetPosition/Overflow functions return CSSValueIDs
instead of CSSIdentifierValues.
Also rename GetPosition to Position.

BUG=
Signed-off-by: default avatarZhuoyu Qian <zhuoyu.qian@samsung.com>
Change-Id: I3d16dceddbc3132d095453d389113f2925b52f52
Reviewed-on: https://chromium-review.googlesource.com/828565Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Reviewed-by: default avatarSasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#525254}
parent 68032f0f
...@@ -24,7 +24,7 @@ String CSSContentDistributionValue::CustomCSSText() const { ...@@ -24,7 +24,7 @@ String CSSContentDistributionValue::CustomCSSText() const {
CSSValueList* list = CSSValueList::CreateSpaceSeparated(); CSSValueList* list = CSSValueList::CreateSpaceSeparated();
if (distribution_ != CSSValueInvalid) if (distribution_ != CSSValueInvalid)
list->Append(*Distribution()); list->Append(*CSSIdentifierValue::Create(distribution_));
if (position_ != CSSValueInvalid) { if (position_ != CSSValueInvalid) {
if (position_ == CSSValueFirstBaseline || if (position_ == CSSValueFirstBaseline ||
position_ == CSSValueLastBaseline) { position_ == CSSValueLastBaseline) {
...@@ -33,11 +33,11 @@ String CSSContentDistributionValue::CustomCSSText() const { ...@@ -33,11 +33,11 @@ String CSSContentDistributionValue::CustomCSSText() const {
list->Append(*CSSIdentifierValue::Create(preference)); list->Append(*CSSIdentifierValue::Create(preference));
list->Append(*CSSIdentifierValue::Create(CSSValueBaseline)); list->Append(*CSSIdentifierValue::Create(CSSValueBaseline));
} else { } else {
list->Append(*GetPosition()); list->Append(*CSSIdentifierValue::Create(position_));
} }
} }
if (overflow_ != CSSValueInvalid) if (overflow_ != CSSValueInvalid)
list->Append(*Overflow()); list->Append(*CSSIdentifierValue::Create(overflow_));
return list->CustomCSSText(); return list->CustomCSSText();
} }
......
...@@ -21,18 +21,11 @@ class CSSContentDistributionValue : public CSSValue { ...@@ -21,18 +21,11 @@ class CSSContentDistributionValue : public CSSValue {
} }
~CSSContentDistributionValue(); ~CSSContentDistributionValue();
// TODO(sashab): Make these return CSSValueIDs instead of CSSValues. CSSValueID Distribution() const { return distribution_; }
CSSIdentifierValue* Distribution() const {
return CSSIdentifierValue::Create(distribution_);
}
CSSIdentifierValue* GetPosition() const { CSSValueID Position() const { return position_; }
return CSSIdentifierValue::Create(position_);
}
CSSIdentifierValue* Overflow() const { CSSValueID Overflow() const { return overflow_; }
return CSSIdentifierValue::Create(overflow_);
}
String CustomCSSText() const; String CustomCSSText() const;
......
...@@ -714,15 +714,21 @@ StyleContentAlignmentData StyleBuilderConverter::ConvertContentAlignmentData( ...@@ -714,15 +714,21 @@ StyleContentAlignmentData StyleBuilderConverter::ConvertContentAlignmentData(
ComputedStyleInitialValues::InitialContentAlignment(); ComputedStyleInitialValues::InitialContentAlignment();
const CSSContentDistributionValue& content_value = const CSSContentDistributionValue& content_value =
ToCSSContentDistributionValue(value); ToCSSContentDistributionValue(value);
if (content_value.Distribution()->GetValueID() != CSSValueInvalid) if (content_value.Distribution() != CSSValueInvalid) {
alignment_data.SetDistribution( alignment_data.SetDistribution(
content_value.Distribution()->ConvertTo<ContentDistributionType>()); CSSIdentifierValue::Create(content_value.Distribution())
if (content_value.GetPosition()->GetValueID() != CSSValueInvalid) ->ConvertTo<ContentDistributionType>());
}
if (content_value.Position() != CSSValueInvalid) {
alignment_data.SetPosition( alignment_data.SetPosition(
content_value.GetPosition()->ConvertTo<ContentPosition>()); CSSIdentifierValue::Create(content_value.Position())
if (content_value.Overflow()->GetValueID() != CSSValueInvalid) ->ConvertTo<ContentPosition>());
}
if (content_value.Overflow() != CSSValueInvalid) {
alignment_data.SetOverflow( alignment_data.SetOverflow(
content_value.Overflow()->ConvertTo<OverflowAlignment>()); CSSIdentifierValue::Create(content_value.Overflow())
->ConvertTo<OverflowAlignment>());
}
return alignment_data; return alignment_data;
} }
......
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