wpt / svg / painting / parsing / stroke-width-invalid.svg

Status: PASS | Duration: 75ms | Subtests: 7/7 | Open test on wpt.live | wpt.fyi

Data from commit:
a50cb89 wpt: run reference-named files which are themselves tests (#836) (2026-09-03)

SubtestStatusMessage
e.style['stroke-width'] = "auto" should not set the property valuePASS
e.style['stroke-width'] = "10px 20px" should not set the property valuePASS
e.style['stroke-width'] = "-1px" should not set the property valuePASS
e.style['stroke-width'] = "-10%" should not set the property valuePASS
e.style['stroke-width'] = "calc(2px + 3)" should not set the property valuePASS
e.style['stroke-width'] = "calc(10% + 5)" should not set the property valuePASS
e.style['stroke-width'] = "calc(40 + calc(3px + 6%))" should not set the property valuePASS

/svg/painting/parsing/stroke-width-invalid.svg

<?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://w3c.github.io/svgwg/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%");
test_invalid_value("stroke-width", "calc(2px + 3)");
test_invalid_value("stroke-width", "calc(10% + 5)");
test_invalid_value("stroke-width", "calc(40 + calc(3px + 6%))");

  ]]></script>
</svg>