[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.
Canonical link: https://commits.webkit.org/216922@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-29 10:27:35 +00:00
|
|
|
Test parsing and computed style of stop-opacity
|
|
|
|
|
|
|
|
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
|
|
|
|
|
|
|
|
|
|
|
|
PASS innerStyle("stop-opacity", "0") is "0"
|
|
|
|
PASS innerStyle("stop-opacity", "0.5") is "0.5"
|
|
|
|
PASS innerStyle("stop-opacity", "1") is "1"
|
|
|
|
PASS innerStyle("stop-opacity", "1000") is "1000"
|
|
|
|
PASS innerStyle("stop-opacity", "-400") is "-400"
|
2019-10-31 02:16:27 +00:00
|
|
|
PASS innerStyle("stop-opacity", "20%") is "0.2"
|
|
|
|
PASS innerStyle("stop-opacity", "-600%") is "-6"
|
|
|
|
PASS innerStyle("stop-opacity", "700%") is "7"
|
[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.
Canonical link: https://commits.webkit.org/216922@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-29 10:27:35 +00:00
|
|
|
PASS innerStyle("stop-opacity", "2.5e-1") is "0.25"
|
2019-10-31 02:16:27 +00:00
|
|
|
PASS innerStyle("stop-opacity", "2.5e1%") is "0.25"
|
|
|
|
PASS innerStyle("stop-opacity", "100.25%") is "1.0025"
|
[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.
Canonical link: https://commits.webkit.org/216922@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@251696 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2019-10-29 10:27:35 +00:00
|
|
|
PASS computedStyle("stop-opacity", "0") is "0"
|
|
|
|
PASS computedStyle("stop-opacity", "0.5") is "0.5"
|
|
|
|
PASS computedStyle("stop-opacity", "1") is "1"
|
|
|
|
PASS computedStyle("stop-opacity", "1000") is "1"
|
|
|
|
PASS computedStyle("stop-opacity", "-400") is "0"
|
|
|
|
PASS computedStyle("stop-opacity", "25%") is "0.25"
|
|
|
|
PASS computedStyle("stop-opacity", "-600%") is "0"
|
|
|
|
PASS computedStyle("stop-opacity", "700%") is "1"
|
|
|
|
PASS computedStyle("stop-opacity", "2.5e-1") is "0.25"
|
|
|
|
PASS computedStyle("stop-opacity", "2.5e1%") is "0.25"
|
|
|
|
PASS computedStyle("stop-opacity", "100.25%") is "1"
|
|
|
|
PASS innerStyle("stop-opacity", "2px") is ""
|
|
|
|
PASS innerStyle("stop-opacity", "auto") is ""
|
|
|
|
PASS innerStyle("stop-opacity", "none") is ""
|
|
|
|
PASS innerStyle("stop-opacity", "'str'") is ""
|
|
|
|
PASS successfullyParsed is true
|
|
|
|
|
|
|
|
TEST COMPLETE
|
|
|
|
|