The specs: https://svgwg.org/svg2-draft/painting.html#FillOpacityProperty https://svgwg.org/svg2-draft/painting.html#StrokeOpacity https://svgwg.org/svg2-draft/pservers.html#StopOpacityProperty https://drafts.fxtf.org/filter-effects/#propdef-flood-opacity https://drafts.csswg.org/css-color-4/#typedef-alpha-value show that the opacity can be either a number or a percentage which should be clamped to the range [0..1]. Currently we only support the number format and we do not support the percentage. See the attached test case.
Created attachment 378665 [details] fill-opacity-percentage
This affects these WPT tests: https://wpt.fyi/results/svg/pservers/parsing/stop-opacity-valid.svg?label=master&label=experimental&aligned https://wpt.fyi/results/svg/pservers/parsing/stop-opacity-computed.svg?label=experimental&label=master&aligned https://wpt.fyi/results/svg/painting/parsing/stroke-opacity-computed.svg?label=master&label=experimental&aligned https://wpt.fyi/results/svg/painting/parsing/fill-opacity-computed.svg?label=master&label=experimental&aligned https://wpt.fyi/results/svg/painting/parsing/stroke-opacity-valid.svg?label=master&label=experimental&aligned https://wpt.fyi/results/svg/painting/parsing/fill-opacity-valid.svg?label=master&label=experimental&aligned
This is an issue with the normal opacity property as well. All take the same values now.
Created attachment 382098 [details] Patch
Comment on attachment 382098 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=382098&action=review > Source/WebCore/ChangeLog:16 > + 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 These should be WPT, if there isn't already WPT coverage. > LayoutTests/fast/css/parsing-opacity.html:62 > +testInner("opacity", "0", "0"); > +testInner("opacity", "0.5", "0.5"); > +testInner("opacity", "1", "1"); > +testInner("opacity", "1000", "1000"); > +testInner("opacity", "-400", "-400"); > +testInner("opacity", "20%", "20%"); > +testInner("opacity", "-600%", "-600%"); > +testInner("opacity", "700%", "700%"); > +testComputed("opacity", "0", "0"); > +testComputed("opacity", "0.5", "0.5"); > +testComputed("opacity", "1", "1"); > +testComputed("opacity", "1000", "1"); > +testComputed("opacity", "-400", "0"); > +testComputed("opacity", "25%", "0.25"); > +testComputed("opacity", "-600%", "0"); > +testComputed("opacity", "700%", "1"); > +negativeTest("opacity", "2px"); > +negativeTest("opacity", "auto"); > +negativeTest("opacity", "none"); > +negativeTest("opacity", "'str'"); How about 100.2% and 2.5E2 values and %?
Comment on attachment 382098 [details] Patch Attachment 382098 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/13185980 New failing tests: svg/W3C-SVG-1.1/painting-fill-05-b.svg svg/css/parse-calc-length.html svg/custom/invalid-css.svg
Created attachment 382115 [details] Archive of layout-test-results from ews210 for win-future The attached test failures were seen while running run-webkit-tests on the win-ews. Bot: ews210 Port: win-future Platform: CYGWIN_NT-10.0-17763-3.0.5-338.x86_64-x86_64-64bit
Created attachment 382163 [details] Patch
There are indeed WPT tests. However, Bug 203503 prevents them from running currently. No need to duplicate the tests in WPT. Added suggested additional tests.
Comment on attachment 382163 [details] Patch Clearing flags on attachment: 382163 Committed r251696: <https://trac.webkit.org/changeset/251696>
All reviewed patches have been landed. Closing bug.
<rdar://problem/56702114>