Changeset 251696 in webkit


Ignore:
Timestamp:
Oct 29, 2019 3:27:35 AM (4 years ago)
Author:
commit-queue@webkit.org
Message:

[SVG2] fill-opacity, stroke-opacity, stop-opacity and flood-opacity doe not support percentage
https://bugs.webkit.org/show_bug.cgi?id=201731

Source/WebCore:

Patch by Dirk Schulze <krit@webkit.org> on 2019-10-29
Reviewed by Simon Fraser.

The CSS properties opacity, fill-opacity, stroke-opacity, stop-opacity, flood-opacity support
percentage in addition to number values.
Add percentage support.

Tests: fast/css/parsing-opacity.html

fast/svg/parsing-fill-opacity.html
fast/svg/parsing-flood-opacity.html
fast/svg/parsing-stop-opacity.html
fast/svg/parsing-stroke-opacity.html

  • css/CSSProperties.json: opacity needs to use Opacity converter now.
  • css/StyleBuilderConverter.h:

(WebCore::StyleBuilderConverter::convertOpacity): Clamp values to [0,1]

  • css/parser/CSSPropertyParser.cpp:

(WebCore::CSSPropertyParser::parseSingleValue): Parse percentage values.

LayoutTests:

Test number and percentage values for opacity, fill-opacity, stroke-opacity, stop-opacity, flood-opacity.

Patch by Dirk Schulze <krit@webkit.org> on 2019-10-29
Reviewed by Simon Fraser.

  • fast/css/parsing-opacity-expected.txt: Added.
  • fast/css/parsing-opacity.html: Added.
  • fast/svg/parsing-fill-opacity-expected.txt: Added.
  • fast/svg/parsing-fill-opacity.html: Added.
  • fast/svg/parsing-flood-opacity-expected.txt: Added.
  • fast/svg/parsing-flood-opacity.html: Added.
  • fast/svg/parsing-stop-opacity-expected.txt: Added.
  • fast/svg/parsing-stop-opacity.html: Added.
  • fast/svg/parsing-stroke-opacity-expected.txt: Added.
  • fast/svg/parsing-stroke-opacity.html: Added.
