Bug 13887 - Height 100% not applied correctly inside an absolute positioned element
Summary: Height 100% not applied correctly inside an absolute positioned element
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Dave Hyatt
URL: http://nemeseri.extra.hu/safari/bug1....
Depends on:
Reported: 2007-05-26 15:41 PDT by Andras Nemeseri
Modified: 2007-05-27 11:35 PDT (History)
0 users

See Also:

testcase (2.27 KB, text/html)
2007-05-26 15:47 PDT, Andras Nemeseri
no flags Details
Patch that fixes bug. (2.66 KB, patch)
2007-05-26 21:37 PDT, Dave Hyatt
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andras Nemeseri 2007-05-26 15:41:16 PDT
1., Create a block element without height specified and "position: relative".  (element A) 

2., Insert a block element inside A and set "position: absolute" and "height: 100%". (element B)

Now B will expand it's height with A

3., insert a block element inside B and set "height: 100%". (element C)

Now the height of C should equals to A (and B)

( 4., insert other block elements with specified height into A, to see the problem. )

Height of element C will not equals to height of element A.
Works with the following browsers:
Opera 9.21, Firefox 2, Camino 1.0.4, Internet Explorer 7

Set "position: absolute" to C.

Test case available:
Comment 1 Andras Nemeseri 2007-05-26 15:47:41 PDT
Created attachment 14742 [details]
Comment 2 Dave Hyatt 2007-05-26 16:19:03 PDT
Confirmed.  Positioned elements whose height resolves to non-auto can actually serve as a "stopping point" for percentage height calculations.  This can happen when top and bottom are explicitly specified too (I think that's another bug on file).

This is pretty easy to fix.
Comment 3 Dave Hyatt 2007-05-26 16:19:25 PDT
CSS2.1 is clear that this is a bug.


Comment 4 Dave Hyatt 2007-05-26 21:37:03 PDT
Created attachment 14746 [details]
Patch that fixes bug.

Make sure to stop at positioned containing blocks that have specified heights.
Comment 5 mitz 2007-05-26 21:40:18 PDT
Comment on attachment 14746 [details]
Patch that fixes bug.

Comment 6 Dave Hyatt 2007-05-26 21:42:20 PDT
I need to address the replaced element case too.
Comment 7 Dave Hyatt 2007-05-26 22:16:29 PDT