Bug 18714 - Sub-elements do not expand when parent elements do if min-width/height is applied to parent
: Sub-elements do not expand when parent elements do if min-width/height is app...
Status: UNCONFIRMED
: WebKit
Layout and Rendering
: 528+ (Nightly build)
: All Mac OS X 10.5
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-04-24 08:10 PST by
Modified: 2012-01-23 14:03 PST (History)


Attachments
Test-case (601 bytes, text/html)
2008-04-24 08:13 PST, Scott Park
no flags Details
Correct test case (600 bytes, text/html)
2008-04-24 08:27 PST, 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 From 2008-04-24 08:10:16 PST
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 From 2008-04-24 08:13:39 PST -------
Created an attachment (id=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 From 2008-04-24 08:27:31 PST -------
Created an attachment (id=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 From 2012-01-23 13:50:07 PST -------
Created an attachment (id=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 From 2012-01-23 13:56:15 PST -------
Created an attachment (id=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 From 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.