LibWeb/SVG: Disallow negative values for SVG radius properties
Some checks are pending
CI / Linux, x86_64, Sanitizer_CI, GNU (push) Waiting to run
CI / macOS, arm64, Sanitizer_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers_CI, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer_CI, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run

This commit is contained in:
Tim Ledbetter 2025-06-27 21:05:40 +01:00 committed by Jelle Raaijmakers
commit 0c8a90166f
Notes: github-actions[bot] 2025-06-27 20:17:52 +00:00
7 changed files with 101 additions and 6 deletions

View file

@ -2677,8 +2677,8 @@
"inherited": false, "inherited": false,
"initial": "0", "initial": "0",
"valid-types": [ "valid-types": [
"length [-∞,∞]", "length [0,∞]",
"percentage [-∞,∞]" "percentage [0,∞]"
], ],
"percentages-resolve-to": "length", "percentages-resolve-to": "length",
"quirks": [ "quirks": [
@ -2727,8 +2727,8 @@
"inherited": false, "inherited": false,
"initial": "auto", "initial": "auto",
"valid-types": [ "valid-types": [
"length [-∞,∞]", "length [0,∞]",
"percentage [-∞,∞]" "percentage [0,∞]"
], ],
"valid-identifiers": [ "valid-identifiers": [
"auto" "auto"
@ -2744,8 +2744,8 @@
"inherited": false, "inherited": false,
"initial": "auto", "initial": "auto",
"valid-types": [ "valid-types": [
"length [-∞,∞]", "length [0,∞]",
"percentage [-∞,∞]" "percentage [0,∞]"
], ],
"valid-identifiers": [ "valid-identifiers": [
"auto" "auto"

View file

@ -0,0 +1,10 @@
Harness status: OK
Found 5 tests
5 Pass
Pass e.style['r'] = "10" should not set the property value
Pass e.style['r'] = "auto" should not set the property value
Pass e.style['r'] = "10px 20px" should not set the property value
Pass e.style['r'] = "-1px" should not set the property value
Pass e.style['r'] = "-10%" should not set the property value

View file

@ -0,0 +1,9 @@
Harness status: OK
Found 4 tests
4 Pass
Pass e.style['rx'] = "10" should not set the property value
Pass e.style['rx'] = "none" should not set the property value
Pass e.style['rx'] = "10px 20px" should not set the property value
Pass e.style['rx'] = "-1px" should not set the property value

View file

@ -0,0 +1,9 @@
Harness status: OK
Found 4 tests
4 Pass
Pass e.style['ry'] = "10" should not set the property value
Pass e.style['ry'] = "none" should not set the property value
Pass e.style['ry'] = "10px 20px" should not set the property value
Pass e.style['ry'] = "-1px" should not set the property value

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="8000px">
<title>SVG Geometry Properties: parsing r with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/geometry.html#R"/>
<h:meta name="assert" content="r supports only the grammar '&lt;length-percentage&gt;'."/>
</metadata>
<g id="target"></g>
<h:script src="../../../resources/testharness.js"/>
<h:script src="../../../resources/testharnessreport.js"/>
<h:script src="../../../css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("r", "10");
test_invalid_value("r", "auto");
test_invalid_value("r", "10px 20px");
test_invalid_value("r", "-1px");
test_invalid_value("r", "-10%");
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 841 B

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="8000px">
<title>SVG Geometry Properties: parsing rx with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/geometry.html#RX"/>
<h:meta name="assert" content="rx supports only the grammar '&lt;length-percentage&gt; | auto'."/>
</metadata>
<g id="target"></g>
<h:script src="../../../resources/testharness.js"/>
<h:script src="../../../resources/testharnessreport.js"/>
<h:script src="../../../css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("rx", "10");
test_invalid_value("rx", "none");
test_invalid_value("rx", "10px 20px");
test_invalid_value("rx", "-1px");
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 822 B

View file

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:h="http://www.w3.org/1999/xhtml"
width="800px" height="8000px">
<title>SVG Geometry Properties: parsing ry with invalid values</title>
<metadata>
<h:link rel="help" href="https://svgwg.org/svg2-draft/geometry.html#RY"/>
<h:meta name="assert" content="ry supports only the grammar '&lt;length-percentage&gt; | auto'."/>
</metadata>
<g id="target"></g>
<h:script src="../../../resources/testharness.js"/>
<h:script src="../../../resources/testharnessreport.js"/>
<h:script src="../../../css/support/parsing-testcommon.js"/>
<script><![CDATA[
test_invalid_value("ry", "10");
test_invalid_value("ry", "none");
test_invalid_value("ry", "10px 20px");
test_invalid_value("ry", "-1px");
]]></script>
</svg>

After

Width:  |  Height:  |  Size: 822 B