Use ComputeSizeWithIntrinsicDimensions for iframe in nsSubDocumentFrame::ComputeSize()
Categories
(Core :: Layout, enhancement, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox81 | --- | fixed |
People
(Reporter: boris, Assigned: emilio)
References
Details
Attachments
(1 file)
I notice we are using nsIFrame::ComputeSize()
for iframe (example) in nsSubDocumentFrame::ComputeSize()
. Based on the comment in Bug 1639963, we should always call into ComputeSizeWithIntrinsicDimensions
because iframe is a replaced element and we have some assumptions for replaced element, e.g. 300x150 default intrinsic size.
Assignee | ||
Comment 1•4 years ago
|
||
Updated•4 years ago
|
Reporter | ||
Updated•4 years ago
|
Comment 3•4 years ago
|
||
bugherder |
Are you sure this is correct? My understanding is that things are specified so that iframes do not have intrinsic dimensions, and 300x150 is the size that you get when a replaced element has no intrinsic dimensions.
Assignee | ||
Comment 5•4 years ago
|
||
(In reply to David Baron :dbaron: 🏴 ⌚UTC-8 from comment #4)
Are you sure this is correct? My understanding is that things are specified so that iframes do not have intrinsic dimensions, and 300x150 is the size that you get when a replaced element has no intrinsic dimensions.
I think it is correct, yeah. Compare the rendering of:
data:text/html,<div style="border: 2px solid blue; width: min-content"><svg style="background: purple"></svg></div>
The div
is zero-width in Gecko, because the SVG has no intrinsic dimensions (though in fairness Blink and WebKit render as if the svg had intrinsic dimensions, we disagree with them here).
But in any case that's not our current behavior (both with and without this patch) with <iframes>
, see:
data:text/html,<div style="border: 2px solid blue; width: min-content"><iframe></iframe></div>
Where the <iframe>
actually behaves as if it had an intrinsic size. My patch preserves this behavior in pretty much all cases. The cases where I know this patch changes behavior, mostly related to grid item stretching special behavior for replaced elements, now match other browsers.
Assignee | ||
Comment 6•4 years ago
|
||
I guess more than "it's correct" I should say "matches our existing behavior".
Description
•