SVG 1.1 and 2 forbid negative radii A negative value is an error (see Error processing). https://www.w3.org/TR/SVG11/shapes.html#CircleElement A negative value for r must be treated as an illegal value. A negative value for rx must be treated as an illegal value. A negative value for ry must be treated as an illegal value. https://svgwg.org/svg2-draft/geometry.html#R Proposed WPT https://github.com/web-platform-tests/wpt/pull/13951
Noticed this when adding the use-counter for "<number>". Seemed that 'stroke-width' also had this bug. Have done a fix, but no tests yet, so I guess I'll wait for the tests to land =).
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/170ac20d0904509870bcc9e43b3e9cdca58b751d commit 170ac20d0904509870bcc9e43b3e9cdca58b751d Author: Fredrik Söderquist <fs@opera.com> Date: Sat Nov 17 02:30:16 2018 Fix 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} [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/WebKit/LayoutTests/external/wpt/svg/geometry/parsing/r-invalid-expected.txt [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/WebKit/LayoutTests/external/wpt/svg/geometry/parsing/rx-invalid-expected.txt [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/WebKit/LayoutTests/external/wpt/svg/geometry/parsing/ry-invalid-expected.txt [add] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/WebKit/LayoutTests/external/wpt/svg/painting/parsing/stroke-width-invalid.svg [add] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/WebKit/LayoutTests/external/wpt/svg/painting/parsing/stroke-width-valid.svg [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/parser/css_property_parser_helpers.h [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/cx_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/cy_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/r_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/rx_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/ry_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/stroke_width_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/x_custom.cc [modify] https://crrev.com/170ac20d0904509870bcc9e43b3e9cdca58b751d/third_party/blink/renderer/core/css/properties/longhands/y_custom.cc
Comment 1 by ericwilligers@chromium.org
, Nov 6