Safari version: 5.0.5 (7533.21.1) Other browsers tested: Chrome 12: FAIL Firefox 5: OK IE 7/8/9: OK Steps to reproduce: 1. Create a relatively positioned div with a height and a bottom padding 2. Put in that div an absolutely positioned div with height 100% 3. Put in the second div an image with height 100% 4. Open the file in Chrome or Safari Expected behavior: The image should fill the height of the second div Actual behavior: The image inherits the height value that was set on the first div More information: The attached file has steps 1, 2 and 3 already completed. I have only tested this with the XHTML Transitional doctype.
Created attachment 99909 [details] Test HTML file
Created attachment 99910 [details] Screenshot
Pulling together the relevant parts of the CSS spec: http://www.w3.org/TR/CSS2/visudet.html#propdef-height "<percentage> Specifies a percentage height. The percentage is calculated with respect to the height of the generated box's containing block." http://www.w3.org/TR/CSS2/visudet.html#containing-block-details "If the element has 'position: absolute', the containing block is established by the nearest ancestor with a 'position' of 'absolute', 'relative' or 'fixed', in the following way: In the case that the ancestor is an inline element (...) Otherwise, the containing block is formed by the padding edge of the ancestor." So yes, this is a bug.
Created attachment 101384 [details] Proposed patch.
Created attachment 101616 [details] Proposed patch V2
Comment on attachment 101616 [details] Proposed patch V2 r=me. Much nicer!
Comment on attachment 101616 [details] Proposed patch V2 Clearing flags on attachment: 101616 Committed r91533: <http://trac.webkit.org/changeset/91533>
All reviewed patches have been landed. Closing bug.
Created attachment 101681 [details] add pixel test result
Can someone check & see if the pixel result is good or not?
Comment on attachment 101681 [details] add pixel test result r=me
r=me to add it, but should it really be in the cross-platform dir? The changelog says that at least.
Committed r91862: <http://trac.webkit.org/changeset/91862>