Acid3 expects <html> margins to not affect absolute positioned elements See the @font-face test (the map::after generated content). Hixie claims that: http://www.w3.org/TR/CSS21/visudet.html#containing-block-details justifies that absolute positioned elements should ignore margins on <html>. I tried to build a test case, but I couldn't get a <div style="position: relative; left: -20px; top: -20px;" to actually move itself up into the margins of the HTML (I could get it to move left into the left margin). FF seems to behave identically to us in this regard.
Created attachment 18540 [details] test case I changed my test case to not use position: relative. If I'm reading the spec correctly, this test case should show a single green 100x100 rect at 20px,20px.
Hixie's correct.
I'm actually surprised we don't handle this correctly. We made a change for Safari 3 to really use the ICB for positioned elements.
Created attachment 18553 [details] Update a couple of spots in RenderLayer that were missed. Unfortunate. Our change in Safari 3 was incomplete. RenderLayer still incorrectly halted at the root element.
Comment on attachment 18553 [details] Update a couple of spots in RenderLayer that were missed. Actually never mind. CSS2.1 states that the root element establishes a stacking context. This is kind of weird, since it means positioned objects are positioned relative to the ICB, but in terms of stacking context they are sorted in the root (<html>'s) stacking context. This means we'll probably just have to add in some kind of positioning hack when painting and hit testing for this case.
Created attachment 18554 [details] Here we go. Easy after all. The enclosingPositionedAncestor method is all that needed updating. It is used when converting to the right layer coords, and it was incorrectly allowing the root to be a positioned ancestor. I will use the test case from the bug as the layout test.
Comment on attachment 18554 [details] Here we go. Easy after all. Oops, I've been attaching the wrong patches this whole time.
Created attachment 18555 [details] Finally.
Comment on attachment 18555 [details] Finally. i would argue that the change to RenderLayer::stackingContext is both unnecessary, and results in less clear code.
Comment on attachment 18555 [details] Finally. r=me, though i'd like it if you could make a layout test :D
Fixed in r29696.
The part of Acid3 which tests this still seems a few pixels off (absolute positioning of generated glyphs). I'll file a separate bug about that. Thanks for fixing this Dave.