Closed Bug 181875 Opened 23 years ago Closed 22 years ago

[FIX]max-width/height ignored for unconstrained IFRAME/EMBED/OBJECT

Categories

(Core :: CSS Parsing and Computation, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.4beta

People

(Reporter: pc-mozilla2, Assigned: bzbarsky)

Details

Attachments

(3 files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021108 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2b) Gecko/20021108 It seems that the CSS 2 style attributed min/max-height/width are ignored for iframe tags. If I do something like <IMG SRC=... style="max-width: 100"> for some large image, it will be scaled down to 100 pixels wide. If I do something like <IFRAME SRC=... style="max-height: 50"> then I see a larger box. I'm doing this with the SRC pointing to an empty file, though that shouldn't matter. Note that bug 10497 references similar problems fixed 3 years ago with the IMG tag. Reproducible: Always Steps to Reproduce: 1. Create an HTML file with an IFRAME pointing to an empty source file 2. Set a max-height style attribute to 50. 3. Observe the box when the page is rendered Actual Results: I see a box that appears to be 300x150. Expected Results: The box should be 300x50 pixels.
It seems that this is also not implemented for the EMBED tag.
Corrected component
Component: Layout: HTML Frames → Style System
I tried to reassign this to the owner/QA for the selected component, since I corrected the component, but it won't let me, as that would change the status from UNCOMFIRMED to NEW. Could someone with the correct authority please do so?
QA Contact: amar → ian
reassign
Assignee: frame → dbaron
Preston Crow: Please see the attached test case. It appears to me that the max-height is correctly limiting the IFRAME height. I'm not sure if this observation pertains, but: unlike IMG, IFRAME does not have an intrinsic width/height. If you agree that this styling works, please close the bug off.
No response from Preston, testcase works, so....
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
I'm attaching another example that demonstrates my understanding of how it should work. The IMG tag example works, the others don't look right to me (using 2003021905 nightly build; I'll upgrade and see if that helps).
I just switched to build 2003041508, and the OBJECT example in my test case now produces the right output (just like the IMG tag now). The EMBED and IFRAME still seem to be ignoring the max-height/width.
Status: RESOLVED → UNCONFIRMED
Resolution: WORKSFORME → ---
Attached patch FixSplinter Review
Preston, thanks for the updated testcase. The problem is only apparent when the computed width/height is unconstrained, which was not the case in Mike's testcase.... In any case, this patch fixes it.
Taking.
Assignee: dbaron → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P1
Summary: max-width/height ignored for IFRAME → [FIX]max-width/height ignored for unconstrained IFRAME/EMBED/OBJECT
Target Milestone: --- → mozilla1.4beta
Comment on attachment 120595 [details] [diff] [review] Fix roc, would you do the honors? I'm starting to think we need a better mechanism for doing this unconstrained stuff... it's too easy to make mistakes.
Attachment #120595 - Flags: superreview?(roc+moz)
Attachment #120595 - Flags: review?(roc+moz)
Attachment #120595 - Flags: superreview?(roc+moz)
Attachment #120595 - Flags: superreview+
Attachment #120595 - Flags: review?(roc+moz)
Attachment #120595 - Flags: review+
Fixed.
Status: NEW → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
In case anyone else is following this, I just switched to the latest nightly build (2003041609), and my test case now looks exactly like I would expect it to. Thanks!
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: