Closed Bug 1601486 Opened 6 years ago Closed 6 years ago

Motion path is not correct for <g> SVG elements with transform-box:fill-box

Categories

(Core :: CSS Transitions and Animations, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: boris, Assigned: boris)

References

(Blocks 1 open bug, )

Details

Attachments

(2 files)

Attached file test case

It seems nsFrame::GetPosition() doesn't work as I expected for <g> SVG element in this case. I thought it will return the values of cx and cy in app units, so perhaps we have to use nsLayoutUtils::ComputeGeometryBox(aFrame, StyleGeometryBox::FillBox) to get the correct position of the svg element.

Summary: Motion path is not correct for circle SVG element with transform-box:fill-box → Motion path is not correct for some SVG elements with transform-box:fill-box
Summary: Motion path is not correct for some SVG elements with transform-box:fill-box → Motion path is not correct for SVG elements inside a <g> element with transform-box:fill-box
Summary: Motion path is not correct for SVG elements inside a <g> element with transform-box:fill-box → Motion path is not correct for <g> SVG elements with transform-box:fill-box

When we apply the transformation on the <g> element, its transformation also
performs on its child elements. So Motion-path should also work well in this
case.

For offset-path:path(), we have to make sure the element is on the svg path, no
matter what is its x and y values. That's why we have to calculate the
the frame position of the transformed SVG element if transform-box is fill-box.
However, for <g> element, its nsIFrame::GetPosition() is (0, 0), so we have to
calculate the geometry bbox instead, to make sure it works well on <g> or other
svg transformed elements.

Attachment #9113647 - Attachment description: Bug 1601486 - Use bbox for calculating the alignment for motion path transformation. → Bug 1601486 - Use bbox for calculating the alignment for motion path transformation on <g> element.
Attachment #9113647 - Attachment description: Bug 1601486 - Use bbox for calculating the alignment for motion path transformation on <g> element. → Bug 1601486 - Use bbox for calculating the alignment for motion path transformation on eSVGContainer elements (e.g. <g>).
Pushed by bchiou@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e4cce6206c25 Use bbox for calculating the alignment for motion path transformation on eSVGContainer elements (e.g. <g>). r=longsonr
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/20687 for changes under testing/web-platform/tests
Upstream web-platform-tests status checks passed, PR will merge once commit reaches central.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: