Closed Bug 1541021 Opened 5 years ago Closed 5 years ago

getBoundingClientRect() doesn't count css transform on SVG element

Categories

(Core :: SVG, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: violet.bugreport, Assigned: violet.bugreport)

References

Details

Attachments

(2 files, 1 obsolete file)

Attached file testcase.html

When an SVG element is applied CSS transform, its getBoundingClientRect() should reflect the CSS transform instead of returning the original value.

Assignee: nobody → violet.bugreport
Status: NEW → ASSIGNED
Priority: -- → P3

We should use nsLayoutUtils::GetTransformToAncestor instead of
nsSVGUtils::GetUserToCanvasTM to get the transform matrix. Because the former
will also take CSS transform into account while the later won't.

Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/253e90f0ccf3
Should take CSS transform into account when calculating getBoundingClientRect() r=longsonr

Does this mean that nsSVGUtils::GetUserToCanvasTM is now dead code?

Flags: needinfo?(violet.bugreport)

Yes. And it won't have future use any more, since it fails to include CSS transform. We should probably just remove it.

Flags: needinfo?(violet.bugreport)
Pushed by violet.bugreport@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/28eb58dd6af8
Should take CSS transform into account when calculating getBoundingClientRect() r=longsonr
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Flags: needinfo?(violet.bugreport)
Attachment #9056832 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: