Closed Bug 2089479 Opened 9 days ago Closed 9 days ago

SVG attributes added through DOM setters are reported to attribute observers as modifications

Categories

(Core :: SVG, defect)

defect

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr153 --- wontfix
firefox159 --- wontfix
firefox160 --- wontfix
firefox161 --- wontfix
firefox162 --- fixed

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).

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.

Assignee: nobody → sledru
Status: NEW → ASSIGNED

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...

Status: ASSIGNED → RESOLVED
Closed: 9 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: