Open tabatkins opened 3 years ago
For a number of cases object
and embed
create a nested browsing context. They do so for SVG as well, otherwise getSVGDocument()
would not work.
That sizing is still passed around to some extent is not exactly desirable as this presents an information leak and is something we should try to remove over time.
In general both object
and embed
probably need to be deprecated. (And they also need cleanup, as per #1460 and various other issues, not all of them recorded.)
(Copied from https://github.com/w3c/csswg-drafts/issues/6469 to solicit wider review.)
Why are
object
elements doing only half of the object size negotiation? They're passing up sizing information from the embedded SVG to the OBJECT box (as you can see it respecting the SVG's aspect ratio to calculate the object's height), but the resulting SVG is laid out inside the OBJECT as if in an IFRAME rather than in an IMG element.Afaict, nothing in the HTML spec says to treat them differently than IMG... https://html.spec.whatwg.org/multipage/rendering.html
Testcase comparing img, object, iframe, inline svg; source code below: