Backout changesets 3581b3d60886, cff9eab960e3, d390c8c21882 for Android foreignObject-fixedpos-01.html failures on a CLOSED TREE.
authorMs2ger <ms2ger@gmail.com>
Tue, 16 Apr 2013 11:40:41 +0200
changeset 128904 7c596ffafa29013e20f20c183f6c4b153b171b57
parent 128903 00c31be62f62770f942350b19ce348ea5016bb9a
child 128905 09f78adf4e792b37970b745d93bde8d3f0c19fd1
push id24545
push userryanvm@gmail.com
push dateTue, 16 Apr 2013 13:13:04 +0000
treeherdermozilla-central@09f78adf4e79 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone23.0a1
backs out3581b3d60886c34edb1c9366c0d04c2a2a577ee7
cff9eab960e39ac98d38f9ef62bb4b032a02cdcf
d390c8c218829f85c98c5c78cc717dbecb9d340d
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
Backout changesets 3581b3d60886, cff9eab960e3, d390c8c21882 for Android foreignObject-fixedpos-01.html failures on a CLOSED TREE.
layout/base/crashtests/860579-1.html
layout/base/crashtests/crashtests.list
layout/base/nsCSSFrameConstructor.cpp
layout/base/nsCSSFrameConstructor.h
layout/base/nsDisplayList.cpp
layout/generic/nsSimplePageSequence.cpp
layout/reftests/bugs/849996-1-ref.html
layout/reftests/bugs/849996-1.html
layout/reftests/bugs/reftest.list
deleted file mode 100644
--- a/layout/base/crashtests/860579-1.html
+++ /dev/null
@@ -1,21 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<script>
-function addFrame(contents)
-{
-  var frame = document.createElement("iframe");
-  frame.src = "data:text/html," + contents;
-  document.body.appendChild(frame);
-}
-function boom()
-{
-  addFrame("1");
-  document.documentElement.offsetHeight;
-  addFrame("2");
-  document.body.style.display = "table-caption";
-}
-</script>
-</head>
-<body onload="boom();"></body>
-</html>
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -386,11 +386,10 @@ asserts(0-2) load 736389-1.xhtml # somet
 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
-load 860579-1.html
 pref(layers.force-active,true) load 859526-1.html
 pref(layers.force-active,true) load 859630-1.html
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -786,22 +786,17 @@ public:
 
   ~nsFrameConstructorState();
   
   // Function to push the existing absolute containing block state and
   // create a new scope. Code that uses this function should get matching
   // logic in GetAbsoluteContainingBlock.
   // Also makes aNewAbsoluteContainingBlock the containing block for
   // fixed-pos elements if necessary.
-  // aPositionedFrame is the frame whose style actually makes
-  // aNewAbsoluteContainingBlock a containing block. E.g. for a scrollable element
-  // aPositionedFrame is the element's primary frame and
-  // aNewAbsoluteContainingBlock is the scrolled frame.
   void PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock,
-                                   nsIFrame* aPositionedFrame,
                                    nsFrameConstructorSaveState& aSaveState);
 
   // Function to push the existing float containing block state and
   // create a new scope. Code that uses this function should get matching
   // logic in GetFloatContainingBlock.
   // Pushing a null float containing block forbids any frames from being
   // floated until a new float containing block is pushed.
   // XXX we should get rid of null float containing blocks and teach the
