Closed Bug 23014 Opened 26 years ago Closed 25 years ago

percentage <iframe>s don't resize when window resizes

Categories

(Core :: Layout: Images, Video, and HTML Frames, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: karnaze, Assigned: pollmann)

References

Details

(Whiteboard: fix in hand)

Attachments

(1 file)

<iframe style="width:50%; height:300px" src=foo.html> doesn't resize properly in all cases when the window resizes. It only seems to work when the window is made smaller than the current width of the iframe. Eric, you should follow the behavior of percentage <div>s rather than <table>s because <table>s have a lot of legacy quirks. For example in the test case above, if I had specified a 50% height, the <iframe> should not be 50% the height of the viewport as is the case with tables.
Priority: P3 → P1
At least in M12, using HEIGHT=100%, WIDTH=100% the <IFRAME> doesn't size properly at first (too small for the rendered window) then it only resizes if you shrink the main window dimentions. Personal rant: Far too many next gen sites and product UI's depend on this (not to mention the one's we're building). Since <LAYER> is dead, let's shoot for getting IFRAME behavior as close to correct as possible in the first release out the door. Requesting a bump in priority.
Priority: P1 → P3
Backing status to P3 (you fellas own the priority, my apologies). Putting my votes behind this one.
Not sure if it's a duplicate, but this is extreemly similar to <a href="http://bugzilla.mozilla.org/show_bug.cgi?id=25453">bug #25453</a>
Chris, can you help me out a bit understanding this one? Since 50% height is not supposed to be 50% of the viewport, what should it be relative to? Thanks! Karnaze wrote: > For example in the test case above, if I had specified a 50% height, the > <iframe> should not be 50% the height of the viewport as is the case with On the upside, I got % width working in my tree, and resizing the window will resize the iframe dynamically as it should, so I think I'm getting close on this one.
Status: NEW → ASSIGNED
*** Bug 25453 has been marked as a duplicate of this bug. ***
I have a fix that I think does the right thing based on Chris Karnaze's comments above, will aim for M16.
Whiteboard: Fix in hand
Target Milestone: --- → M16
*** Bug 35972 has been marked as a duplicate of this bug. ***
After some help from Chris yesterday, I'm going to be making a few changes to my fix that will correct more cases than just percentage height and width. Specifically, we have problems if the height or width is unspecified, or if the iframe is in a table. I'll try to get something sane to happen in all cases before checking this in.
Whiteboard: Fix in hand
I have fixes for all cases except iframe percentage height. It is unclear how this should / could be handled. In every case where I specify a percentage height on an iframe (including when that iframe is inside a fixed height table), the reflow method gets an computed height and available height of NS_UNCONSTRAINED. As such, we're currently treating it exactly like the height wasn't specified and giving the iframe a height of 150. Consider this case: <table border height=600> <tr> <td> <iframe height=50% src=about:blank></iframe> </td> </tr> </table> The page designer might expect an iframe of height 300. However, since the iframe doesn't know that the table is going to be 600 pixels high (gets NS_UNCONSTRAINED for computed and available height), we just make it 150 pixels high. Even worse, what if the table had a height specified of 40 pixels! Then the iframe being 150 forces the table to a height of 150. Not sure what to do here.
OS: Windows NT → All
Hardware: PC → All
Chris, your suggested change to ReflowState worked! :) (making iframes caculate percentage height like tables in quirks mode) I'll run through all the test cases and pre-checkins.
Whiteboard: fix in hand
Percent width fixes checked in. I have percent height fixes in my tree, which need to be reviewed. I'll attach them shortly (and send them your way Chris) :)
Percent height fixes checked in. Chris, this was the one-liner you suggested when you were up here and I had Harish look at it. I also checked in a fix for CalcQuirksModeHeight for native scrollbars, and added one sanity check. Will attach testcase shortly.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Attached file reduced test case
Fixed in the July 6th build.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
Component: Layout: HTML Frames → Layout: Images
Product: Core Graveyard → Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: