Changeset 207757 in webkit


Ignore:
Timestamp:
Oct 24, 2016 7:39:40 AM (7 years ago)
Author:
hyatt@apple.com
Message:

[CSS Parser] Unprefix -webkit-writing-mode
https://bugs.webkit.org/show_bug.cgi?id=163870

Reviewed by Zalan Bujtas.

Source/WebCore:

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::propertyValue):
Change -webkit-writing mode to writing-mode.

  • css/CSSPrimitiveValueMappings.h:

(WebCore::CSSPrimitiveValue::operator WritingMode):
(WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
values to the WritingMode converters.

  • css/CSSPropertyNames.in:

Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
instead of to -webkit-writing-mode.

  • css/SVGCSSComputedStyleDeclaration.cpp:

(WebCore::ComputedStyleExtractor::svgPropertyValue):
Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.

  • css/StyleBuilderCustom.h:

(WebCore::StyleBuilderCustom::applyValueWritingMode):
(WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
the underlying converter for WritingMode now handles those values.

  • css/StyleResolver.cpp:

(WebCore::extractDirectionAndWritingMode):
Rename -webkit-writing-mode to writing-mode.

  • css/parser/CSSParser.cpp:

(WebCore::isValidKeywordPropertyAndValue):
Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
and the normal values.

  • css/parser/CSSParserFastPaths.cpp:

(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
Same deal here.

  • html/track/TextTrackCueGeneric.cpp:

(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):

  • html/track/VTTCue.cpp:

(WebCore::VTTCueBox::applyCSSProperties):
Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.

  • rendering/RenderLineBreak.cpp:

(WebCore::RenderLineBreak::collectSelectionRects):

  • rendering/RenderText.cpp:

(WebCore::RenderText::collectSelectionRects):
Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
the SVG-specific one.

  • rendering/style/RenderStyle.h:

(WebCore::RenderStyle::isVerticalWritingMode):
Add a helper function for asking if something is vertical writing mode.

  • rendering/style/SVGRenderStyle.cpp:
  • rendering/style/SVGRenderStyle.h:
  • rendering/style/SVGRenderStyleDefs.h:

(WebCore::SVGRenderStyle::diff):
Remove the SVG writing mode code.

  • rendering/svg/RenderSVGInlineText.cpp:

(WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
Make sure to force SVG font descriptions to be horizontal, since SVG controls
its own glyph orientation.

  • rendering/svg/SVGRenderTreeAsText.cpp:

(WebCore::writeSVGInlineTextBox):

  • rendering/svg/SVGTextChunk.cpp:

(WebCore::SVGTextChunk::SVGTextChunk):

  • rendering/svg/SVGTextLayoutEngine.cpp:

(WebCore::SVGTextLayoutEngine::layoutInlineTextBox):

  • rendering/svg/SVGTextQuery.cpp:

(WebCore::SVGTextQuery::executeQuery):
Changed to access the RenderStyle writing mode instead of the SVG-specific one.

LayoutTests:

  • fast/css/getComputedStyle/computed-style-expected.txt:
  • fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
  • platform/mac/svg/W3C-SVG-1.1/text-align-06-b-expected.txt:
  • platform/mac/svg/text/text-align-06-b-expected.txt:
  • svg/css/getComputedStyle-basic-expected.txt:
Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207756 r207757  
     12016-10-24  Dave Hyatt  <hyatt@apple.com>
     2
     3        [CSS Parser] Unprefix -webkit-writing-mode
     4        https://bugs.webkit.org/show_bug.cgi?id=163870
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * fast/css/getComputedStyle/computed-style-expected.txt:
     9        * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt:
     10        * platform/mac/svg/W3C-SVG-1.1/text-align-06-b-expected.txt:
     11        * platform/mac/svg/text/text-align-06-b-expected.txt:
     12        * svg/css/getComputedStyle-basic-expected.txt:
     13
    1142016-10-24  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt

    r205809 r207757  
    218218-webkit-user-modify: read-only;
    219219-webkit-user-select: text;
    220 -webkit-writing-mode: horizontal-tb;
    221220clip-path: none;
    222221clip-rule: nonzero;
     
    251250kerning: 0;
    252251text-anchor: start;
    253 writing-mode: lr-tb;
     252writing-mode: horizontal-tb;
    254253glyph-orientation-horizontal: 0deg;
    255254glyph-orientation-vertical: auto;
  • trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt

    r205809 r207757  
    217217-webkit-user-modify: read-only
    218218-webkit-user-select: text
    219 -webkit-writing-mode: horizontal-tb
    220219clip-path: none
    221220clip-rule: nonzero
     
    250249kerning: 0
    251250text-anchor: start
    252 writing-mode: lr-tb
     251writing-mode: horizontal-tb
    253252glyph-orientation-horizontal: 0deg
    254253glyph-orientation-vertical: auto
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/text-align-06-b-expected.txt

    r177774 r207757  
    1313              chunk 1 (vertical) text run 1 at (-10.40,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    1414              chunk 1 (vertical) text run 2 at (-10.40,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    15             RenderSVGTSpan {tspan} at (0,0) size 17x34
     15            RenderSVGTSpan {tspan} at (0,0) size 34x17
    1616              RenderSVGInlineText {#text} at (7,67) size 17x34
    1717                chunk 1 (vertical) text run 1 at (-3.40,67.03) startOffset 0 endOffset 1 height 33.52: "7"
     
    2323              chunk 1 (vertical) text run 1 at (69.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    2424              chunk 1 (vertical) text run 2 at (69.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    25             RenderSVGTSpan {tspan} at (0,0) size 27x135
     25            RenderSVGTSpan {tspan} at (0,0) size 135x27
    2626              RenderSVGInlineText {#text} at (0,67) size 27x135
    2727                chunk 1 (vertical) text run 1 at (48.60,67.03) startOffset 0 endOffset 1 height 33.52: "-"
     
    3636              chunk 1 (vertical) text run 1 at (169.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    3737              chunk 1 (vertical) text run 2 at (169.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    38             RenderSVGTSpan {tspan} at (0,0) size 17x101
     38            RenderSVGTSpan {tspan} at (0,0) size 101x17
    3939              RenderSVGInlineText {#text} at (0,67) size 17x101
    4040                chunk 1 (vertical) text run 1 at (152.84,67.03) startOffset 0 endOffset 1 height 33.52: "s"
    4141                chunk 1 (vertical) text run 2 at (152.84,100.55) startOffset 1 endOffset 2 height 33.52: "u"
    4242                chunk 1 (vertical) text run 3 at (152.84,134.06) startOffset 2 endOffset 3 height 33.52: "b"
    43             RenderSVGTSpan {tspan} at (0,0) size 16x35
     43            RenderSVGTSpan {tspan} at (0,0) size 35x16
    4444              RenderSVGInlineText {#text} at (17,167) size 15x34
    4545                chunk 1 (vertical) text run 1 at (169.60,167.58) startOffset 0 endOffset 1 height 33.52: "x"
     
    5050              chunk 1 (vertical) text run 1 at (249.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    5151              chunk 1 (vertical) text run 2 at (249.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    52             RenderSVGTSpan {tspan} at (0,0) size 18x168
     52            RenderSVGTSpan {tspan} at (0,0) size 169x17
    5353              RenderSVGInlineText {#text} at (16,67) size 17x168
    5454                chunk 1 (vertical) text run 1 at (266.36,67.03) startOffset 0 endOffset 1 height 33.52: "s"
     
    5757                chunk 1 (vertical) text run 4 at (266.36,167.58) startOffset 3 endOffset 4 height 33.52: "e"
    5858                chunk 1 (vertical) text run 5 at (266.36,201.09) startOffset 4 endOffset 5 height 33.52: "r"
    59             RenderSVGTSpan {tspan} at (0,0) size 16x35
     59            RenderSVGTSpan {tspan} at (0,0) size 35x16
    6060              RenderSVGInlineText {#text} at (0,234) size 15x34
    6161                chunk 1 (vertical) text run 1 at (249.60,234.61) startOffset 0 endOffset 1 height 33.52: "x"
  • trunk/LayoutTests/platform/mac/svg/text/text-align-06-b-expected.txt

    r177774 r207757  
    1313              chunk 1 (vertical) text run 1 at (-10.40,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    1414              chunk 1 (vertical) text run 2 at (-10.40,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    15             RenderSVGTSpan {tspan} at (0,0) size 17x34
     15            RenderSVGTSpan {tspan} at (0,0) size 34x17
    1616              RenderSVGInlineText {#text} at (7,67) size 17x34
    1717                chunk 1 (vertical) text run 1 at (-3.40,67.03) startOffset 0 endOffset 1 height 33.52: "7"
     
    2323              chunk 1 (vertical) text run 1 at (69.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    2424              chunk 1 (vertical) text run 2 at (69.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    25             RenderSVGTSpan {tspan} at (0,0) size 27x135
     25            RenderSVGTSpan {tspan} at (0,0) size 135x27
    2626              RenderSVGInlineText {#text} at (0,67) size 27x135
    2727                chunk 1 (vertical) text run 1 at (48.60,67.03) startOffset 0 endOffset 1 height 33.52: "-"
     
    3636              chunk 1 (vertical) text run 1 at (169.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    3737              chunk 1 (vertical) text run 2 at (169.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    38             RenderSVGTSpan {tspan} at (0,0) size 17x101
     38            RenderSVGTSpan {tspan} at (0,0) size 101x17
    3939              RenderSVGInlineText {#text} at (0,67) size 17x101
    4040                chunk 1 (vertical) text run 1 at (152.84,67.03) startOffset 0 endOffset 1 height 33.52: "s"
    4141                chunk 1 (vertical) text run 2 at (152.84,100.55) startOffset 1 endOffset 2 height 33.52: "u"
    4242                chunk 1 (vertical) text run 3 at (152.84,134.06) startOffset 2 endOffset 3 height 33.52: "b"
    43             RenderSVGTSpan {tspan} at (0,0) size 16x35
     43            RenderSVGTSpan {tspan} at (0,0) size 35x16
    4444              RenderSVGInlineText {#text} at (17,167) size 15x34
    4545                chunk 1 (vertical) text run 1 at (169.60,167.58) startOffset 0 endOffset 1 height 33.52: "x"
     
    5050              chunk 1 (vertical) text run 1 at (249.60,0.00) startOffset 0 endOffset 1 height 33.52: "t"
    5151              chunk 1 (vertical) text run 2 at (249.60,33.52) startOffset 1 endOffset 2 height 33.52: "e"
    52             RenderSVGTSpan {tspan} at (0,0) size 18x168
     52            RenderSVGTSpan {tspan} at (0,0) size 169x17
    5353              RenderSVGInlineText {#text} at (16,67) size 17x168
    5454                chunk 1 (vertical) text run 1 at (266.36,67.03) startOffset 0 endOffset 1 height 33.52: "s"
     
    5757                chunk 1 (vertical) text run 4 at (266.36,167.58) startOffset 3 endOffset 4 height 33.52: "e"
    5858                chunk 1 (vertical) text run 5 at (266.36,201.09) startOffset 4 endOffset 5 height 33.52: "r"
    59             RenderSVGTSpan {tspan} at (0,0) size 16x35
     59            RenderSVGTSpan {tspan} at (0,0) size 35x16
    6060              RenderSVGInlineText {#text} at (0,234) size 15x34
    6161                chunk 1 (vertical) text run 1 at (249.60,234.61) startOffset 0 endOffset 1 height 33.52: "x"
  • trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt

    r205809 r207757  
    433433rect: style.getPropertyValue(-webkit-user-select) : text
    434434rect: style.getPropertyCSSValue(-webkit-user-select) : [object CSSPrimitiveValue]
    435 rect: style.getPropertyValue(-webkit-writing-mode) : horizontal-tb
    436 rect: style.getPropertyCSSValue(-webkit-writing-mode) : [object CSSPrimitiveValue]
    437435rect: style.getPropertyValue(clip-path) : none
    438436rect: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
     
    499497rect: style.getPropertyValue(text-anchor) : start
    500498rect: style.getPropertyCSSValue(text-anchor) : [object CSSPrimitiveValue]
    501 rect: style.getPropertyValue(writing-mode) : lr-tb
     499rect: style.getPropertyValue(writing-mode) : horizontal-tb
    502500rect: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
    503501rect: style.getPropertyValue(glyph-orientation-horizontal) : 0deg
     
    943941g: style.getPropertyValue(-webkit-user-select) : text
    944942g: style.getPropertyCSSValue(-webkit-user-select) : [object CSSPrimitiveValue]
    945 g: style.getPropertyValue(-webkit-writing-mode) : horizontal-tb
    946 g: style.getPropertyCSSValue(-webkit-writing-mode) : [object CSSPrimitiveValue]
    947943g: style.getPropertyValue(clip-path) : none
    948944g: style.getPropertyCSSValue(clip-path) : [object CSSPrimitiveValue]
     
    10091005g: style.getPropertyValue(text-anchor) : start
    10101006g: style.getPropertyCSSValue(text-anchor) : [object CSSPrimitiveValue]
    1011 g: style.getPropertyValue(writing-mode) : lr-tb
     1007g: style.getPropertyValue(writing-mode) : horizontal-tb
    10121008g: style.getPropertyCSSValue(writing-mode) : [object CSSPrimitiveValue]
    10131009g: style.getPropertyValue(glyph-orientation-horizontal) : 0deg
  • trunk/Source/WebCore/ChangeLog

    r207755 r207757  
     12016-10-24  Dave Hyatt  <hyatt@apple.com>
     2
     3        [CSS Parser] Unprefix -webkit-writing-mode
     4        https://bugs.webkit.org/show_bug.cgi?id=163870
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        * css/CSSComputedStyleDeclaration.cpp:
     9        (WebCore::ComputedStyleExtractor::propertyValue):
     10        Change -webkit-writing mode to writing-mode.
     11
     12        * css/CSSPrimitiveValueMappings.h:
     13        (WebCore::CSSPrimitiveValue::operator WritingMode):
     14        (WebCore::CSSPrimitiveValue::operator SVGWritingMode): Deleted.
     15        Eliminate the SVGWritingMode converters. Add support for the unique SVG-specific
     16        values to the WritingMode converters.
     17
     18        * css/CSSPropertyNames.in:
     19        Alias -webkit-writing-mode to writing-mode. Move writing-mode up to be
     20        high priority like -webkit-writing mode was. Alias -epub-writing-mode to writing-mode
     21        instead of to -webkit-writing-mode.
     22
     23        * css/SVGCSSComputedStyleDeclaration.cpp:
     24        (WebCore::ComputedStyleExtractor::svgPropertyValue):
     25        Remove writing-mode from SVG computed style, since the base CSSComputedStyleDeclaration handles it.
     26
     27        * css/StyleBuilderCustom.h:
     28        (WebCore::StyleBuilderCustom::applyValueWritingMode):
     29        (WebCore::StyleBuilderCustom::applyValueWebkitWritingMode): Deleted.
     30        Renamed applyValueWebkitWritingMode to applyValueWritingMode. Removed the SVG code, since
     31        the underlying converter for WritingMode now handles those values.
     32
     33        * css/StyleResolver.cpp:
     34        (WebCore::extractDirectionAndWritingMode):
     35        Rename -webkit-writing-mode to writing-mode.
     36
     37        * css/parser/CSSParser.cpp:
     38        (WebCore::isValidKeywordPropertyAndValue):
     39        Eliminate -webkit-writing-mode and make sure writing-mode handles both the SVG values
     40        and the normal values.
     41
     42        * css/parser/CSSParserFastPaths.cpp:
     43        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
     44        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
     45        Same deal here.
     46
     47        * html/track/TextTrackCueGeneric.cpp:
     48        (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
     49        * html/track/VTTCue.cpp:
     50        (WebCore::VTTCueBox::applyCSSProperties):
     51        Cue stuff was setting -webkit-writing-mode, so make it set writing-mode instead now.
     52
     53        * rendering/RenderLineBreak.cpp:
     54        (WebCore::RenderLineBreak::collectSelectionRects):
     55        * rendering/RenderText.cpp:
     56        (WebCore::RenderText::collectSelectionRects):
     57        Switch the SVG-specific code here over to accessing the RenderStyle writing-mode and not
     58        the SVG-specific one.
     59
     60        * rendering/style/RenderStyle.h:
     61        (WebCore::RenderStyle::isVerticalWritingMode):
     62        Add a helper function for asking if something is vertical writing mode.
     63
     64        * rendering/style/SVGRenderStyle.cpp:
     65        * rendering/style/SVGRenderStyle.h:
     66        * rendering/style/SVGRenderStyleDefs.h:
     67        (WebCore::SVGRenderStyle::diff):
     68        Remove the SVG writing mode code.
     69
     70        * rendering/svg/RenderSVGInlineText.cpp:
     71        (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
     72        Make sure to force SVG font descriptions to be horizontal, since SVG controls
     73        its own glyph orientation.
     74
     75        * rendering/svg/SVGRenderTreeAsText.cpp:
     76        (WebCore::writeSVGInlineTextBox):
     77        * rendering/svg/SVGTextChunk.cpp:
     78        (WebCore::SVGTextChunk::SVGTextChunk):
     79        * rendering/svg/SVGTextLayoutEngine.cpp:
     80        (WebCore::SVGTextLayoutEngine::layoutInlineTextBox):
     81        * rendering/svg/SVGTextQuery.cpp:
     82        (WebCore::SVGTextQuery::executeQuery):
     83        Changed to access the RenderStyle writing mode instead of the SVG-specific one.
     84
    1852016-10-23  Antti Koivisto  <antti@apple.com>
    286
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r207755 r207757  
    408408    CSSPropertyWebkitUserModify,
    409409    CSSPropertyWebkitUserSelect,
    410     CSSPropertyWebkitWritingMode,
    411410#if ENABLE(CSS_REGIONS)
    412411    CSSPropertyWebkitFlowInto,
     
    36853684        case CSSPropertyWebkitLineAlign:
    36863685            return CSSPrimitiveValue::create(style->lineAlign());
    3687         case CSSPropertyWebkitWritingMode:
     3686        case CSSPropertyWritingMode:
    36883687            return cssValuePool.createValue(style->writingMode());
    36893688        case CSSPropertyWebkitTextCombine:
     
    39863985        case CSSPropertyTextAnchor:
    39873986        case CSSPropertyVectorEffect:
    3988         case CSSPropertyWritingMode:
    39893987        case CSSPropertyWebkitSvgShadow:
    39903988            return svgPropertyValue(propertyID, DoNotUpdateLayout);
  • trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h

    r207396 r207757  
    32433243    switch (m_value.valueID) {
    32443244    case CSSValueHorizontalTb:
     3245    case CSSValueLrTb:
     3246    case CSSValueRl:
     3247    case CSSValueRlTb:
    32453248        return TopToBottomWritingMode;
    32463249    case CSSValueVerticalRl:
     3250    case CSSValueTb:
     3251    case CSSValueTbRl:
    32473252        return RightToLeftWritingMode;
    32483253    case CSSValueVerticalLr:
     
    48884893}
    48894894
    4890 template<> inline CSSPrimitiveValue::CSSPrimitiveValue(SVGWritingMode e)
    4891     : CSSValue(PrimitiveClass)
    4892 {
    4893     m_primitiveUnitType = CSS_VALUE_ID;
    4894     switch (e) {
    4895     case WM_LRTB:
    4896         m_value.valueID = CSSValueLrTb;
    4897         break;
    4898     case WM_LR:
    4899         m_value.valueID = CSSValueLr;
    4900         break;
    4901     case WM_RLTB:
    4902         m_value.valueID = CSSValueRlTb;
    4903         break;
    4904     case WM_RL:
    4905         m_value.valueID = CSSValueRl;
    4906         break;
    4907     case WM_TBRL:
    4908         m_value.valueID = CSSValueTbRl;
    4909         break;
    4910     case WM_TB:
    4911         m_value.valueID = CSSValueTb;
    4912         break;
    4913     }
    4914 }
    4915 
    4916 template<> inline CSSPrimitiveValue::operator SVGWritingMode() const
    4917 {
    4918     ASSERT(isValueID());
    4919 
    4920     switch (m_value.valueID) {
    4921     case CSSValueLrTb:
    4922         return WM_LRTB;
    4923     case CSSValueLr:
    4924         return WM_LR;
    4925     case CSSValueRlTb:
    4926         return WM_RLTB;
    4927     case CSSValueRl:
    4928         return WM_RL;
    4929     case CSSValueTbRl:
    4930         return WM_TBRL;
    4931     case CSSValueTb:
    4932         return WM_TB;
    4933     default:
    4934         break;
    4935     }
    4936 
    4937     ASSERT_NOT_REACHED();
    4938     return WM_LRTB;
    4939 }
    4940 
    49414895template<> inline CSSPrimitiveValue::CSSPrimitiveValue(const Color& color)
    49424896    : CSSValue(PrimitiveClass)
  • trunk/Source/WebCore/css/CSSPropertyNames.in

    r207630 r207757  
    124124-webkit-text-size-adjust [Inherited, Custom=Value]
    125125#endif
    126 -webkit-writing-mode [Inherited, Custom=Value]
    127 -epub-writing-mode = -webkit-writing-mode
     126writing-mode [Inherited, Custom=Value]
     127-webkit-writing-mode = writing-mode
     128-epub-writing-mode = writing-mode
    128129-webkit-text-zoom [Inherited, Custom=Value]
    129130zoom [Custom=All]
     
    369370word-spacing [Inherited, ConditionalConverter=WordSpacing]
    370371word-wrap [Inherited=EOverflowWrap, NameForMethods=OverflowWrap]
    371 writing-mode [Inherited, SVG]
    372372x [Initial=initialZeroLength, Converter=Length]
    373373y [Initial=initialZeroLength, Converter=Length]
  • trunk/Source/WebCore/css/SVGCSSComputedStyleDeclaration.cpp

    r207686 r207757  
    150150        case CSSPropertyTextAnchor:
    151151            return CSSPrimitiveValue::create(svgStyle.textAnchor());
    152         case CSSPropertyWritingMode:
    153             return CSSPrimitiveValue::create(svgStyle.writingMode());
    154152        case CSSPropertyClipPath:
    155153            if (!svgStyle.clipperResource().isEmpty())
  • trunk/Source/WebCore/css/StyleBuilderCustom.h

    r207726 r207757  
    134134#endif
    135135    static void applyValueWebkitTextZoom(StyleResolver&, CSSValue&);
    136     static void applyValueWebkitWritingMode(StyleResolver&, CSSValue&);
     136    static void applyValueWritingMode(StyleResolver&, CSSValue&);
    137137    static void applyValueAlt(StyleResolver&, CSSValue&);
    138138#if ENABLE(CSS_SCROLL_SNAP)
     
    706706}
    707707
    708 inline void StyleBuilderCustom::applyValueWebkitWritingMode(StyleResolver& styleResolver, CSSValue& value)
     708inline void StyleBuilderCustom::applyValueWritingMode(StyleResolver& styleResolver, CSSValue& value)
    709709{
    710710    styleResolver.setWritingMode(downcast<CSSPrimitiveValue>(value));
    711711    styleResolver.style()->setHasExplicitlySetWritingMode(true);
    712712}
    713 
     713   
    714714inline void StyleBuilderCustom::applyValueWebkitTextOrientation(StyleResolver& styleResolver, CSSValue& value)
    715715{
     
    11781178{
    11791179    SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
    1180     SVGPaint& svgPaint = downcast<SVGPaint>(value);
    1181     svgStyle.setFillPaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
     1180   
     1181    // FIXME-NEWPARSER: SVGPaint as a back-end CSSValue is bad, since it's bypassing
     1182    // the style resolver's colorFromPrimitiveValue code. It's also not necessary, since it's
     1183    // not even how we store things in the front end.
     1184    // Remove this block of code when the new parser is turned on.
     1185    if (value.isSVGPaint()) {
     1186        auto& svgPaint = downcast<SVGPaint>(value);
     1187        svgStyle.setFillPaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
     1188        return;
     1189    }
     1190   
     1191    const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
     1192    String url;
     1193    if (value.isValueList()) {
     1194        const CSSValueList& list = downcast<CSSValueList>(value);
     1195        url = downcast<CSSPrimitiveValue>(list.item(0))->stringValue();
     1196        localValue = downcast<CSSPrimitiveValue>(list.item(1));
     1197    }
     1198   
     1199    if (!localValue)
     1200        return;
     1201   
     1202    Color color;
     1203    SVGPaint::SVGPaintType paintType = SVGPaint::SVG_PAINTTYPE_RGBCOLOR;
     1204    if (localValue->isURI()) {
     1205        paintType = SVGPaint::SVG_PAINTTYPE_URI;
     1206        url = downcast<CSSPrimitiveValue>(localValue)->stringValue();
     1207    } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone)
     1208        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_NONE : SVGPaint::SVG_PAINTTYPE_URI_NONE;
     1209    else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) {
     1210        color = styleResolver.style()->color();
     1211        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR :SVGPaint:: SVG_PAINTTYPE_URI_CURRENTCOLOR;
     1212    } else {
     1213        color = styleResolver.colorFromPrimitiveValue(*localValue);
     1214        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_RGBCOLOR : SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR;
     1215    }
     1216    svgStyle.setFillPaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
    11821217}
    11831218
     
    11981233{
    11991234    SVGRenderStyle& svgStyle = styleResolver.style()->accessSVGStyle();
    1200     auto& svgPaint = downcast<SVGPaint>(value);
    1201     svgStyle.setStrokePaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
     1235   
     1236    // FIXME-NEWPARSER: SVGPaint as a back-end CSSValue is bad, since it's bypassing
     1237    // the style resolver's colorFromPrimitiveValue code. It's also not necessary, since it's
     1238    // not even how we store things in the front end.
     1239    // Remove this block of code when the new parser is turned on.
     1240    if (value.isSVGPaint()) {
     1241        auto& svgPaint = downcast<SVGPaint>(value);
     1242        svgStyle.setStrokePaint(svgPaint.paintType(), StyleBuilderConverter::convertSVGColor(styleResolver, svgPaint), svgPaint.uri(), styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
     1243        return;
     1244    }
     1245   
     1246    const CSSPrimitiveValue* localValue = value.isPrimitiveValue() ? &downcast<CSSPrimitiveValue>(value) : nullptr;
     1247    String url;
     1248    if (value.isValueList()) {
     1249        const CSSValueList& list = downcast<CSSValueList>(value);
     1250        url = downcast<CSSPrimitiveValue>(list.item(0))->stringValue();
     1251        localValue = downcast<CSSPrimitiveValue>(list.item(1));
     1252    }
     1253   
     1254    if (!localValue)
     1255        return;
     1256   
     1257    Color color;
     1258    SVGPaint::SVGPaintType paintType = SVGPaint::SVG_PAINTTYPE_RGBCOLOR;
     1259    if (localValue->isURI()) {
     1260        paintType = SVGPaint::SVG_PAINTTYPE_URI;
     1261        url = downcast<CSSPrimitiveValue>(localValue)->stringValue();
     1262    } else if (localValue->isValueID() && localValue->valueID() == CSSValueNone)
     1263        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_NONE : SVGPaint::SVG_PAINTTYPE_URI_NONE;
     1264    else if (localValue->isValueID() && localValue->valueID() == CSSValueCurrentcolor) {
     1265        color = styleResolver.style()->color();
     1266        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR :SVGPaint:: SVG_PAINTTYPE_URI_CURRENTCOLOR;
     1267    } else {
     1268        color = styleResolver.colorFromPrimitiveValue(*localValue);
     1269        paintType = url.isEmpty() ? SVGPaint::SVG_PAINTTYPE_RGBCOLOR : SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR;
     1270    }
     1271    svgStyle.setStrokePaint(paintType, color, url, styleResolver.applyPropertyToRegularStyle(), styleResolver.applyPropertyToVisitedLinkStyle());
    12021272}
    12031273
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r207755 r207757  
    12931293    writingMode = style.writingMode();
    12941294
    1295     bool hadImportantWebkitWritingMode = false;
     1295    bool hadImportantWritingMode = false;
    12961296    bool hadImportantDirection = false;
    12971297
     
    13021302                continue;
    13031303            switch (property.id()) {
    1304             case CSSPropertyWebkitWritingMode:
    1305                 if (!hadImportantWebkitWritingMode || property.isImportant()) {
     1304            case CSSPropertyWritingMode:
     1305                if (!hadImportantWritingMode || property.isImportant()) {
    13061306                    writingMode = downcast<CSSPrimitiveValue>(*property.value());
    1307                     hadImportantWebkitWritingMode = property.isImportant();
     1307                    hadImportantWritingMode = property.isImportant();
    13081308                }
    13091309                break;
  • trunk/Source/WebCore/css/parser/CSSParser.cpp

    r207630 r207757  
    10141014        }
    10151015        break;
    1016     case CSSPropertyWebkitWritingMode:
    1017         if (valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt)
    1018             return true;
    1019         break;
    10201016    case CSSPropertyWhiteSpace: // normal | pre | nowrap | inherit
    10211017        if (valueID == CSSValueNormal || valueID == CSSValuePre || valueID == CSSValuePreWrap || valueID == CSSValuePreLine || valueID == CSSValueNowrap)
     
    11281124        break;
    11291125    case CSSPropertyWritingMode:
    1130         if (valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb)
     1126        if ((valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt)
     1127            || valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl
     1128            || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb)
    11311129            return true;
    11321130        break;
  • trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp

    r207682 r207757  
    742742    case CSSPropertyWebkitUserSelect: // auto | none | text | all
    743743        return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll;
    744     case CSSPropertyWebkitWritingMode:
    745         return valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt;
    746744    case CSSPropertyWritingMode:
    747         return valueID == CSSValueHorizontalTb
    748             || valueID == CSSValueVerticalRl || valueID == CSSValueVerticalLr
     745        // Note that horizontal-bt is not supported by the unprefixed version of
     746        // the property, only by the -webkit- version.
     747        return (valueID >= CSSValueHorizontalTb && valueID <= CSSValueHorizontalBt)
    749748            || valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl
    750749            || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb;
     
    878877    case CSSPropertyWebkitUserModify:
    879878    case CSSPropertyWebkitUserSelect:
    880     case CSSPropertyWebkitWritingMode:
    881879    case CSSPropertyWhiteSpace:
    882880    case CSSPropertyWordBreak:
  • trunk/Source/WebCore/html/track/TextTrackCueGeneric.cpp

    r207720 r207757  
    141141    if (cue->backgroundColor().isValid())
    142142        setInlineStyleProperty(CSSPropertyBackgroundColor, cue->backgroundColor().serialized());
    143     setInlineStyleProperty(CSSPropertyWebkitWritingMode, cue->getCSSWritingMode(), false);
     143    setInlineStyleProperty(CSSPropertyWritingMode, cue->getCSSWritingMode(), false);
    144144    setInlineStyleProperty(CSSPropertyWhiteSpace, CSSValuePreWrap);
    145145}
  • trunk/Source/WebCore/html/track/VTTCue.cpp

    r207720 r207757  
    159159
    160160    // the 'writing-mode' property must be set to writing-mode
    161     setInlineStyleProperty(CSSPropertyWebkitWritingMode, m_cue.getCSSWritingMode(), false);
     161    setInlineStyleProperty(CSSPropertyWritingMode, m_cue.getCSSWritingMode(), false);
    162162
    163163    std::pair<float, float> position = m_cue.getCSSPosition();
  • trunk/Source/WebCore/rendering/RenderLineBreak.cpp

    r204400 r207757  
    265265    bool isFixed = false;
    266266    IntRect absRect = localToAbsoluteQuad(FloatRect(rect), UseTransforms, &isFixed).enclosingBoundingBox();
    267     bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().svgStyle().isVerticalWritingMode();
     267    bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().isVerticalWritingMode();
    268268    // If the containing block is an inline element, we want to check the inlineBoxWrapper orientation
    269269    // to determine the orientation of the block. In this case we also use the inlineBoxWrapper to
  • trunk/Source/WebCore/rendering/RenderText.cpp

    r206395 r207757  
    385385        bool isFixed = false;
    386386        IntRect absRect = localToAbsoluteQuad(FloatRect(rect), UseTransforms, &isFixed).enclosingBoundingBox();
    387         bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().svgStyle().isVerticalWritingMode();
     387        bool boxIsHorizontal = !box->isSVGInlineTextBox() ? box->isHorizontal() : !style().isVerticalWritingMode();
    388388        // If the containing block is an inline element, we want to check the inlineBoxWrapper orientation
    389389        // to determine the orientation of the block. In this case we also use the inlineBoxWrapper to
  • trunk/Source/WebCore/rendering/style/RenderStyle.h

    r207535 r207757  
    11621162    WritingMode writingMode() const { return static_cast<WritingMode>(inherited_flags.m_writingMode); }
    11631163    bool isHorizontalWritingMode() const { return WebCore::isHorizontalWritingMode(writingMode()); }
     1164    bool isVerticalWritingMode() const { return WebCore::isVerticalWritingMode(writingMode()); }
    11641165    bool isFlippedLinesWritingMode() const { return WebCore::isFlippedLinesWritingMode(writingMode()); }
    11651166    bool isFlippedBlocksWritingMode() const { return WebCore::isFlippedWritingMode(writingMode()); }
  • trunk/Source/WebCore/rendering/style/SVGRenderStyle.cpp

    r199964 r207757  
    207207    // All text related properties influence layout.
    208208    if (svg_inherited_flags._textAnchor != other->svg_inherited_flags._textAnchor
    209         || svg_inherited_flags._writingMode != other->svg_inherited_flags._writingMode
    210209        || svg_inherited_flags._glyphOrientationHorizontal != other->svg_inherited_flags._glyphOrientationHorizontal
    211210        || svg_inherited_flags._glyphOrientationVertical != other->svg_inherited_flags._glyphOrientationVertical
  • trunk/Source/WebCore/rendering/style/SVGRenderStyle.h

    r207716 r207757  
    7171    static EShapeRendering initialShapeRendering() { return SR_AUTO; }
    7272    static ETextAnchor initialTextAnchor() { return TA_START; }
    73     static SVGWritingMode initialWritingMode() { return WM_LRTB; }
    7473    static EGlyphOrientation initialGlyphOrientationHorizontal() { return GO_0DEG; }
    7574    static EGlyphOrientation initialGlyphOrientationVertical() { return GO_AUTO; }
     
    127126    void setShapeRendering(EShapeRendering val) { svg_inherited_flags._shapeRendering = val; }
    128127    void setTextAnchor(ETextAnchor val) { svg_inherited_flags._textAnchor = val; }
    129     void setWritingMode(SVGWritingMode val) { svg_inherited_flags._writingMode = val; }
    130128    void setGlyphOrientationHorizontal(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationHorizontal = val; }
    131129    void setGlyphOrientationVertical(EGlyphOrientation val) { svg_inherited_flags._glyphOrientationVertical = val; }
     
    335333    EShapeRendering shapeRendering() const { return (EShapeRendering) svg_inherited_flags._shapeRendering; }
    336334    ETextAnchor textAnchor() const { return (ETextAnchor) svg_inherited_flags._textAnchor; }
    337     SVGWritingMode writingMode() const { return (SVGWritingMode) svg_inherited_flags._writingMode; }
    338335    EGlyphOrientation glyphOrientationHorizontal() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationHorizontal; }
    339336    EGlyphOrientation glyphOrientationVertical() const { return (EGlyphOrientation) svg_inherited_flags._glyphOrientationVertical; }
     
    388385    bool hasVisibleStroke() const { return hasStroke() && !strokeWidth().isZero(); }
    389386    bool hasFill() const { return fillPaintType() != SVGPaint::SVG_PAINTTYPE_NONE; }
    390     bool isVerticalWritingMode() const { return writingMode() == WM_TBRL || writingMode() == WM_TB; }
    391387    bool isolatesBlending() const { return hasMasker() || shadow(); }
    392388
     
    405401                && (_colorInterpolation == other._colorInterpolation)
    406402                && (_colorInterpolationFilters == other._colorInterpolationFilters)
    407                 && (_writingMode == other._writingMode)
    408403                && (_glyphOrientationHorizontal == other._glyphOrientationHorizontal)
    409404                && (_glyphOrientationVertical == other._glyphOrientationVertical)
     
    425420        unsigned _colorInterpolation : 2; // EColorInterpolation
    426421        unsigned _colorInterpolationFilters : 2; // EColorInterpolation
    427         unsigned _writingMode : 3; // SVGWritingMode
    428422        unsigned _glyphOrientationHorizontal : 3; // EGlyphOrientation
    429423        unsigned _glyphOrientationVertical : 3; // EGlyphOrientation
     
    482476        svg_inherited_flags._colorInterpolation = initialColorInterpolation();
    483477        svg_inherited_flags._colorInterpolationFilters = initialColorInterpolationFilters();
    484         svg_inherited_flags._writingMode = initialWritingMode();
    485478        svg_inherited_flags._glyphOrientationHorizontal = initialGlyphOrientationHorizontal();
    486479        svg_inherited_flags._glyphOrientationVertical = initialGlyphOrientationVertical();
  • trunk/Source/WebCore/rendering/style/SVGRenderStyleDefs.h

    r188647 r207757  
    5656    enum EShapeRendering {
    5757        SR_AUTO, SR_OPTIMIZESPEED, SR_CRISPEDGES, SR_GEOMETRICPRECISION
    58     };
    59 
    60     enum SVGWritingMode {
    61         WM_LRTB, WM_LR, WM_RLTB, WM_RL, WM_TBRL, WM_TB
    6258    };
    6359
  • trunk/Source/WebCore/rendering/svg/RenderSVGInlineText.cpp

    r204400 r207757  
    241241    fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSizeForSVGInlineText(fontDescription.computedSize(), fontDescription.isAbsoluteSize(), scalingFactor, renderer.document()));
    242242
     243    // SVG controls its own glyph orientation, so don't allow writing-mode
     244    // to affect it.
     245    if (fontDescription.orientation() != FontOrientation::Horizontal)
     246        fontDescription.setOrientation(FontOrientation::Horizontal);
     247
    243248    scaledFont = FontCascade(fontDescription, 0, 0);
    244249    scaledFont.update(&renderer.document().fontSelector());
  • trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

    r195946 r207757  
    324324        ts << "chunk 1 ";
    325325        ETextAnchor anchor = svgStyle.textAnchor();
    326         bool isVerticalText = svgStyle.isVerticalWritingMode();
     326        bool isVerticalText = textBox->renderer().style().isVerticalWritingMode();
    327327        if (anchor == TA_MIDDLE) {
    328328            ts << "(middle anchor";
  • trunk/Source/WebCore/rendering/svg/SVGTextChunk.cpp

    r182840 r207757  
    3838        m_chunkStyle |= SVGTextChunk::RightToLeftText;
    3939
    40     if (svgStyle.isVerticalWritingMode())
     40    if (style.isVerticalWritingMode())
    4141        m_chunkStyle |= SVGTextChunk::VerticalText;
    4242   
  • trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp

    r198074 r207757  
    221221
    222222    textBox.clearTextFragments();
    223     m_isVerticalText = style.svgStyle().isVerticalWritingMode();
     223    m_isVerticalText = style.isVerticalWritingMode();
    224224    layoutTextOnLineOrPath(textBox, text, style);
    225225
  • trunk/Source/WebCore/rendering/svg/SVGTextQuery.cpp

    r204400 r207757  
    116116        queryData->textRenderer = &queryData->textBox->renderer();
    117117
    118         queryData->isVerticalText = queryData->textRenderer->style().svgStyle().isVerticalWritingMode();
     118        queryData->isVerticalText = queryData->textRenderer->style().isVerticalWritingMode();
    119119        const Vector<SVGTextFragment>& fragments = queryData->textBox->textFragments();
    120120   
Note: See TracChangeset for help on using the changeset viewer.