css max-height percents and calc don't work on a div

RESOLVED INVALID

Status

()

Core
Layout
RESOLVED INVALID
5 years ago
4 years ago

People

(Reporter: akelman, Unassigned)

Tracking

20 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

5 years ago
Created attachment 687154 [details]
simpleheight.html

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:20.0) Gecko/20121130 Firefox/20.0
Build ID: 20121130030747

Steps to reproduce:

Tried in Firefox 17, 18b, and 20 nightly on Fedora 14 x64

div styling seems to ignore max-height directives using calc or percents. If you set a fixed pixel quantity it works.

The attached file demonstrates the problem. It works in Chrome (via the -webkit-calc).


Actual results:

Div height is unbounded.


Expected results:

Div height should be bounded to specified percentage or calc value.

Updated

5 years ago
Attachment #687154 - Attachment mime type: text/plain → text/html

Comment 1

5 years ago
because, height is not specified in the containing block(body in this case)

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')."
Component: Untriaged → Layout
Product: Firefox → Core
Indeed.  The page is in quirks mode, which is presumably why it might work in WebKit, but I don't think we want to extend the percentage height quirks to calc().
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.