Bug 267560
Summary: | [SVG] baseVal value of circle r attribute returns 0 and a console error while still drawing | ||
---|---|---|---|
Product: | WebKit | Reporter: | Karl Dubost <karlcow> |
Component: | SVG | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | ahmad.saleem792, sabouhallawa, webkit-bug-importer, zimmermann |
Priority: | P2 | Keywords: | BrowserCompat, InRadar |
Version: | Safari 17 | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: |
https://bugs.webkit.org/show_bug.cgi?id=192507 https://bugs.webkit.org/show_bug.cgi?id=84966 |
||
Bug Depends on: | |||
Bug Blocks: | 261656 |
Karl Dubost
Steps to reproduce
1. Copy in Safari URL bar this: data:text/html,<!doctype html><svg><circle r="100 "/></svg>
(Notice the space at the end of the r attribute: "100 ".)
3. In the Web Inspector console, type:
document.querySelector('circle').r.baseVal.value
Results:
* Web Inspector Console displays:
Error: Invalid value for <circle> attribute r="100 "
* document.querySelector('circle').r.baseVal.value returns 0
* document.querySelector('circle').r.animVal.value returns 0
* document.querySelector('circle').getAttribute('r') returns "100 "
While Firefox and Chrome
* No error message in the console
* document.querySelector('circle').r.baseVal.value returns 100
* document.querySelector('circle').r.animVal.value returns 100
* document.querySelector('circle').getAttribute('r') returns "100 "
Error message in WebKit is coming from
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGElement.cpp#150-169
which has been called by length.setValueAsString(valueAsString).hasException()
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGLengthValue.cpp#192-202
called by SVGLengthValue::setValueAsString(StringView string)
https://searchfox.org/wubkat/rev/581e116dc6ce254811dbe2da9d1c1168762fc30c/Source/WebCore/svg/SVGLengthValue.cpp#324-342
There is a
auto convertedNumber = parseNumber(buffer, SuffixSkippingPolicy::DontSkip);
which seems not able to ignore spaces.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/121020904>
Karl Dubost
Probably related to Bug 192507
Ahmad Saleem
(In reply to Karl Dubost from comment #2)
> Probably related to Bug 192507
Should we tackle following bug 261656 case by case and see how many these issue get fixed?
Karl Dubost
Oh I had forgotten about this. <3
Feel free to go ahead if you have a solution for one thing or all things.