Commit 8b4b629e authored by napper's avatar napper Committed by Commit bot

Moved text-align to be generated in ComputedStyleBase.

Move the inherited property text-align and its enum, ETextAlign,
to be generated in ComputedStyleBase. Also moved getter / setter /
initial value methods to be generated in ComputedStyleBase.

BUG=628043

Review-Url: https://codereview.chromium.org/2577973002
Cr-Commit-Position: refs/heads/master@{#438781}
parent 7bc63b99
...@@ -357,7 +357,7 @@ stroke-opacity interpolable, inherited, svg, converter=convertNumberOrPercentage ...@@ -357,7 +357,7 @@ stroke-opacity interpolable, inherited, svg, converter=convertNumberOrPercentage
stroke-width interpolable, inherited, svg, converter=convertUnzoomedLength stroke-width interpolable, inherited, svg, converter=convertUnzoomedLength
table-layout table-layout
tab-size inherited, converter=convertLengthOrTabSpaces, type_name=TabSize tab-size inherited, converter=convertLengthOrTabSpaces, type_name=TabSize
text-align inherited, custom_value text-align inherited, custom_value, keyword_only, keywords=[left|right|center|justify|webkitLeft|webkitRight|webkitCenter|start|end], initial_keyword=start
text-align-last inherited, type_name=TextAlignLast text-align-last inherited, type_name=TextAlignLast
text-anchor inherited, svg text-anchor inherited, svg
text-combine-upright inherited, type_name=TextCombine, name_for_methods=TextCombine text-combine-upright inherited, type_name=TextCombine, name_for_methods=TextCombine
......
...@@ -810,7 +810,7 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation( ...@@ -810,7 +810,7 @@ bool ComputedStyle::diffNeedsFullLayoutAndPaintInvalidation(
if (boxDirection() != other.boxDirection() || if (boxDirection() != other.boxDirection() ||
m_inheritedData.m_rtlOrdering != other.m_inheritedData.m_rtlOrdering || m_inheritedData.m_rtlOrdering != other.m_inheritedData.m_rtlOrdering ||
m_inheritedData.m_textAlign != other.m_inheritedData.m_textAlign || textAlign() != other.textAlign() ||
textTransform() != other.textTransform() || textTransform() != other.textTransform() ||
m_inheritedData.m_direction != other.m_inheritedData.m_direction || m_inheritedData.m_direction != other.m_inheritedData.m_direction ||
whiteSpace() != other.whiteSpace() || whiteSpace() != other.whiteSpace() ||
......
...@@ -199,7 +199,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase, ...@@ -199,7 +199,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
struct InheritedData { struct InheritedData {
bool operator==(const InheritedData& other) const { bool operator==(const InheritedData& other) const {
return (m_listStyleType == other.m_listStyleType) && return (m_listStyleType == other.m_listStyleType) &&
(m_textAlign == other.m_textAlign) &&
(m_hasSimpleUnderline == other.m_hasSimpleUnderline) && (m_hasSimpleUnderline == other.m_hasSimpleUnderline) &&
(m_cursorStyle == other.m_cursorStyle) && (m_cursorStyle == other.m_cursorStyle) &&
(m_direction == other.m_direction) && (m_direction == other.m_direction) &&
...@@ -213,7 +212,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase, ...@@ -213,7 +212,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
} }
unsigned m_listStyleType : 7; // EListStyleType unsigned m_listStyleType : 7; // EListStyleType
unsigned m_textAlign : 4; // ETextAlign
unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only unsigned m_hasSimpleUnderline : 1; // True if 'underline solid' is the only
// text decoration on this element. // text decoration on this element.
unsigned m_cursorStyle : 6; // ECursor unsigned m_cursorStyle : 6; // ECursor
...@@ -317,7 +315,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase, ...@@ -317,7 +315,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
ComputedStyleBase::setBitDefaults(); ComputedStyleBase::setBitDefaults();
m_inheritedData.m_listStyleType = m_inheritedData.m_listStyleType =
static_cast<unsigned>(initialListStyleType()); static_cast<unsigned>(initialListStyleType());
m_inheritedData.m_textAlign = static_cast<unsigned>(initialTextAlign());
m_inheritedData.m_hasSimpleUnderline = false; m_inheritedData.m_hasSimpleUnderline = false;
m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor()); m_inheritedData.m_cursorStyle = static_cast<unsigned>(initialCursor());
m_inheritedData.m_direction = initialDirection(); m_inheritedData.m_direction = initialDirection();
...@@ -2124,15 +2121,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase, ...@@ -2124,15 +2121,6 @@ class CORE_EXPORT ComputedStyle : public ComputedStyleBase,
SET_VAR(m_rareInheritedData, m_tabSize, size); SET_VAR(m_rareInheritedData, m_tabSize, size);
} }
// text-align
static ETextAlign initialTextAlign() { return ETextAlign::Start; }
ETextAlign textAlign() const {
return static_cast<ETextAlign>(m_inheritedData.m_textAlign);
}
void setTextAlign(ETextAlign v) {
m_inheritedData.m_textAlign = static_cast<unsigned>(v);
}
// text-align-last // text-align-last
static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; } static TextAlignLast initialTextAlignLast() { return TextAlignLastAuto; }
TextAlignLast getTextAlignLast() const { TextAlignLast getTextAlignLast() const {
......
...@@ -325,20 +325,6 @@ enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE }; ...@@ -325,20 +325,6 @@ enum QuoteType { OPEN_QUOTE, CLOSE_QUOTE, NO_OPEN_QUOTE, NO_CLOSE_QUOTE };
enum EAnimPlayState { AnimPlayStatePlaying, AnimPlayStatePaused }; enum EAnimPlayState { AnimPlayStatePlaying, AnimPlayStatePaused };
// The order of this enum must match the order of the text align values in
// CSSValueKeywords.in.
enum class ETextAlign : unsigned {
Left,
Right,
Center,
Justify,
WebkitLeft,
WebkitRight,
WebkitCenter,
Start,
End,
};
static const size_t TextDecorationBits = 4; static const size_t TextDecorationBits = 4;
enum TextDecoration { enum TextDecoration {
TextDecorationNone = 0x0, TextDecorationNone = 0x0,
......
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