Closed Bug 965030 Opened 7 years ago Closed 7 years ago

position:fixed within an SVG transform gets translated twice

Categories

(Core :: Layout, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla29

People

(Reporter: mattwoodrow, Unassigned)

References

Details

Attachments

(1 file)

layout/reftests/svg/foreignObject-fixedpos-01.html has a position:fixed html frame within a SVG transformed frame (the Block(foreignObject) frame is transformed). When creating the display list for this, we choose the viewport frame as the reference frame for the inner content, rather than the transformed frame. This causes the offset from the transformed frame to the viewport to be applied twice, and the content appears in the wrong spot.

For finding the reference frame for a display item, we walk up the frame tree until we find a transformed ancestor, or the viewport.

Normally, when we have a position:fixed element within a transformed one, the frame is attached as part of the FixedList of the transformed frame, rather than the viewport frame. See https://pastebin.mozilla.org/4123620

But for this SVG example, the inner frame is attached to the viewport, so the transformed frame isn't one of our ancestors. See https://pastebin.mozilla.org/4123604

I'm not sure if this posiiton in the frame tree is expected or not.

We either need to fix that, or update the reference frame searching code to take this into account.

If it's the latter, could we find the placeholder frame for a positioned frame, and then walk upwards from there?
The transformed frame should be the containing block.
Seems to work and not break anything :)
Attachment #8367141 - Flags: review?(roc)
https://hg.mozilla.org/mozilla-central/rev/84206c337126
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
You need to log in before you can comment on or make changes to this bug.