Bug 200383 - <foreignObject> doesn't establish a containing block
Summary: <foreignObject> doesn't establish a containing block
Status: RESOLVED DUPLICATE of bug 23113
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Keywords: BrowserCompat, InRadar
Depends on:
Reported: 2019-08-01 22:38 PDT by Xidorn Quan
Modified: 2019-08-02 15:31 PDT (History)
5 users (show)

See Also:

testcase (284 bytes, text/html)
2019-08-01 22:38 PDT, Xidorn Quan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xidorn Quan 2019-08-01 22:38:11 PDT
Created attachment 375397 [details]

See the attached testcase, the green box should be 200px away from the top and left edge, however it's attached to the two edges on Safari.

I'm not sure whether there is any spec about the behavior here, but I think it makes sense that <foreignObject> should establish a containing block so that absolutely-positioned element wouldn't escape out of <foreignObject>.
Comment 1 Xidorn Quan 2019-08-01 22:38:34 PDT
And it works as expected on Firefox and Chrome.
Comment 2 Radar WebKit Bug Importer 2019-08-02 13:29:46 PDT
Comment 3 Said Abou-Hallawa 2019-08-02 15:31:14 PDT
This bug happens because RenderSVGForeignObject is not a rendering root. RenderSVGForeignObject::requiresLayer() currently returns false.

*** This bug has been marked as a duplicate of bug 23113 ***