Bug 965030 - Pass the correct positioned frame to PushAbsoluteContainingBlock. r=roc
authorMatt Woodrow <mwoodrow@mozilla.com>
Thu, 30 Jan 2014 18:40:23 +1300
changeset 181951 84206c33712600e6ebbbf1d09bb9721f6cf8bf74
parent 181937 ad741e8ab1b7e50ef8c260284cbbd777f250b33c
child 181952 c1a6fdd3fa0159ac1a62a83eb1abd07af703e49c
push id3343
push userffxbld
push dateMon, 17 Mar 2014 21:55:32 +0000
treeherdermozilla-beta@2f7d3415f79f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs965030
milestone29.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 965030 - Pass the correct positioned frame to PushAbsoluteContainingBlock. r=roc
layout/base/nsCSSFrameConstructor.cpp
layout/reftests/svg/foreignObject-fixedpos-02.html
layout/reftests/svg/foreignObject-fixedpos-ref.html
layout/reftests/svg/reftest.list
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -3654,17 +3654,17 @@ nsCSSFrameConstructor::ConstructFrameFro
     } 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, cb, absoluteSaveState);
       }
     }
 
     if (!aItem.mAnonChildren.IsEmpty()) {
       NS_ASSERTION(!(bits & FCDATA_USE_CHILD_ITEMS),
                    "We should not have both anonymous and non-anonymous "
                    "children in a given FrameConstructorItem");
       AddFCItemsForAnonymousContent(aState, newFrame, aItem.mAnonChildren,
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-fixedpos-02.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<div style="height: 100px">
+</div>
+<svg width="200" height="200" style="overflow: visible">
+  <foreignObject width="200" height="200">
+    <div id="x" style="position:fixed; top: 0; left: 0; width: 100px; height: 100px; background-color: red">
+    </div>
+  </foreignObject>
+</svg>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-fixedpos-ref.html
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<div style="height: 100px">
+</div>
+<div style="top: 100px; width: 100px; height: 100px; background-color:red"></div>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -167,16 +167,17 @@ skip-if(B2G) == foreignObject-change-tra
 == foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html
 skip-if(B2G) == foreignObject-move-repaint-01.svg pass.svg
 == foreignObject-overflow-01.svg pass.svg
 skip-if(B2G) == foreignObject-start-hidden-01.svg pass.svg # followup from Bug 596765
 skip-if(B2G) == foreignObject-start-hidden-02.svg pass.svg
 skip-if(B2G) == foreignObject-style-change-01.svg pass.svg
 == foreignObject-dynamic-abspos-01.html foreignObject-dynamic-abspos-01-ref.html
 fuzzy-if(Android,18,600) == foreignObject-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html
+== foreignObject-fixedpos-02.html foreignObject-fixedpos-ref.html
 == foreignObject-dynamic-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html
 == g-transform-01.svg pass.svg
 == getElementById-a-element-01.svg pass.svg
 fuzzy-if(Android||B2G,9,980) == gradient-live-01a.svg gradient-live-01-ref.svg
 fuzzy-if(Android||B2G,9,980) == gradient-live-01b.svg gradient-live-01-ref.svg
 fuzzy-if(Android||B2G,9,980) == gradient-live-01c.svg gradient-live-01-ref.svg
 fuzzy-if(Android||B2G,9,980) == gradient-live-01d.svg gradient-live-01-ref.svg
 == gradient-transform-01.svg pass.svg