Changeset 275199 in webkit


Ignore:
Timestamp:
Mar 30, 2021 12:40:46 AM (16 months ago)
Author:
graouts@webkit.org
Message:

Enable "hanging" and "each-line" keywords for the text-indent CSS property
https://bugs.webkit.org/show_bug.cgi?id=223851

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Mark all tests in the parsing-related tests as PASS results for text-indent.
The animation tests will be dealt with in bug 223914.

  • web-platform-tests/css/css-text/animations/text-indent-composition-expected.txt:
  • web-platform-tests/css/css-text/animations/text-indent-interpolation-expected.txt:
  • web-platform-tests/css/css-text/parsing/text-indent-computed-expected.txt:
  • web-platform-tests/css/css-text/parsing/text-indent-valid-expected.txt:

Source/WebCore:

We've had support for "hanging" and "each-line" behind the ENABLE_CSS3_TEXT flag. Probably by mistake,
"hanging" itself was parsed and Web-exposed by default. Presumably that was the case because that CSS
keyword existed in the context of SVG.

But LineWidth.cpp already knew how to handle these keywords, so there seems to be no reason to keep
these behind a flag.

So we remove all the ENABLE_CSS3_TEXT guards related to they keywords and address some spec compliance
issue, namely:

  1. add the text-indent length or percentage, the "hanging" and "each-line" keywords in that order in consumeTextIndent(),
  2. use that same order for the computed style.
  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::valueForPropertyInStyle):

  • css/CSSValueKeywords.in:
  • css/parser/CSSPropertyParser.cpp:

(WebCore::consumeTextIndent):

  • layout/inlineformatting/InlineLineBuilder.cpp:

(WebCore::Layout::LineBuilder::initialConstraintsForLine const):

  • rendering/line/LineWidth.cpp:

(WebCore::requiresIndent):

  • rendering/style/RenderStyle.cpp:

(WebCore::rareInheritedDataChangeRequiresLayout):

  • rendering/style/RenderStyle.h:
  • rendering/style/RenderStyleConstants.h:
  • rendering/style/StyleRareInheritedData.cpp:

(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):

  • rendering/style/StyleRareInheritedData.h:
  • style/StyleBuilderCustom.h:

(WebCore::Style::BuilderCustom::applyInheritTextIndent):
(WebCore::Style::BuilderCustom::applyInitialTextIndent):
(WebCore::Style::BuilderCustom::applyValueTextIndent):