@@ -1029,40 +1024,39 @@ AdjustAbsoluteContainingBlock(nsIFrame* 
   
   // Always use the container's first continuation. (Inline frames can have
   // non-fluid bidi continuations...)
   return aContainingBlockIn->GetFirstContinuation();
 }
 
 void
 nsFrameConstructorState::PushAbsoluteContainingBlock(nsIFrame* aNewAbsoluteContainingBlock,
-                                                     nsIFrame* aPositionedFrame,
                                                      nsFrameConstructorSaveState& aSaveState)
 {
   aSaveState.mItems = &mAbsoluteItems;
   aSaveState.mSavedItems = mAbsoluteItems;
   aSaveState.mChildListID = nsIFrame::kAbsoluteList;
   aSaveState.mState = this;
   aSaveState.mSavedFixedPosIsAbsPos = mFixedPosIsAbsPos;
 
   if (mFixedPosIsAbsPos) {
     // Since we're going to replace mAbsoluteItems, we need to save it into
     // mFixedItems now (and save the current value of mFixedItems).
     aSaveState.mSavedFixedItems = mFixedItems;
     mFixedItems = mAbsoluteItems;
   }
 
-  mAbsoluteItems =
+  mAbsoluteItems = 
     nsAbsoluteItems(AdjustAbsoluteContainingBlock(aNewAbsoluteContainingBlock));
 
   /* See if we're wiring the fixed-pos and abs-pos lists together.  This happens iff
    * we're a transformed element.
    */
-  mFixedPosIsAbsPos = aPositionedFrame &&
-      aPositionedFrame->StyleDisplay()->HasTransform(aPositionedFrame);
+  mFixedPosIsAbsPos = aNewAbsoluteContainingBlock &&
+    aNewAbsoluteContainingBlock->StyleDisplay()->HasTransform(aNewAbsoluteContainingBlock);
 
   if (aNewAbsoluteContainingBlock) {
     aNewAbsoluteContainingBlock->MarkAsAbsoluteContainingBlock();
   }
 }
 
 void
 nsFrameConstructorState::PushFloatContainingBlock(nsIFrame* aNewFloatContainingBlock,
@@ -1956,17 +1950,17 @@ nsCSSFrameConstructor::ConstructTable(ns
 
   // Mark the table frame as an absolute container if needed
   newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
   if ((display->IsRelativelyPositionedStyle() ||
        display->IsAbsolutelyPositionedStyle() ||
        (display->HasTransformStyle() &&
         aParentFrame->IsFrameOfType(nsIFrame::eSupportsCSSTransforms))) &&
       !aParentFrame->IsSVGText()) {
-    aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState);
+    aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState);
   }
   if (aItem.mFCData->mBits & FCDATA_USE_CHILD_ITEMS) {
     ConstructFramesFromItemList(aState, aItem.mChildItems,
                                 innerFrame, childItems);
   } else {
     ProcessChildren(aState, content, styleContext, innerFrame,
                     true, childItems, false, aItem.mPendingBinding);
   }
@@ -2358,17 +2352,16 @@ nsCSSFrameConstructor::ConstructDocEleme
   styleContext->StartBackgroundImageLoads();
 
   nsFrameConstructorSaveState absoluteSaveState;
   if (mHasRootAbsPosContainingBlock) {
     // Push the absolute containing block now so we can absolutely position
     // the root element
     mDocElementContainingBlock->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
     state.PushAbsoluteContainingBlock(mDocElementContainingBlock,
-                                      mDocElementContainingBlock,
                                       absoluteSaveState);
   }
 
   // The rules from CSS 2.1, section 9.2.4, have already been applied
   // by the style system, so we can assume that display->mDisplay is
   // either NONE, BLOCK, or TABLE.
 
   // contentFrame is the primary frame for the root element. newFrame
@@ -2445,18 +2438,17 @@ nsCSSFrameConstructor::ConstructDocEleme
       contentFrame = NS_NewBlockFormattingContext(mPresShell, styleContext);
       nsFrameItems frameItems;
       // Use a null PendingBinding, since our binding is not in fact pending.
       ConstructBlock(state, display, aDocElement,
                      state.GetGeometricParent(display,
                                               mDocElementContainingBlock),
                      mDocElementContainingBlock, styleContext,
                      &contentFrame, frameItems,
-                     display->IsPositioned(contentFrame) ? contentFrame : nullptr,
-                     nullptr);
+                     display->IsPositioned(contentFrame), nullptr);
       newFrame = frameItems.FirstChild();
       NS_ASSERTION(frameItems.OnlyChild(), "multiple root element frames");
     }
   }
 
   MOZ_ASSERT(newFrame);
   MOZ_ASSERT(contentFrame);
 
@@ -3067,17 +3059,17 @@ nsCSSFrameConstructor::ConstructFieldSet
   aState.AddChild(newFrame, aFrameItems, content, styleContext, aParentFrame);
   
   // Process children
   nsFrameConstructorSaveState absoluteSaveState;
   nsFrameItems                childItems;
 
   newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
   if (newFrame->IsPositioned()) {
-    aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState);
+    aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState);
   }
 
   ProcessChildren(aState, content, styleContext, blockFrame, true,
                   childItems, true, aItem.mPendingBinding);
 
   nsFrameItems fieldsetKids;
   fieldsetKids.AddChild(blockFrame);
 
