Bug 18714 - Sub-elements do not expand when parent elements do if min-width/height is applied to parent
Summary: Sub-elements do not expand when parent elements do if min-width/height is app...
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-24 08:10 PDT by Scott Park
Modified: 2023-03-17 18:39 PDT (History)
5 users (show)

See Also:


Attachments
Test-case (601 bytes, text/html)
2008-04-24 08:13 PDT, Scott Park
no flags Details
Correct test case (600 bytes, text/html)
2008-04-24 08:27 PDT, Scott Park
no flags Details
Testcase for min-height with html and body (372 bytes, text/html)
2012-01-23 13:50 PST, Silas Brill
no flags Details
Testcase for min-height and min-width with other elements (447 bytes, text/html)
2012-01-23 13:56 PST, Silas Brill
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Scott Park 2008-04-24 08:10:16 PDT
Sub-elements set to 100% width and height do not properly resize with parents if the parent element has min-width/height applied via CSS. Removal of the min-width/height specification returns resizing to normal.

This situation does not occur in Firefox 2.0.0.14 or in IE 7. This occurs in Safari 3.1.1 (10.5, Win XP) and Webkit nightly r32416 (10.5).

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
        "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8">
	<title>Untitled</title>
	<meta name="generator" content="BBEdit 8.7">
	<style type="text/css">
<!--
	html,
	body,
	div#test1,
	div#test2 {
		width: 100%;
		height: 100%;
	}
	
	div#test1,
	div#test2 {
		border: 1px black solid;
	}
	
	div#test1 {
		min-height: 1000px;
		min-width: 1000px;
	}
-->
</style>
</head>
<body>
	<div id="test1">
		<div id="test2">
			<p>Content</p>
		</div>
	</div>
</body>
</html>
Comment 1 Scott Park 2008-04-24 08:13:39 PDT
Created attachment 20792 [details]
Test-case

This is a test-case for the bug. Start the window out small, load, then increase its size. Sub-element will not increase.
Comment 2 Scott Park 2008-04-24 08:27:31 PDT
Created attachment 20793 [details]
Correct test case

The previous test case had a typo. It removed the min-x attribute making it work. This attachment should demonstrate the problem.
Comment 3 Silas Brill 2012-01-23 13:50:07 PST
Created attachment 123614 [details]
Testcase for min-height with html and body

I recently ran into this problem when adding size styles to html and body.  The min-width problem (but not the min-height problem) seems to have been fixed since this bug was posted, and the behavior is different depending on whether the elements being styled are html and body.  This attachment demonstrates the problem for html and body.  Firefox handles this situation correctly.
Comment 4 Silas Brill 2012-01-23 13:56:15 PST
Created attachment 123616 [details]
Testcase for min-height and min-width with other elements

Here's a testcase for min-height and min-width using divs instead of html and body.  The min-width behavior appears to be completely correct.  The min-height behavior matches Firefox in this case, but it still appears the be wrong (the element with class="body" should expand to fill the element with class="html", but appears to be sizing to enclose its child element instead, for some reason).  IE9 has the same behavior as Firefox for both of these testcases.
Comment 5 Silas Brill 2012-01-23 14:03:54 PST
I just realized that I'm not having the same problem that this bug was about, although it's triggered under approximately the same conditions.  I'll file a separate bug.
Comment 6 Ahmad Saleem 2023-03-17 18:39:01 PDT
All browsers (WebKit ToT [261814@main], Chrome Canary 113 and Firefox Nightly 113) match each other.

Marking this as “RESOLVED WONTFIX” because this bug was never confirmed.