SVGTransform API calls don't trigger mutation observer records

RESOLVED INVALID

Status

()

Core
DOM: Events
RESOLVED INVALID
2 years ago
2 years ago

People

(Reporter: benneb123, Unassigned)

Tracking

49 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Created attachment 8802994 [details]
svgMutation.html

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.59 Safari/537.36

Steps to reproduce:

1. Use a MutationObserver to observe an SVG element
2. Use the SVGTransform API to transform the element


Actual results:

The MutationObserver's callback isn't called


Expected results:

The MutationObserver's callback should be passed a MutationRecord describing the svg transformation
SMIL transforms wouldn't cause MutationObservers to fire as they don't change the DOM, but there's no SMIL in your testcase, should there be?
Flags: needinfo?(benneb123)
(Reporter)

Comment 2

2 years ago
Sorry - I meant SVGTransform API calls. They modify the transform attribute of the svg element. So I think the last javascript line in my testcase should set off the MutationObserver because it changes the transform attribute of the rect.
Flags: needinfo?(benneb123)
Summary: SVG SMIL transformations don't trigger mutation observer records → SVGTransform API calls don't trigger mutation observer records
It does seem to me that DOM Events would be the right component for this issue.
Component: Untriaged → DOM: Events
Product: Firefox → Core
(In reply to benneb123 from comment #2)
> Sorry - I meant SVGTransform API calls. They modify the transform attribute
> of the svg element. So I think the last javascript line in my testcase
> should set off the MutationObserver because it changes the transform
> attribute of the rect.
If I understand the spec correctly, the current behaviour on Firefox 49 looks right to me. That is, MutationObserver callback is called once (not twice as attachment 8802994 [details] expects). Also, when the callback is triggered, it is supplied a list of the changes to the DOM; in this case, the length of the list is two. Anne, did I misunderstand anything? Thanks!
Flags: needinfo?(annevk)

Comment 5

2 years ago
Yeah, there should only be a single callback here and I think a list of two is correct as well, although I'm not sure how well-defined the SVG specification is for its APIs and what those require exactly.

It does seem Chrome has a bug in that it changes the DOM but doesn't queue a mutation record for the transform change.
Flags: needinfo?(annevk)
Sounds like this isn't a bug in Gecko.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.