@@ -3618,26 +3610,26 @@ nsCSSFrameConstructor::ConstructFrameFro
     }
 #endif /* MOZ_XUL */
 
     // Process the child content if requested
     nsFrameItems childItems;
     nsFrameConstructorSaveState absoluteSaveState;
 
     if (bits & FCDATA_FORCE_NULL_ABSPOS_CONTAINER) {
-      aState.PushAbsoluteContainingBlock(nullptr, nullptr, absoluteSaveState);
+      aState.PushAbsoluteContainingBlock(nullptr, absoluteSaveState);
     } else if (!(bits & FCDATA_SKIP_ABSPOS_PUSH)) {
       nsIFrame* cb = maybeAbsoluteContainingBlock;
       cb->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
       if ((maybeAbsoluteContainingBlockDisplay->IsAbsolutelyPositionedStyle() ||
            maybeAbsoluteContainingBlockDisplay->IsRelativelyPositionedStyle() ||
            (maybeAbsoluteContainingBlockDisplay->HasTransformStyle() &&
             cb->IsFrameOfType(nsIFrame::eSupportsCSSTransforms))) &&
           !cb->IsSVGText()) {
-        aState.PushAbsoluteContainingBlock(cb, primaryFrame, absoluteSaveState);
+        aState.PushAbsoluteContainingBlock(cb, absoluteSaveState);
       }
     }
 
     if (bits & FCDATA_USE_CHILD_ITEMS) {
       NS_ASSERTION(!ShouldSuppressFloatingOfDescendants(newFrame),
                    "uh oh -- this frame is supposed to _suppress_ floats, but "
                    "we're about to push it as a float containing block...");
 
@@ -4362,17 +4354,17 @@ nsCSSFrameConstructor::ConstructScrollab
   // pass a temporary stylecontext, the correct one will be set later
   nsIFrame* scrolledFrame =
     NS_NewBlockFormattingContext(mPresShell, styleContext);
 
   nsFrameItems blockItem;
   ConstructBlock(aState, scrolledContentStyle->StyleDisplay(), content,
                  newFrame, newFrame, scrolledContentStyle,
                  &scrolledFrame, blockItem,
-                 aDisplay->IsPositioned(newFrame) ? newFrame : nullptr,
+                 aDisplay->IsPositioned(scrolledFrame),
                  aItem.mPendingBinding);
 
   NS_ASSERTION(blockItem.FirstChild() == scrolledFrame,
                "Scrollframe's frameItems should be exactly the scrolled frame");
   FinishBuildingScrollFrame(newFrame, scrolledFrame);
 
   aState.AddChild(newFrame, aFrameItems, content, styleContext, aParentFrame);
   return newFrame;
@@ -4405,18 +4397,17 @@ nsCSSFrameConstructor::ConstructNonScrol
     }
   } else {
     newFrame = NS_NewBlockFrame(mPresShell, styleContext);
   }
 
   ConstructBlock(aState, aDisplay, aItem.mContent,
                  aState.GetGeometricParent(aDisplay, aParentFrame),
                  aParentFrame, styleContext, &newFrame,
-                 aFrameItems,
-                 aDisplay->IsPositioned(newFrame) ? newFrame : nullptr,
+                 aFrameItems, aDisplay->IsPositioned(newFrame),
                  aItem.mPendingBinding);
   return newFrame;
 }
 
 
 void
 nsCSSFrameConstructor::InitAndRestoreFrame(const nsFrameConstructorState& aState,
                                            nsIContent*              aContent,
@@ -10896,17 +10887,17 @@ void
 nsCSSFrameConstructor::ConstructBlock(nsFrameConstructorState& aState,
                                       const nsStyleDisplay*    aDisplay,
                                       nsIContent*              aContent,
                                       nsIFrame*                aParentFrame,
                                       nsIFrame*                aContentParentFrame,
                                       nsStyleContext*          aStyleContext,
                                       nsIFrame**               aNewFrame,
                                       nsFrameItems&            aFrameItems,
-                                      nsIFrame*                aPositionedFrameForAbsPosContainer,
+                                      bool                     aAbsPosContainer,
                                       PendingBinding*          aPendingBinding)
 {
   // Create column wrapper if necessary
   nsIFrame* blockFrame = *aNewFrame;
   NS_ASSERTION(blockFrame->GetType() == nsGkAtoms::blockFrame, "not a block frame?");
   nsIFrame* parent = aParentFrame;
   nsRefPtr<nsStyleContext> blockStyle = aStyleContext;
   const nsStyleColumn* columns = aStyleContext->StyleColumn();
@@ -10941,19 +10932,19 @@ nsCSSFrameConstructor::ConstructBlock(ns
   // if one is required. We have to do this because absolute
   // positioning must be computed with respect to the CSS dimensions
   // of the element, which are the dimensions of the outer block. But
   // we can't really do that because only blocks can have absolute
   // children. So use the block and try to compensate with hacks
   // in nsBlockFrame::CalculateContainingBlockSizeForAbsolutes.
   nsFrameConstructorSaveState absoluteSaveState;
   (*aNewFrame)->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
-  if (aPositionedFrameForAbsPosContainer) {
+  if (aAbsPosContainer) {
     //    NS_ASSERTION(aRelPos, "should have made area frame for this");
-    aState.PushAbsoluteContainingBlock(*aNewFrame, aPositionedFrameForAbsPosContainer, absoluteSaveState);
+    aState.PushAbsoluteContainingBlock(*aNewFrame, absoluteSaveState);
   }
 
   // Process the child content
   nsFrameItems childItems;
   ProcessChildren(aState, aContent, aStyleContext, blockFrame, true,
                   childItems, true, aPendingBinding);
 
   // Set the frame's initial child list
@@ -11042,17 +11033,17 @@ nsCSSFrameConstructor::ConstructInline(n
   nsFrameConstructorSaveState absoluteSaveState;  // definition cannot be inside next block
                                                   // because the object's destructor is significant
                                                   // this is part of the fix for bug 42372
 
   newFrame->AddStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN);
   if (positioned) {
     // Relatively positioned frames becomes a container for child
     // frames that are positioned
-    aState.PushAbsoluteContainingBlock(newFrame, newFrame, absoluteSaveState);
+    aState.PushAbsoluteContainingBlock(newFrame, absoluteSaveState);
   }
 
   // Process the child content
   nsFrameItems childItems;
   ConstructFramesFromItemList(aState, aItem.mChildItems, newFrame, childItems);
 
   nsFrameList::FrameLinkEnumerator firstBlockEnumerator(childItems);
   if (!aItem.mIsAllInline) {
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -1577,30 +1577,27 @@ private:
   // @param aNewFrame an in/out parameter. On input it is the block to be
   // constructed. On output it is reset to the outermost
   // frame constructed (e.g. if we need to wrap the block in an
   // nsColumnSetFrame.
   // @param aParentFrame is the desired parent for the (possibly wrapped)
   // block
   // @param aContentParent is the parent the block would have if it
   // were in-flow
-  // @param aPositionedFrameForAbsPosContainer if non-null, then the new
-  // block should be an abs-pos container and aPositionedFrameForAbsPosContainer
-  // is the frame whose style is making this block an abs-pos container.
   // @param aPendingBinding the pending binding  from this block's frame
   // construction item.
   void ConstructBlock(nsFrameConstructorState& aState,
                       const nsStyleDisplay*    aDisplay,
                       nsIContent*              aContent,
                       nsIFrame*                aParentFrame,
                       nsIFrame*                aContentParentFrame,
                       nsStyleContext*          aStyleContext,
                       nsIFrame**               aNewFrame,
                       nsFrameItems&            aFrameItems,
-                      nsIFrame*                aPositionedFrameForAbsPosContainer,
+                      bool                     aAbsPosContainer,
                       PendingBinding*          aPendingBinding);
 
   nsIFrame* ConstructInline(nsFrameConstructorState& aState,
                             FrameConstructionItem&   aItem,
                             nsIFrame*                aParentFrame,
                             const nsStyleDisplay*    aDisplay,
                             nsFrameItems&            aFrameItems);
 
--- a/layout/base/nsDisplayList.cpp
+++ b/layout/base/nsDisplayList.cpp
@@ -1391,25 +1391,38 @@ static void Sort(nsDisplayList* aList, i
       aList->AppendToTop(list1.RemoveBottom());
     } else {
       aList->AppendToTop(list2.RemoveBottom());
     }
   }
 }
 
 static nsIContent* FindContentInDocument(nsDisplayItem* aItem, nsIDocument* aDoc) {
-  nsIFrame* f = aItem->GetUnderlyingFrame();
-  while (f) {
-    nsPresContext* pc = f->PresContext();
-    if (pc->Document() == aDoc) {
-      return f->GetContent();
+  nsIFrame* frame = aItem->GetUnderlyingFrame();
+  nsIContent* c = frame->GetContent();
+  for (;;) {
+    nsIDocument* d;
+    if (c) {
+      d = c->OwnerDoc();
+    } else {
+      d = frame->PresContext()->Document();
     }
-    f = nsLayoutUtils::GetCrossDocParentFrame(pc->PresShell()->GetRootFrame());
+    if (d == aDoc) {
+      return c;
+    }
+    nsIDocument* parentDoc = d->GetParentDocument();
+    if (!parentDoc) {
+      return nullptr;
+    }
+    c = parentDoc->FindContentForSubDocument(d);
+    if (!c) {
+      NS_ERROR("No content for subdocument?");
+      return nullptr;
+    }
   }
-  return nullptr;
 }
 
 static bool IsContentLEQ(nsDisplayItem* aItem1, nsDisplayItem* aItem2,
                          void* aClosure) {
   nsIContent* commonAncestor = static_cast<nsIContent*>(aClosure);
   // It's possible that the nsIContent for aItem1 or aItem2 is in a subdocument
   // of commonAncestor, because display items for subdocuments have been
   // mixed into the same list. Ensure that we're looking at content
--- a/layout/generic/nsSimplePageSequence.cpp
+++ b/layout/generic/nsSimplePageSequence.cpp
@@ -802,29 +802,21 @@ ComputePageSequenceTransform(nsIFrame* a
 void
 nsSimplePageSequenceFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                             const nsRect&           aDirtyRect,
                                             const nsDisplayListSet& aLists)
 {
   DisplayBorderBackgroundOutline(aBuilder, aLists);
 
   nsDisplayList content;
-
-  {
-    // Clear clip state while we construct the children of the
-    // nsDisplayTransform, since they'll be in a different coordinate system.
-    DisplayListClipState::AutoSaveRestore clipState(aBuilder);
-    clipState.Clear();
-
-    nsIFrame* child = GetFirstPrincipalChild();
-    while (child) {
-      child->BuildDisplayListForStackingContext(aBuilder,
-          child->GetVisualOverflowRectRelativeToSelf(), &content);
-      child = child->GetNextSibling();
-    }
+  nsIFrame* child = GetFirstPrincipalChild();
+  while (child) {
+    child->BuildDisplayListForStackingContext(aBuilder,
+        child->GetVisualOverflowRectRelativeToSelf(), &content);
+    child = child->GetNextSibling();
   }
 
   content.AppendNewToTop(new (aBuilder)
       nsDisplayTransform(aBuilder, this, &content, ::ComputePageSequenceTransform));
 
   aLists.Content()->AppendToTop(&content);
 }
 
deleted file mode 100644
--- a/layout/reftests/bugs/849996-1-ref.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-#parent {
-  width: 200px;
-  height: 200px;
-  margin-left: 10px;
-  background: green;
-}
-#child {
-  width: 90px;
-  height: 90px;
-  background: red;
-}
-</style>
-</head>
-<body>
-<div id="parent">
-  <div id="child"></div>
-</div>
-</body>
-</html>
deleted file mode 100644
--- a/layout/reftests/bugs/849996-1.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<style>
-#parent {
-  width: 200px;
-  height: 200px;
-  overflow: hidden;
-  transform: translateX(10px);
-  background: green;
-}
-#child {
-  position: fixed;
-  top: -10px;
-  left: -10px;
-  width: 100px;
-  height: 100px;
-  background: red;
-}
-</style>
-</head>
-<body>
-<div id="parent">
-  <div id="child"></div>
-</div>
-</body>
-</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -1748,11 +1748,10 @@ skip-if(B2G) == 818276-1.html 818276-1-r
 == 827577-1b.html 827577-1-ref.html
 == 827799-1.html about:blank
 == 836844-1.html 836844-1-ref.html
 == 841192-1.html 841192-1-ref.html
 == 846144-1.html 846144-1-ref.html
 == 847850-1.html 847850-1-ref.html
 == 848421-1.html 848421-1-ref.html
 test-pref(layout.css.flexbox.enabled,true) == 849407-1.html 849407-1-ref.html
-== 849996-1.html 849996-1-ref.html
 == 858803-1.html 858803-1-ref.html
 != 860370.html 860370-notref.html