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
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 12 Feb 2013 17:55:39 +1300
changeset 131465 608f588cb3e97e478b39119c9a3eac24761e4113
parent 131464 09ddbf34dc176542803a5f646410540a285eae5b
child 131466 80df535bf5e627b8757b98346fcfa5bc1b12971d
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs836990
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/base/crashtests/836990-1.html
layout/base/crashtests/crashtests.list
layout/base/nsCSSFrameConstructor.cpp
new file mode 100644
--- /dev/null
+++ b/layout/base/crashtests/836990-1.html
@@ -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>
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -374,8 +374,9 @@ skip-if(Android||B2G||browserIsRemote) a
 asserts(0-2) load 736389-1.xhtml # sometimes the above assertions are delayed and is reported on this test instead
 asserts-if(winWidget,0-2) load 736924-1.html # bug 738803
 load 749816-1.html
 load 763223-1.html
 test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.lineThreshold,100) load 763702.xhtml
 load 770381-1.html
 load 795646.html
 load 813372-1.html
+load 836990-1.html
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -1247,20 +1247,20 @@ nsFrameConstructorState::ProcessFrameIns
     return;
   }
   
   nsIFrame* containingBlock = aFrameItems.containingBlock;
 
   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()
   // if the containing block hasn't been reflowed yet (so NS_FRAME_FIRST_REFLOW
   // is set) and doesn't have any frames in the aChildListID child list yet.
   const nsFrameList& childList = containingBlock->GetChildList(aChildListID);
   DebugOnly<nsresult> rv = NS_OK;
   if (childList.IsEmpty() &&