Closed Bug 816679 Opened 12 years ago Closed 12 years ago

Percentage max height ignored if parent has auto height but percentage max-height and grandparent has fixed height

Categories

(Core :: Layout, defect)

16 Branch
x86_64
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: scottl-mozbugzills, Unassigned)

References

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.16 (KHTML, like Gecko) Chrome/24.0.1297.0 Safari/537.16

Steps to reproduce:

Reduced case:

http://sample.scott.to/ffbug.html


Actual results:

The img seems not to respect the size of the container if that size is derived via max-height.


Expected results:

Webkit's behavior is more inline with what I expected, but hey they seem to be the only ones that feel that way.
OS: Linux → Windows XP
Component: Untriaged → Layout
Product: Firefox → Core
That's because the spec says to do what we do...
Though it's hard to tell what behavior the testcase is expecting, exactly.  Especially given that it has no actual image...
Arghh, looks like Firefox is correctly implementing a lousy spec.  

http://www.w3.org/TR/CSS21/visudet.html#min-max-heights

"percentage
Specifies a percentage for determining the used value. The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height')."


I suppose I'll go and file a bug with the google and see if that goes anywhere.

This is quite disappointing.  As a web developer, I expect max-height to more or less the same as does "height", but in this case per the spec -- it just does nothing.
(In reply to Boris Zbarsky (:bz) from comment #2)
> Though it's hard to tell what behavior the testcase is expecting, exactly. 
> Especially given that it has no actual image...

Is the image I attached not suitable?

https://bugzilla.mozilla.org/attachment.cgi?id=686750

I was expecting the webkit behavior, but I gather that while it is more logical it is not to the standard.
Ah, I missed that.  Yeah, that's just what the spec says.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Summary: IMG with max-height does not respect a parent with max-height → Percentage max height ignored if parent has auto height but percentage max-height and grandparent has fixed height
(In reply to Scott Lindsey from comment #3)
> This is quite disappointing.  As a web developer, I expect max-height to
> more or less the same as does "height", but in this case per the spec -- it
> just does nothing.

How is max-height different from height here?
Ahh, your right.  Neither height nor max-height (by percentage) on the image have any effect if the parent element has a height that was generated automatically.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: