Bug 13887

Summary: Height 100% not applied correctly inside an absolute positioned element
Product: WebKit Reporter: Andras Nemeseri <izemize>
Component: Layout and RenderingAssignee: Dave Hyatt <hyatt>
Status: VERIFIED FIXED    
Severity: Normal    
Priority: P2    
Version: 523.x (Safari 3)   
Hardware: Mac   
OS: OS X 10.4   
URL: http://nemeseri.extra.hu/safari/bug1.html
Attachments:
Description Flags
testcase
none
Patch that fixes bug. mitz: review+

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. )

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

Workaround:
Set "position: absolute" to C.

Test case available:
http://nemeseri.extra.hu/safari/bug1.html
Comment 1 Andras Nemeseri 2007-05-26 15:47:41 PDT
Created attachment 14742 [details]
testcase
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.

http://www.w3.org/TR/CSS21/visudet.html#the-height-property

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.

r=me
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
Fixed.