Closed Bug 984312 Opened 10 years ago Closed 5 years ago

SVG foreignObject stacks on top when in a group with a transform attribute

Categories

(Core :: SVG, defect)

29 Branch
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: flying-sheep, Unassigned)

References

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:27.0) Gecko/20100101 Firefox/27.0 (Beta/Release)
Build ID: 20140215011251

Steps to reproduce:

Put a <foreignObject> and another element into a transformed <g> (in that order):

test case: http://codepen.io/flying-sheep/pen/yJwoh/


Actual results:

the foreignObject is always on top.


Expected results:

the stack order should be like everywhere else: later element on top.
Status: UNCONFIRMED → NEW
Ever confirmed: true
There is the same in Windows 7.
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
thanks, changing OS to “All”.

also changing branch to 29, because i still see it.
OS: Linux → All
Hardware: x86_64 → All
Version: 27 Branch → 29 Branch
This is because in bug 640917 we added a UA rule to give the nsSVGForeignObjectFrame's anonymous child frame a transform:

https://mxr.mozilla.org/mozilla-central/source/layout/svg/svg.css?rev=fb41517a5009#50

That makes the anonymous frame a stacking context.
Blocks: 640917
how to circumvent it? reverting the change does nothing:

*|*::-moz-svg-foreign-content { transform: none !important }
That does not revert the change since author style style sheet !important rules are overridden by user-agent style sheet !important rules.

You should be able to work around this bug by putting transform="translate(0 0)" on the foreignObject, but really we should fix Mozilla so that that is not necessary.
for real, but all this is incredibly buggy everywhere, anyway.

chrome has the exact same bug for some time.

Seems to work now. I see test below in the example.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.