Bug 836990. Put fixed-pos items in the abs-pos list of the container whenever it doesn't have a fixed-pos list. It's simpler this way and handles all edge cases. r=bzbarsky

This commit is contained in:
Robert O'Callahan 2013-02-12 17:55:39 +13:00
parent 3d58763a27
commit 36e6c475bf
3 changed files with 17 additions and 4 deletions

View File

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<body>
<div style="overflow: auto; transform:translate(100px,0);">
<div style="position: relative;"><div id="x" style="position:fixed; display:none"></div></div>
</div>
<script>
document.body.getBoundingClientRect();
document.getElementById('x').style.display = '';
</script>
</body>
</html>

View File

@ -379,3 +379,4 @@ test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineTh
load 770381-1.html
load 795646.html
load 813372-1.html
load 836990-1.html

View File

@ -1252,10 +1252,10 @@ nsFrameConstructorState::ProcessFrameInsertions(nsAbsoluteItems& aFrameItems,
NS_ASSERTION(containingBlock,
"Child list without containing block?");
if (aChildListID == nsIFrame::kFixedList &&
containingBlock->GetStyleDisplay()->HasTransform(containingBlock)) {
// Put this frame on the transformed-frame's abs-pos list instead.
aChildListID = nsIFrame::kAbsoluteList;
if (aChildListID == nsIFrame::kFixedList) {
// Put this frame on the transformed-frame's abs-pos list instead, if
// it has abs-pos children instead of fixed-pos children.
aChildListID = containingBlock->GetAbsoluteListID();
}
// Insert the frames hanging out in aItems. We can use SetInitialChildList()