Location:
trunk
Files:
11 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r251692 r251696  
     12019-10-29  Dirk Schulze  <krit@webkit.org>
     2
     3        [SVG2] fill-opacity, stroke-opacity, stop-opacity and flood-opacity doe not support percentage
     4        https://bugs.webkit.org/show_bug.cgi?id=201731
     5
     6        Test number and percentage values for opacity, fill-opacity, stroke-opacity, stop-opacity, flood-opacity.
     7
     8        Reviewed by Simon Fraser.
     9
     10        * fast/css/parsing-opacity-expected.txt: Added.
     11        * fast/css/parsing-opacity.html: Added.
     12        * fast/svg/parsing-fill-opacity-expected.txt: Added.
     13        * fast/svg/parsing-fill-opacity.html: Added.
     14        * fast/svg/parsing-flood-opacity-expected.txt: Added.
     15        * fast/svg/parsing-flood-opacity.html: Added.
     16        * fast/svg/parsing-stop-opacity-expected.txt: Added.
     17        * fast/svg/parsing-stop-opacity.html: Added.
     18        * fast/svg/parsing-stroke-opacity-expected.txt: Added.
     19        * fast/svg/parsing-stroke-opacity.html: Added.
     20
    1212019-10-28  Kate Cheney  <katherine_cheney@apple.com>
    222
  • trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/import/painting-fill-05-b-manual-expected.txt

    r250276 r251696  
    1111      RenderSVGRect {rect} at (232,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.80]}] [x=140.00] [y=140.00] [width=60.00] [height=60.00]
    1212      RenderSVGRect {rect} at (282,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=170.00] [y=170.00] [width=60.00] [height=60.00]
    13       RenderSVGRect {rect} at (332,32) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-100.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
    14       RenderSVGRect {rect} at (382,82) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-10.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
    15       RenderSVGRect {rect} at (432,132) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-0.10]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
    16       RenderSVGRect {rect} at (482,182) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=1.10]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
    17       RenderSVGRect {rect} at (532,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=10.00]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
    18       RenderSVGRect {rect} at (582,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=100.00]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
     13      RenderSVGRect {rect} at (332,32) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
     14      RenderSVGRect {rect} at (382,82) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
     15      RenderSVGRect {rect} at (432,132) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
     16      RenderSVGRect {rect} at (482,182) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
     17      RenderSVGRect {rect} at (532,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
     18      RenderSVGRect {rect} at (582,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
    1919    RenderSVGContainer {g} at (16,516) size 385x64
    2020      RenderSVGText {text} at (10,310) size 231x38 contains 1 chunk(s)
  • trunk/LayoutTests/platform/ios-simulator/imported/w3c/web-platform-tests/svg/import/painting-stroke-08-t-manual-expected.txt

    r250276 r251696  
    1717        RenderSVGEllipse {circle} at (635,495) size 30x30 [fill={[type=SOLID] [color=#66FF33]}] [cx=200.00] [cy=180.00] [r=5.00]
    1818        RenderSVGEllipse {circle} at (635,552) size 30x29 [fill={[type=SOLID] [color=#66FF33]}] [cx=200.00] [cy=200.00] [r=5.00]
    19         RenderSVGPath {path} at (140,42) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=-1.00] [stroke width=10.00]}] [data="M 20 20 L 200 20"]
    20         RenderSVGPath {path} at (140,99) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=-0.10] [stroke width=10.00]}] [data="M 20 40 L 200 40"]
     19        RenderSVGPath {path} at (140,42) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 20 L 200 20"]
     20        RenderSVGPath {path} at (140,99) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 40 L 200 40"]
    2121        RenderSVGPath {path} at (140,155) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 60 L 200 60"]
    2222        RenderSVGPath {path} at (140,212) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.20] [stroke width=10.00]}] [data="M 20 80 L 200 80"]
     
    2525        RenderSVGPath {path} at (140,382) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.80] [stroke width=10.00]}] [data="M 20 140 L 200 140"]
    2626        RenderSVGPath {path} at (140,439) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 160 L 200 160"]
    27         RenderSVGPath {path} at (140,495) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [opacity=1.10] [stroke width=10.00]}] [data="M 20 180 L 200 180"]
    28         RenderSVGPath {path} at (140,552) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=2.00] [stroke width=10.00]}] [data="M 20 200 L 200 200"]
     27        RenderSVGPath {path} at (140,495) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 180 L 200 180"]
     28        RenderSVGPath {path} at (140,552) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 200 L 200 200"]
    2929    RenderSVGContainer {g} at (16,516) size 385x64
    3030      RenderSVGText {text} at (10,310) size 231x38 contains 1 chunk(s)
  • trunk/LayoutTests/platform/ios/svg/W3C-SVG-1.1/painting-fill-05-b-expected.txt

    r205001 r251696  
    1010      RenderSVGRect {rect} at (139,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.80]}] [x=140.00] [y=140.00] [width=60.00] [height=60.00]
    1111      RenderSVGRect {rect} at (169,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=170.00] [y=170.00] [width=60.00] [height=60.00]
    12       RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-100.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
    13       RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-10.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
    14       RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-0.10]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
    15       RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=1.10]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
    16       RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=10.00]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
    17       RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=100.00]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
     12      RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
     13      RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
     14      RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
     15      RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
     16      RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
     17      RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
    1818    RenderSVGText {text} at (10,304) size 264x45 contains 1 chunk(s)
    1919      RenderSVGInlineText {#text} at (0,0) size 264x45
  • trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/import/painting-fill-05-b-manual-expected.txt

    r250276 r251696  
    1111      RenderSVGRect {rect} at (232,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.80]}] [x=140.00] [y=140.00] [width=60.00] [height=60.00]
    1212      RenderSVGRect {rect} at (282,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=170.00] [y=170.00] [width=60.00] [height=60.00]
    13       RenderSVGRect {rect} at (332,32) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-100.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
    14       RenderSVGRect {rect} at (382,82) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-10.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
    15       RenderSVGRect {rect} at (432,132) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-0.10]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
    16       RenderSVGRect {rect} at (482,182) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=1.10]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
    17       RenderSVGRect {rect} at (532,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=10.00]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
    18       RenderSVGRect {rect} at (582,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=100.00]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
     13      RenderSVGRect {rect} at (332,32) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
     14      RenderSVGRect {rect} at (382,82) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
     15      RenderSVGRect {rect} at (432,132) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
     16      RenderSVGRect {rect} at (482,182) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
     17      RenderSVGRect {rect} at (532,232) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
     18      RenderSVGRect {rect} at (582,282) size 103x103 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
    1919    RenderSVGContainer {g} at (16,517) size 381x62
    2020      RenderSVGText {text} at (10,310) size 229x38 contains 1 chunk(s)
  • trunk/LayoutTests/platform/mac/imported/w3c/web-platform-tests/svg/import/painting-stroke-08-t-manual-expected.txt

    r250276 r251696  
    1717        RenderSVGEllipse {circle} at (635,495) size 30x30 [fill={[type=SOLID] [color=#66FF33]}] [cx=200.00] [cy=180.00] [r=5.00]
    1818        RenderSVGEllipse {circle} at (635,552) size 30x29 [fill={[type=SOLID] [color=#66FF33]}] [cx=200.00] [cy=200.00] [r=5.00]
    19         RenderSVGPath {path} at (140,42) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=-1.00] [stroke width=10.00]}] [data="M 20 20 L 200 20"]
    20         RenderSVGPath {path} at (140,99) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=-0.10] [stroke width=10.00]}] [data="M 20 40 L 200 40"]
     19        RenderSVGPath {path} at (140,42) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 20 L 200 20"]
     20        RenderSVGPath {path} at (140,99) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 40 L 200 40"]
    2121        RenderSVGPath {path} at (140,155) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.00] [stroke width=10.00]}] [data="M 20 60 L 200 60"]
    2222        RenderSVGPath {path} at (140,212) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.20] [stroke width=10.00]}] [data="M 20 80 L 200 80"]
     
    2525        RenderSVGPath {path} at (140,382) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=0.80] [stroke width=10.00]}] [data="M 20 140 L 200 140"]
    2626        RenderSVGPath {path} at (140,439) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 160 L 200 160"]
    27         RenderSVGPath {path} at (140,495) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [opacity=1.10] [stroke width=10.00]}] [data="M 20 180 L 200 180"]
    28         RenderSVGPath {path} at (140,552) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [opacity=2.00] [stroke width=10.00]}] [data="M 20 200 L 200 200"]
     27        RenderSVGPath {path} at (140,495) size 510x30 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 180 L 200 180"]
     28        RenderSVGPath {path} at (140,552) size 510x29 [stroke={[type=SOLID] [color=#0000FF] [stroke width=10.00]}] [data="M 20 200 L 200 200"]
    2929    RenderSVGContainer {g} at (16,517) size 381x62
    3030      RenderSVGText {text} at (10,310) size 229x38 contains 1 chunk(s)
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/painting-fill-05-b-expected.txt

    r177774 r251696  
    1010      RenderSVGRect {rect} at (139,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.80]}] [x=140.00] [y=140.00] [width=60.00] [height=60.00]
    1111      RenderSVGRect {rect} at (169,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=170.00] [y=170.00] [width=60.00] [height=60.00]
    12       RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-100.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
    13       RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-10.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
    14       RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-0.10]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
    15       RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=1.10]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
    16       RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=10.00]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
    17       RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=100.00]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
     12      RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
     13      RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
     14      RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
     15      RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
     16      RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
     17      RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
    1818    RenderSVGText {text} at (10,304) size 264x46 contains 1 chunk(s)
    1919      RenderSVGInlineText {#text} at (0,0) size 264x46
  • trunk/LayoutTests/platform/win/svg/W3C-SVG-1.1/painting-fill-05-b-expected.txt

    r180176 r251696  
    1010      RenderSVGRect {rect} at (139,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.80]}] [x=140.00] [y=140.00] [width=60.00] [height=60.00]
    1111      RenderSVGRect {rect} at (169,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=170.00] [y=170.00] [width=60.00] [height=60.00]
    12       RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-100.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
    13       RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-10.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
    14       RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=-0.10]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
    15       RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=1.10]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
    16       RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=10.00]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
    17       RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=100.00]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
     12      RenderSVGRect {rect} at (199,19) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=200.00] [y=20.00] [width=60.00] [height=60.00]
     13      RenderSVGRect {rect} at (229,49) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=230.00] [y=50.00] [width=60.00] [height=60.00]
     14      RenderSVGRect {rect} at (259,79) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF] [opacity=0.00]}] [x=260.00] [y=80.00] [width=60.00] [height=60.00]
     15      RenderSVGRect {rect} at (289,109) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=290.00] [y=110.00] [width=60.00] [height=60.00]
     16      RenderSVGRect {rect} at (319,139) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=320.00] [y=140.00] [width=60.00] [height=60.00]
     17      RenderSVGRect {rect} at (349,169) size 62x62 [stroke={[type=SOLID] [color=#000000]}] [fill={[type=SOLID] [color=#0000FF]}] [x=350.00] [y=170.00] [width=60.00] [height=60.00]
    1818    RenderSVGText {text} at (10,304) size 264x46 contains 1 chunk(s)
    1919      RenderSVGInlineText {#text} at (0,0) size 264x46
  • trunk/LayoutTests/svg/css/parse-calc-length-expected.txt

    r178527 r251696  
    8181PASS computedStyle("y", "calc(100% - 100px)") is "calc(100% - 100px)"
    8282PASS computedStyle("stroke-miterlimit", "calc(500 - 400)") is "100"
    83 PASS computedStyle("flood-opacity", "calc(500 - 400)") is "100"
     83PASS computedStyle("flood-opacity", "calc(0.75 - 0.25)") is "0.5"
    8484PASS successfullyParsed is true
    8585
  • trunk/LayoutTests/svg/css/parse-calc-length.html

    r172711 r251696  
    9595// Number value properties.
    9696testComputed("stroke-miterlimit", "calc(500 - 400)", "100");
    97 testComputed("flood-opacity", "calc(500 - 400)", "100");
     97testComputed("flood-opacity", "calc(0.75 - 0.25)", "0.5");
    9898
    9999</script>
  • trunk/LayoutTests/svg/custom/invalid-css.svg

    r14027 r251696  
    1717            clip-path: url(#clip1) auto;
    1818            clip-rule: evenodd auto;
    19             opacity: 0%; /* does not seem supported yet */
     19            opacity: 'str';
    2020            visibility: hidden auto;
    2121        }
  • trunk/Source/WebCore/ChangeLog

    r251695 r251696  
     12019-10-29  Dirk Schulze  <krit@webkit.org>
     2
     3        [SVG2] fill-opacity, stroke-opacity, stop-opacity and flood-opacity doe not support percentage
     4        https://bugs.webkit.org/show_bug.cgi?id=201731
     5
     6        Reviewed by Simon Fraser.
     7
     8        The CSS properties opacity, fill-opacity, stroke-opacity, stop-opacity, flood-opacity support
     9        percentage in addition to number values.
     10        Add percentage support.
     11
     12        Tests: fast/css/parsing-opacity.html
     13               fast/svg/parsing-fill-opacity.html
     14               fast/svg/parsing-flood-opacity.html
     15               fast/svg/parsing-stop-opacity.html
     16               fast/svg/parsing-stroke-opacity.html
     17
     18        * css/CSSProperties.json: opacity needs to use Opacity converter now.
     19        * css/StyleBuilderConverter.h:
     20        (WebCore::StyleBuilderConverter::convertOpacity): Clamp values to [0,1]
     21        * css/parser/CSSPropertyParser.cpp:
     22        (WebCore::CSSPropertyParser::parseSingleValue): Parse percentage values.
     23
    1242019-10-29  Dirk Schulze  <krit@webkit.org>
    225
  • trunk/Source/WebCore/css/CSSProperties.json

    r251444 r251696  
    31453145        "opacity": {
    31463146            "codegen-properties": {
     3147                "converter": "Opacity",
    31473148                "aliases": [
    31483149                    "-webkit-opacity"
  • trunk/Source/WebCore/css/StyleBuilderConverter.h

    r251156 r251696  
    14571457    if (primitiveValue.isPercentage())
    14581458        opacity /= 100.0f;
    1459     return opacity;
     1459    return std::max(0.0f, std::min(1.0f, opacity));
    14601460}
    14611461
  • trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp

    r251668 r251696  
    40924092    case CSSPropertyFloodOpacity:
    40934093    case CSSPropertyOpacity:
     4094    {
     4095        RefPtr<CSSValue> parsedValue = consumeNumber(m_range, ValueRangeAll);
     4096        if (parsedValue)
     4097            return parsedValue;
     4098        return consumePercent(m_range, ValueRangeAll);
     4099    }
    40944100    case CSSPropertyWebkitBoxFlex:
    40954101        return consumeNumber(m_range, ValueRangeAll);
Note: See TracChangeset for help on using the changeset viewer.