Location:
trunk
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r275160 r275199  
     12021-03-29  Antoine Quint  <graouts@webkit.org>
     2
     3        Enable "hanging" and "each-line" keywords for the text-indent CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=223851
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Mark all tests in the parsing-related tests as PASS results for text-indent.
     9        The animation tests will be dealt with in bug 223914.
     10
     11        * web-platform-tests/css/css-text/animations/text-indent-composition-expected.txt:
     12        * web-platform-tests/css/css-text/animations/text-indent-interpolation-expected.txt:
     13        * web-platform-tests/css/css-text/parsing/text-indent-computed-expected.txt:
     14        * web-platform-tests/css/css-text/parsing/text-indent-valid-expected.txt:
     15
    1162021-03-28  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/animations/text-indent-composition-expected.txt

    r267650 r275199  
    1919FAIL Compositing: property <text-indent> underlying [50%] from replace [-100%] to add [50%] at (1) should be [100%] assert_equals: expected "100 % " but got "50 % "
    2020FAIL Compositing: property <text-indent> underlying [50%] from replace [-100%] to add [50%] at (1.5) should be [200%] assert_equals: expected "200 % " but got "125 % "
    21 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (-0.3) should be [20px hanging each-line] assert_true: 'from' value should be supported expected true got false
    22 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0) should be [50px hanging each-line] assert_true: 'from' value should be supported expected true got false
    23 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0.3) should be [80px hanging each-line] assert_true: 'from' value should be supported expected true got false
    24 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0.6) should be [110px hanging each-line] assert_true: 'from' value should be supported expected true got false
    25 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (1) should be [150px hanging each-line] assert_true: 'from' value should be supported expected true got false
    26 FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (1.5) should be [200px hanging each-line] assert_true: 'from' value should be supported expected true got false
    27 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (-0.3) should be [300px each-line] assert_true: 'from' value should be supported expected true got false
    28 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0) should be [300px each-line] assert_true: 'from' value should be supported expected true got false
    29 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0.3) should be [300px each-line] assert_true: 'from' value should be supported expected true got false
    30 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0.6) should be [150px hanging] assert_true: 'from' value should be supported expected true got false
    31 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (1) should be [150px hanging] assert_true: 'from' value should be supported expected true got false
    32 FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (1.5) should be [150px hanging] assert_true: 'from' value should be supported expected true got false
     21FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (-0.3) should be [20px hanging each-line] assert_equals: expected "20px hanging each - line " but got "20px "
     22FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0) should be [50px hanging each-line] assert_equals: expected "50px hanging each - line " but got "50px "
     23FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0.3) should be [80px hanging each-line] assert_equals: expected "80px hanging each - line " but got "80px "
     24FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (0.6) should be [110px hanging each-line] assert_equals: expected "110px hanging each - line " but got "110px "
     25FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (1) should be [150px hanging each-line] assert_equals: expected "150px hanging each - line " but got "150px "
     26FAIL Compositing: property <text-indent> underlying [250px] from add [50px each-line hanging] to replace [150px hanging each-line] at (1.5) should be [200px hanging each-line] assert_equals: expected "200px hanging each - line " but got "200px "
     27FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (-0.3) should be [300px each-line] assert_equals: expected "300px each - line " but got "20px each - line "
     28FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0) should be [300px each-line] assert_equals: expected "300px each - line " but got "50px each - line "
     29FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0.3) should be [300px each-line] assert_equals: expected "300px each - line " but got "80px each - line "
     30FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (0.6) should be [150px hanging] assert_equals: expected "150px hanging " but got "110px each - line "
     31FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (1) should be [150px hanging] assert_equals: expected "150px hanging " but got "150px each - line "
     32FAIL Compositing: property <text-indent> underlying [250px each-line] from add [50px each-line] to replace [150px hanging] at (1.5) should be [150px hanging] assert_equals: expected "150px hanging " but got "200px each - line "
    3333
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/animations/text-indent-interpolation-expected.txt

    r272904 r275199  
    132132PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging] to [50px hanging] at (1) should be [50px hanging]
    133133PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging] to [50px hanging] at (1.5) should be [75px hanging]
    134 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (-0.3) should be [-15px hanging]
    135 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0) should be [0 hanging]
    136 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.3) should be [15px hanging]
    137 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.6) should be [30px hanging]
    138 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1) should be [50px hanging]
    139 PASS CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1.5) should be [75px hanging]
    140 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (-0.3) should be [-15px hanging]
    141 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0) should be [0 hanging]
    142 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.3) should be [15px hanging]
    143 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.6) should be [30px hanging]
    144 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1) should be [50px hanging]
    145 PASS Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1.5) should be [75px hanging]
    146 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    147 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_true: 'from' value should be supported expected true got false
    148 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    149 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_true: 'from' value should be supported expected true got false
    150 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_true: 'from' value should be supported expected true got false
    151 FAIL CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_true: 'from' value should be supported expected true got false
    152 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    153 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_true: 'from' value should be supported expected true got false
    154 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    155 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_true: 'from' value should be supported expected true got false
    156 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_true: 'from' value should be supported expected true got false
    157 FAIL CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_true: 'from' value should be supported expected true got false
    158 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    159 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_true: 'from' value should be supported expected true got false
    160 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    161 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_true: 'from' value should be supported expected true got false
    162 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_true: 'from' value should be supported expected true got false
    163 FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_true: 'from' value should be supported expected true got false
    164 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    165 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_true: 'from' value should be supported expected true got false
    166 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_true: 'from' value should be supported expected true got false
    167 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_true: 'from' value should be supported expected true got false
    168 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_true: 'from' value should be supported expected true got false
    169 FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_true: 'from' value should be supported expected true got false
    170 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    171 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    172 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    173 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    174 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    175 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    176 FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    177 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    178 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    179 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    180 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    181 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    182 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    183 FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    184 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    185 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    186 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    187 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    188 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    189 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    190 FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    191 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    192 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    193 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [0px each-line] assert_true: 'from' value should be supported expected true got false
    194 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    195 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    196 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    197 FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_true: 'from' value should be supported expected true got false
    198 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    199 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    200 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    201 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    202 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    203 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    204 FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    205 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    206 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    207 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    208 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    209 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    210 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    211 FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    212 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [0px] assert_true: 'to' value should be supported expected true got false
    213 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [0px] assert_true: 'to' value should be supported expected true got false
    214 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [0px] assert_true: 'to' value should be supported expected true got false
    215 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    216 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    217 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    218 FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    219 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [0px] assert_true: 'to' value should be supported expected true got false
    220 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [0px] assert_true: 'to' value should be supported expected true got false
    221 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [0px] assert_true: 'to' value should be supported expected true got false
    222 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    223 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    224 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
    225 FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_true: 'to' value should be supported expected true got false
     134FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (-0.3) should be [-15px hanging] assert_equals: expected "- 15px hanging " but got "- 15px "
     135FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0) should be [0 hanging] assert_equals: expected "0px hanging " but got "0px "
     136FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.3) should be [15px hanging] assert_equals: expected "15px hanging " but got "15px "
     137FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.6) should be [30px hanging] assert_equals: expected "30px hanging " but got "30px "
     138FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1) should be [50px hanging] assert_equals: expected "50px hanging " but got "50px "
     139FAIL CSS Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1.5) should be [75px hanging] assert_equals: expected "75px hanging " but got "75px "
     140FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (-0.3) should be [-15px hanging] assert_equals: expected "- 15px hanging " but got "- 15px "
     141FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0) should be [0 hanging] assert_equals: expected "0px hanging " but got "0px "
     142FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.3) should be [15px hanging] assert_equals: expected "15px hanging " but got "15px "
     143FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (0.6) should be [30px hanging] assert_equals: expected "30px hanging " but got "30px "
     144FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1) should be [50px hanging] assert_equals: expected "50px hanging " but got "50px "
     145FAIL Web Animations: property <text-indent> from [0px hanging] to [50px hanging] at (1.5) should be [75px hanging] assert_equals: expected "75px hanging " but got "75px "
     146PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line]
     147PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line]
     148PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line]
     149PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line]
     150PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line]
     151PASS CSS Transitions: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line]
     152PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line]
     153PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line]
     154PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line]
     155PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line]
     156PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line]
     157PASS CSS Transitions with transition: all: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line]
     158FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_equals: expected "- 15px hanging each - line " but got "- 15px "
     159FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_equals: expected "0px hanging each - line " but got "0px "
     160FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_equals: expected "15px hanging each - line " but got "15px "
     161FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_equals: expected "30px hanging each - line " but got "30px "
     162FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_equals: expected "50px hanging each - line " but got "50px "
     163FAIL CSS Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_equals: expected "75px hanging each - line " but got "75px "
     164FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (-0.3) should be [-15px hanging each-line] assert_equals: expected "- 15px hanging each - line " but got "- 15px "
     165FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0) should be [0 hanging each-line] assert_equals: expected "0px hanging each - line " but got "0px "
     166FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.3) should be [15px hanging each-line] assert_equals: expected "15px hanging each - line " but got "15px "
     167FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (0.6) should be [30px hanging each-line] assert_equals: expected "30px hanging each - line " but got "30px "
     168FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1) should be [50px hanging each-line] assert_equals: expected "50px hanging each - line " but got "50px "
     169FAIL Web Animations: property <text-indent> from [0px hanging each-line] to [50px each-line hanging] at (1.5) should be [75px hanging each-line] assert_equals: expected "75px hanging each - line " but got "75px "
     170FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [50px hanging] assert_equals: expected "50px hanging " but got "- 15px hanging "
     171FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [50px hanging] assert_equals: expected "50px hanging " but got "0px hanging "
     172FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [50px hanging] assert_equals: expected "50px hanging " but got "15px hanging "
     173FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "25px hanging "
     174FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_equals: expected "50px hanging " but got "30px hanging "
     175PASS CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging]
     176FAIL CSS Transitions: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "75px hanging "
     177FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [50px hanging] assert_equals: expected "50px hanging " but got "- 15px hanging "
     178FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [50px hanging] assert_equals: expected "50px hanging " but got "0px hanging "
     179FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [50px hanging] assert_equals: expected "50px hanging " but got "15px hanging "
     180FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "25px hanging "
     181FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_equals: expected "50px hanging " but got "30px hanging "
     182PASS CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging]
     183FAIL CSS Transitions with transition: all: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "75px hanging "
     184FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [0px each-line] assert_equals: expected "0px each - line " but got "- 15px "
     185FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [0px each-line] assert_equals: expected "0px each - line " but got "0px "
     186FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [0px each-line] assert_equals: expected "0px each - line " but got "15px "
     187FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "25px "
     188FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_equals: expected "50px hanging " but got "30px "
     189FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_equals: expected "50px hanging " but got "50px "
     190FAIL CSS Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "75px "
     191FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (-0.3) should be [0px each-line] assert_equals: expected "0px each - line " but got "- 15px "
     192FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0) should be [0px each-line] assert_equals: expected "0px each - line " but got "0px "
     193FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.3) should be [0px each-line] assert_equals: expected "0px each - line " but got "15px "
     194FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "25px "
     195FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (0.6) should be [50px hanging] assert_equals: expected "50px hanging " but got "30px "
     196FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1) should be [50px hanging] assert_equals: expected "50px hanging " but got "50px "
     197FAIL Web Animations: property <text-indent> from [0px each-line] to [50px hanging] at (1.5) should be [50px hanging] assert_equals: expected "50px hanging " but got "75px "
     198FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "- 15px hanging each - line "
     199FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "0px hanging each - line "
     200FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "15px hanging each - line "
     201FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "25px hanging each - line "
     202FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "30px hanging each - line "
     203PASS CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging]
     204FAIL CSS Transitions: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "75px hanging each - line "
     205FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "- 15px hanging each - line "
     206FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "0px hanging each - line "
     207FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "15px hanging each - line "
     208FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "25px hanging each - line "
     209FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "30px hanging each - line "
     210PASS CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging]
     211FAIL CSS Transitions with transition: all: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "75px hanging each - line "
     212FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 15px "
     213PASS CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [0px]
     214FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [0px] assert_equals: expected "0px " but got "15px "
     215FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "25px "
     216FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "30px "
     217FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "50px "
     218FAIL CSS Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "75px "
     219FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (-0.3) should be [0px] assert_equals: expected "0px " but got "- 15px "
     220PASS Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0) should be [0px]
     221FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.3) should be [0px] assert_equals: expected "0px " but got "15px "
     222FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "25px "
     223FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (0.6) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "30px "
     224FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "50px "
     225FAIL Web Animations: property <text-indent> from [0px] to [50px each-line hanging] at (1.5) should be [50px each-line hanging] assert_equals: expected "50px hanging each - line " but got "75px "
    226226
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-indent-computed-expected.txt

    r267650 r275199  
    66PASS Property text-indent value '-40%'
    77PASS Property text-indent value 'calc(10px - 0.5em)'
    8 FAIL Property text-indent value '10px hanging' assert_equals: expected "10px hanging" but got "10px"
    9 FAIL Property text-indent value '20% each-line' assert_true: '20% each-line' is a supported value for text-indent. expected true got false
    10 FAIL Property text-indent value 'calc(50% + 60px) hanging each-line' assert_true: 'calc(50% + 60px) hanging each-line' is a supported value for text-indent. expected true got false
    11 FAIL Property text-indent value 'each-line hanging calc(10px + 0.5em)' assert_true: 'each-line hanging calc(10px + 0.5em)' is a supported value for text-indent. expected true got false
     8PASS Property text-indent value '10px hanging'
     9PASS Property text-indent value '20% each-line'
     10PASS Property text-indent value 'calc(50% + 60px) hanging each-line'
     11PASS Property text-indent value 'each-line hanging calc(10px + 0.5em)'
    1212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-text/parsing/text-indent-valid-expected.txt

    r267650 r275199  
    77PASS e.style['text-indent'] = "-40%" should set the property value
    88PASS e.style['text-indent'] = "10px hanging" should set the property value
    9 FAIL e.style['text-indent'] = "20% each-line" should set the property value assert_not_equals: property should be set got disallowed value ""
    10 FAIL e.style['text-indent'] = "calc(2em + 3ex) hanging each-line" should set the property value assert_not_equals: property should be set got disallowed value ""
    11 FAIL e.style['text-indent'] = "hanging calc(50% + 60px)" should set the property value assert_equals: serialization should be canonical expected "calc(50% + 60px) hanging" but got "hanging calc(50% + 60px)"
    12 FAIL e.style['text-indent'] = "each-line 10px" should set the property value assert_not_equals: property should be set got disallowed value ""
    13 FAIL e.style['text-indent'] = "hanging 20% each-line" should set the property value assert_not_equals: property should be set got disallowed value ""
    14 FAIL e.style['text-indent'] = "each-line hanging calc(2em + 3ex)" should set the property value assert_not_equals: property should be set got disallowed value ""
    15 FAIL e.style['text-indent'] = "calc(50% + 60px) each-line hanging" should set the property value assert_not_equals: property should be set got disallowed value ""
     9PASS e.style['text-indent'] = "20% each-line" should set the property value
     10PASS e.style['text-indent'] = "calc(2em + 3ex) hanging each-line" should set the property value
     11PASS e.style['text-indent'] = "hanging calc(50% + 60px)" should set the property value
     12PASS e.style['text-indent'] = "each-line 10px" should set the property value
     13PASS e.style['text-indent'] = "hanging 20% each-line" should set the property value
     14PASS e.style['text-indent'] = "each-line hanging calc(2em + 3ex)" should set the property value
     15PASS e.style['text-indent'] = "calc(50% + 60px) each-line hanging" should set the property value
    1616
  • trunk/Source/WebCore/ChangeLog

    r275193 r275199  
     12021-03-29  Antoine Quint  <graouts@webkit.org>
     2
     3        Enable "hanging" and "each-line" keywords for the text-indent CSS property
     4        https://bugs.webkit.org/show_bug.cgi?id=223851
     5
     6        Reviewed by Antti Koivisto.
     7
     8        We've had support for "hanging" and "each-line" behind the ENABLE_CSS3_TEXT flag. Probably by mistake,
     9        "hanging" itself was parsed and Web-exposed by default. Presumably that was the case because that CSS
     10        keyword existed in the context of SVG.
     11
     12        But LineWidth.cpp already knew how to handle these keywords, so there seems to be no reason to keep
     13        these behind a flag.
     14
     15        So we remove all the ENABLE_CSS3_TEXT guards related to they keywords and address some spec compliance
     16        issue, namely:
     17       
     18            1. add the text-indent length or percentage, the "hanging" and "each-line" keywords in that order
     19               in consumeTextIndent(),
     20            2. use that same order for the computed style.
     21
     22        * css/CSSComputedStyleDeclaration.cpp:
     23        (WebCore::ComputedStyleExtractor::valueForPropertyInStyle):
     24        * css/CSSValueKeywords.in:
     25        * css/parser/CSSPropertyParser.cpp:
     26        (WebCore::consumeTextIndent):
     27        * layout/inlineformatting/InlineLineBuilder.cpp:
     28        (WebCore::Layout::LineBuilder::initialConstraintsForLine const):
     29        * rendering/line/LineWidth.cpp:
     30        (WebCore::requiresIndent):
     31        * rendering/style/RenderStyle.cpp:
     32        (WebCore::rareInheritedDataChangeRequiresLayout):
     33        * rendering/style/RenderStyle.h:
     34        * rendering/style/RenderStyleConstants.h:
     35        * rendering/style/StyleRareInheritedData.cpp:
     36        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
     37        (WebCore::StyleRareInheritedData::operator== const):
     38        * rendering/style/StyleRareInheritedData.h:
     39        * style/StyleBuilderCustom.h:
     40        (WebCore::Style::BuilderCustom::applyInheritTextIndent):
     41        (WebCore::Style::BuilderCustom::applyInitialTextIndent):
     42        (WebCore::Style::BuilderCustom::applyValueTextIndent):
     43
    1442021-03-29  David Kilzer  <ddkilzer@apple.com>
    245
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r275160 r275199  
    32353235            RELEASE_ASSERT_NOT_REACHED();
    32363236        case CSSPropertyTextIndent: {
    3237             // If CSS3_TEXT is disabled or text-indent has only one value(<length> | <percentage>),
    3238             // getPropertyCSSValue() returns CSSValue.
    32393237            auto textIndent = zoomAdjustedPixelValueForLength(style.textIndent(), style);
    3240 #if ENABLE(CSS3_TEXT)
    3241             // If CSS3_TEXT is enabled and text-indent has -webkit-each-line or -webkit-hanging,
    3242             // getPropertyCSSValue() returns CSSValueList.
    32433238            if (style.textIndentLine() == TextIndentLine::EachLine || style.textIndentType() == TextIndentType::Hanging) {
    32443239                auto list = CSSValueList::createSpaceSeparated();
    32453240                list->append(WTFMove(textIndent));
     3241                if (style.textIndentType() == TextIndentType::Hanging)
     3242                    list->append(cssValuePool.createIdentifierValue(CSSValueHanging));
    32463243                if (style.textIndentLine() == TextIndentLine::EachLine)
    32473244                    list->append(cssValuePool.createIdentifierValue(CSSValueEachLine));
    3248                 if (style.textIndentType() == TextIndentType::Hanging)
    3249                     list->append(cssValuePool.createIdentifierValue(CSSValueHanging));
    32503245                return list;
    32513246            }
    3252 #endif
    32533247            return textIndent;
    32543248        }
  • trunk/Source/WebCore/css/CSSValueKeywords.in

    r275141 r275199  
    13571357dense
    13581358
    1359 #if defined(ENABLE_CSS3_TEXT) && ENABLE_CSS3_TEXT
    13601359// text-indent
    13611360each-line
    13621361// hanging
    1363 #endif
    13641362
    13651363// -webkit-column-fill
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r275141 r275199  
    11711171{
    11721172    // [ <length> | <percentage> ] && hanging? && each-line?
    1173     // Keywords only allowed when css3Text is enabled.
    1174     RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
    1175 
    1176     bool hasLengthOrPercentage = false;
    1177 #if ENABLE(CSS3_TEXT)
    1178     bool hasEachLine = false;
    1179 #endif
    1180     bool hasHanging = false;
     1173    RefPtr<CSSValue> lengthOrPercentage;
     1174    RefPtr<CSSPrimitiveValue> eachLine;
     1175    RefPtr<CSSPrimitiveValue> hanging;
    11811176
    11821177    do {
    1183         if (!hasLengthOrPercentage) {
     1178        if (!lengthOrPercentage) {
    11841179            if (RefPtr<CSSValue> textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) {
    1185                 list->append(*textIndent);
    1186                 hasLengthOrPercentage = true;
     1180                lengthOrPercentage = textIndent;
    11871181                continue;
    11881182            }
     
    11901184
    11911185        CSSValueID id = range.peek().id();
    1192 #if ENABLE(CSS3_TEXT)
    1193         if (!hasEachLine && id == CSSValueEachLine) {
    1194             list->append(consumeIdent(range).releaseNonNull());
    1195             hasEachLine = true;
     1186        if (!eachLine && id == CSSValueEachLine) {
     1187            eachLine = consumeIdent(range);
    11961188            continue;
    11971189        }
    1198 #endif
    1199 
    1200         if (!hasHanging && id == CSSValueHanging) {
    1201             list->append(consumeIdent(range).releaseNonNull());
    1202             hasHanging = true;
     1190
     1191        if (!hanging && id == CSSValueHanging) {
     1192            hanging = consumeIdent(range);
    12031193            continue;
    12041194        }
     
    12071197    } while (!range.atEnd());
    12081198
    1209     if (!hasLengthOrPercentage)
    1210         return nullptr;
     1199    if (!lengthOrPercentage)
     1200        return nullptr;
     1201
     1202    RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
     1203    list->append(*lengthOrPercentage);
     1204    if (hanging)
     1205        list->append(hanging.releaseNonNull());
     1206    if (eachLine)
     1207        list->append(eachLine.releaseNonNull());
    12111208
    12121209    return list;
  • trunk/Source/WebCore/layout/inlineformatting/InlineLineBuilder.cpp

    r274048 r275199  
    439439        if (!isFormattingContextRootCandidateToTextIndent)
    440440            return { };
    441         auto invertLineRange = false;
    442 #if ENABLE(CSS3_TEXT)
    443         invertLineRange = root.style().textIndentType() == TextIndentType::Hanging;
    444 #endif
     441        auto invertLineRange = root.style().textIndentType() == TextIndentType::Hanging;
    445442        // text-indent: hanging inverts which lines are affected.
    446443        // inverted line range -> all the lines except the first one.
  • trunk/Source/WebCore/rendering/line/LineWidth.cpp

    r267923 r275199  
    240240    if (isFirstLine)
    241241        shouldIndentText = IndentText;
    242 #if ENABLE(CSS3_TEXT)
    243242    else if (isAfterHardLineBreak && style.textIndentLine() == TextIndentLine::EachLine)
    244243        shouldIndentText = IndentText;
     
    246245    if (style.textIndentType() == TextIndentType::Hanging)
    247246        shouldIndentText = shouldIndentText == IndentText ? DoNotIndentText : IndentText;
    248 #else
    249     UNUSED_PARAM(isAfterHardLineBreak);
    250     UNUSED_PARAM(style);
    251 #endif
    252247    return shouldIndentText;
    253248}
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r274440 r275199  
    750750        || first.textAlignLast != second.textAlignLast
    751751        || first.textJustify != second.textJustify
     752#endif
    752753        || first.textIndentLine != second.textIndentLine
    753 #endif
    754754        || first.effectiveZoom != second.effectiveZoom
    755755        || first.textZoom != second.textZoom
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r275141 r275199  
    375375    TextDecorationThickness textDecorationThickness() const { return m_rareInheritedData->textDecorationThickness; }
    376376
    377 #if ENABLE(CSS3_TEXT)
    378377    TextIndentLine textIndentLine() const { return static_cast<TextIndentLine>(m_rareInheritedData->textIndentLine); }
    379378    TextIndentType textIndentType() const { return static_cast<TextIndentType>(m_rareInheritedData->textIndentType); }
     379#if ENABLE(CSS3_TEXT)
    380380    TextAlignLast textAlignLast() const { return static_cast<TextAlignLast>(m_rareInheritedData->textAlignLast); }
    381381    TextJustify textJustify() const { return static_cast<TextJustify>(m_rareInheritedData->textJustify); }
     
    980980    void setTextZoom(TextZoom v) { SET_VAR(m_rareInheritedData, textZoom, static_cast<unsigned>(v)); }
    981981
    982 #if ENABLE(CSS3_TEXT)
    983982    void setTextIndentLine(TextIndentLine v) { SET_VAR(m_rareInheritedData, textIndentLine, static_cast<unsigned>(v)); }
    984983    void setTextIndentType(TextIndentType v) { SET_VAR(m_rareInheritedData, textIndentType, static_cast<unsigned>(v)); }
     984#if ENABLE(CSS3_TEXT)
    985985    void setTextAlignLast(TextAlignLast v) { SET_VAR(m_rareInheritedData, textAlignLast, static_cast<unsigned>(v)); }
    986986    void setTextJustify(TextJustify v) { SET_VAR(m_rareInheritedData, textJustify, static_cast<unsigned>(v)); }
     
    16891689#endif
    16901690
    1691 #if ENABLE(CSS3_TEXT)
    16921691    static TextIndentLine initialTextIndentLine() { return TextIndentLine::FirstLine; }
    16931692    static TextIndentType initialTextIndentType() { return TextIndentType::Normal; }
     1693#if ENABLE(CSS3_TEXT)
    16941694    static TextAlignLast initialTextAlignLast() { return TextAlignLast::Auto; }
    16951695    static TextJustify initialTextJustify() { return TextJustify::Auto; }
  • trunk/Source/WebCore/rendering/style/RenderStyleConstants.h

    r274957 r275199  
    10801080static const float maximumAllowedFontSize = 1000000.0f;
    10811081
    1082 #if ENABLE(CSS3_TEXT)
    1083 
    10841082enum class TextIndentLine : uint8_t {
    10851083    FirstLine,
     
    10911089    Hanging
    10921090};
    1093 
    1094 #endif
    10951091
    10961092enum class Isolation : uint8_t {
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.cpp

    r275141 r275199  
    102102    , textEmphasisPosition(static_cast<unsigned>(RenderStyle::initialTextEmphasisPosition().toRaw()))
    103103    , textOrientation(static_cast<unsigned>(TextOrientation::Mixed))
    104 #if ENABLE(CSS3_TEXT)
    105104    , textIndentLine(static_cast<unsigned>(RenderStyle::initialTextIndentLine()))
    106105    , textIndentType(static_cast<unsigned>(RenderStyle::initialTextIndentType()))
    107 #endif
    108106    , lineBoxContain(static_cast<unsigned>(RenderStyle::initialLineBoxContain().toRaw()))
    109107    , imageOrientation(RenderStyle::initialImageOrientation())
     
    200198    , textEmphasisPosition(o.textEmphasisPosition)
    201199    , textOrientation(o.textOrientation)
    202 #if ENABLE(CSS3_TEXT)
    203200    , textIndentLine(o.textIndentLine)
    204201    , textIndentType(o.textIndentType)
    205 #endif
    206202    , lineBoxContain(o.lineBoxContain)
    207203    , imageOrientation(o.imageOrientation)
     
    321317        && textEmphasisPosition == o.textEmphasisPosition
    322318        && textOrientation == o.textOrientation
    323 #if ENABLE(CSS3_TEXT)
    324319        && textIndentLine == o.textIndentLine
    325320        && textIndentType == o.textIndentType
    326 #endif
    327321        && lineBoxContain == o.lineBoxContain
    328322#if PLATFORM(IOS_FAMILY)
  • trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h

    r275092 r275199  
    121121    unsigned textEmphasisPosition : 4; // TextEmphasisPosition
    122122    unsigned textOrientation : 2; // TextOrientation
    123 #if ENABLE(CSS3_TEXT)
    124123    unsigned textIndentLine : 1; // TextIndentLine
    125124    unsigned textIndentType : 1; // TextIndentType
    126 #endif
    127125    unsigned lineBoxContain: 7; // OptionSet<LineBoxContain>
    128126    // CSS Image Values Level 3
  • trunk/Source/WebCore/style/StyleBuilderCustom.h

    r275160 r275199  
    467467{
    468468    builderState.style().setTextIndent(Length { builderState.parentStyle().textIndent() });
    469 #if ENABLE(CSS3_TEXT)
    470469    builderState.style().setTextIndentLine(builderState.parentStyle().textIndentLine());
    471470    builderState.style().setTextIndentType(builderState.parentStyle().textIndentType());
    472 #endif
    473471}
    474472
     
    476474{
    477475    builderState.style().setTextIndent(RenderStyle::initialTextIndent());
    478 #if ENABLE(CSS3_TEXT)
    479476    builderState.style().setTextIndentLine(RenderStyle::initialTextIndentLine());
    480477    builderState.style().setTextIndentType(RenderStyle::initialTextIndentType());
    481 #endif
    482478}
    483479
     
    485481{
    486482    Length lengthOrPercentageValue;
    487 #if ENABLE(CSS3_TEXT)
    488483    TextIndentLine textIndentLineValue = RenderStyle::initialTextIndentLine();
    489484    TextIndentType textIndentTypeValue = RenderStyle::initialTextIndentType();
    490 #endif
    491485    for (auto& item : downcast<CSSValueList>(value)) {
    492486        auto& primitiveValue = downcast<CSSPrimitiveValue>(item.get());
    493487        if (!primitiveValue.valueID())
    494488            lengthOrPercentageValue = primitiveValue.convertToLength<FixedIntegerConversion | PercentConversion | CalculatedConversion>(builderState.cssToLengthConversionData());
    495 #if ENABLE(CSS3_TEXT)
    496489        else if (primitiveValue.valueID() == CSSValueEachLine)
    497490            textIndentLineValue = TextIndentLine::EachLine;
    498491        else if (primitiveValue.valueID() == CSSValueHanging)
    499492            textIndentTypeValue = TextIndentType::Hanging;
    500 #endif
    501493    }
    502494
     
    505497
    506498    builderState.style().setTextIndent(WTFMove(lengthOrPercentageValue));
    507 #if ENABLE(CSS3_TEXT)
    508499    builderState.style().setTextIndentLine(textIndentLineValue);
    509500    builderState.style().setTextIndentType(textIndentTypeValue);
    510 #endif
    511501}
    512502
Note: See TracChangeset for help on using the changeset viewer.