SVG attributes added through DOM setters are reported to attribute observers as modifications
Categories
(Core :: SVG, defect)
Tracking
()
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression)
Attachments
(1 external file)
SVGElement::DidChangeValue computes the modification type with aName ? AttrModType::Modification : AttrModType::Addition. aName is never null, so it always reports Modification, including when an SVG DOM setter (for example rect.x.baseVal.value = 5 on a <rect> without an x attribute) adds the attribute. WillChangeValue still reports Addition for the same change, so observers see a mismatched pair.
Before bug 769207 part 3 the test was HasAttr(aName). Restoring that check fixes it.
The value reaches nsIMutationObserver::AttributeChanged consumers (for example accessibility). I found no web-visible consequence for SVG elements.
Found by Coverity Scan (CID 1696585, reported as a dereference-before-null-check).
| Assignee | ||
Comment 1•9 days ago
|
||
Bug 769207 part 3 replaced HasAttr(aName) with aName, which is never
null, so DidChangeValue always reported Modification while
WillChangeValue reported Addition for the same change.
Updated•9 days ago
|
Comment 2•9 days ago
|
||
Set release status flags based on info from the regressing bug 769207
Oh, sorry for the bug. Although I don't remember why I removed the check...
Updated•9 days ago
|
Comment 4•9 days ago
|
||
| bugherder | ||
Description
•