when the width of a child of an inline-block is a percentage, the inline-block's width remains as though the child had no specified width

RESOLVED INVALID

Status

()

RESOLVED INVALID
10 years ago
10 years ago

People

(Reporter: boneslug, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1) Gecko/2008072306 Shiretoko/3.1a1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a1) Gecko/2008072306 Shiretoko/3.1a1

example given

Reproducible: Always

Steps to Reproduce:
<html>

<head><style>
div { display:inline-block; border:medium solid orange; }
div > div { border:thin dashed orange; max-width:50%; }
body > div:first-child > div { max-width:25em; }
</style></head>

<body>

<div>
<div><h1>this example text has a max width of 25em</h1></div>
<div><h2>Lorem ipsus</h2></div>
</div>

<div>
<div><h1>this example text has a max width of 50%</h1></div>
<div><h2>Lorem ipsus</h2></div>
</div>

</body></html>


Expected Results:  
seems incorrect to me...would not the expected behaviour be for the inline-block's width to conform to that of its children, regardless of how one limits the width of the children?

Comment 1

10 years ago
In case of the %-tage width/max-width/min-width, the resulting layout is undefined, per CSS 2.1:10.2
http://www.w3.org/TR/CSS21/visudet.html#propdef-width
(and 10.4 further down the page for min/max-width)

This would make this bug invalid.

WebKit behaves the same as Gecko.
Component: General → Layout: Block and Inline
OS: Linux → All
Product: Firefox → Core
QA Contact: general → layout.block-and-inline
Hardware: PC → All

Comment 2

10 years ago
Created attachment 332081 [details]
test case from reporter

Comment 3

10 years ago
INVALID per comment 1
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.