An absolutely positioned replaced element with a percentage width should scale in respect to its containing block's width, including padding. Instead, it seems that the padding is not taken into account, and only the content width is used. I believe the relevant part of the CSS 2.1 spec is <http://www.w3.org/TR/CSS21/visudet.html#the-width-property>: For absolutely positioned elements whose containing block is based on a block-level element, the percentage is calculated with respect to the width of the padding box of that element. This is a change from CSS1, where the percentage width was always calculated with respect to the content box of the parent element.
Created attachment 20388 [details] Test case The gradient image should be as wide as the blue box.
Created attachment 20514 [details] Test case (updated) An improved test case, which makes it a little clearer with the standardized green for pass and red for fail.
Created attachment 20515 [details] patch I went over the specs and seems to me like the test case was correct, not to mention that webkit was already doing the correct thing for the height, just not for the width. This is my first patch, I tried my best, but I'm sure there's bound to be errors... also, I made sure to run the webkit tests and found no regressions. I'm new to this whole thing, so I appreciate any tips or corrections.
Created attachment 20692 [details] patch (updated) Updated the patch to remove "tabs" from the ChangeLogs as not to break the script.
Created attachment 20723 [details] patch (updated 2) Removed tabs from the test case too, just in case that would break anything.
This looks right to me, but hyatt is really the expert here.
Comment on attachment 20723 [details] patch (updated 2) r=me
Landed in <http://trac.webkit.org/changeset/32784> with tiny tweaks to the change logs.