Bug 1508014 [wpt PR 14105] - Fix parsing of negative values for 'r', 'rx', 'ry' and 'stroke-width', a=testonly
authorFredrik Söderquist <fs@opera.com>
Mon, 19 Nov 2018 18:46:40 +0000
changeset 504010 fd69b29dc52dcc0f5d931147c7b36e3cc74a16bc
parent 504009 96d50253f05de325a26b4dea7f24b44a1d9ce1dc
child 504011 60b55f9c6aed47b143ee8b7578020beda7abe2d9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1508014, 14105, 902346, 1304561, 609077
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508014 [wpt PR 14105] - Fix parsing of negative values for 'r', 'rx', 'ry' and 'stroke-width', a=testonly Automatic update from web-platform-testsFix parsing of negative values for 'r', 'rx', 'ry' and 'stroke-width' For all of these properties[1][2][3][4], a negative value is considered illegal and should fail in the parser. (The value range is already corectly specified for instance for animation, and also for the corresponing presentation attributes.) [1] https://svgwg.org/svg2-draft/geometry.html#R [2] https://svgwg.org/svg2-draft/geometry.html#RX [3] https://svgwg.org/svg2-draft/geometry.html#RY [4] https://svgwg.org/svg2-draft/painting.html#StrokeWidthProperty Bug: 902346 Change-Id: I4b073288b97151d7a9df4b1c2ce99341dca9c8ee Reviewed-on: https://chromium-review.googlesource.com/c/1304561 Commit-Queue: Eric Willigers <ericwilligers@chromium.org> Reviewed-by: Eric Willigers <ericwilligers@chromium.org> Cr-Commit-Position: refs/heads/master@{#609077} -- wpt-commits: 744325921ba52791bc8db1b45d2aed097577753a wpt-pr: 14105
testing/web-platform/tests/svg/painting/parsing/stroke-width-invalid.svg
testing/web-platform/tests/svg/painting/parsing/stroke-width-valid.svg
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/painting/parsing/stroke-width-invalid.svg
@@ -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="600px">
+  <title>SVG Painting: parsing stroke-width with invalid values</title>
+  <metadata>
+    <h:link rel="help" href="https://svgwg.org/svg2-draft/painting.html#StrokeWidth"/>
+    <h:meta name="assert" content="stroke-width 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("stroke-width", "auto");
+test_invalid_value("stroke-width", "10px 20px");
+test_invalid_value("stroke-width", "-1px");
+test_invalid_value("stroke-width", "-10%");
+
+  ]]></script>
+</svg>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/svg/painting/parsing/stroke-width-valid.svg
@@ -0,0 +1,24 @@
+<?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="600px">
+  <title>SVG Painting: parsing stroke-width with valid values</title>
+  <metadata>
+    <h:link rel="help" href="https://svgwg.org/svg2-draft/painting.html#StrokeWidth"/>
+    <h:meta name="assert" content="stroke-width supports the full grammar '&lt;length-percentage&gt;' and unitless."/>
+  </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_valid_value("stroke-width", "0");
+test_valid_value("stroke-width", "10");
+test_valid_value("stroke-width", "1px");
+test_valid_value("stroke-width", "calc(2em + 3ex)");
+test_valid_value("stroke-width", "4%");
+test_valid_value("stroke-width", "5vmin");
+
+  ]]></script>
+</svg>