Bug 1508014 [wpt PR 14105] - Fix parsing of negative values for 'r', 'rx', 'ry' and 'stroke-width', a=testonly
☠☠ backed out by 46ad93280b06 ☠ ☠
authorFredrik Söderquist <fs@opera.com>
Mon, 19 Nov 2018 18:46:40 +0000
changeset 503755 f380f6a8f5c0f0dff12df5aa4214040aed998067
parent 503754 d94695f279159a02b853a95ab4ea2f10a9e65d81
child 503756 b4d49ed8873e9a4458c50da96e76fe62f067d4da
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>