diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 7ba99cd8946..4931301ca69 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -4952,8 +4952,10 @@ nsCSSFrameConstructor::ConstructSVGForeignObjectFrame(nsFrameConstructorState& a } nsFrameItems childItems; - // Claim to be relatively positioned so that we end up being the + // We should be relatively positioned so that we end up being the // absolute containing block. + const nsStyleDisplay* disp = innerPseudoStyle->GetStyleDisplay(); + NS_ASSERTION(disp->IsPositioned(), "How did this get to not be positioned?"); rv = ConstructBlock(aState, innerPseudoStyle->GetStyleDisplay(), content, newFrame, newFrame, innerPseudoStyle, &blockFrame, childItems, true, diff --git a/layout/reftests/svg/foreignObject-dynamic-abspos-01-ref.html b/layout/reftests/svg/foreignObject-dynamic-abspos-01-ref.html new file mode 100644 index 00000000000..37bd9b6f14b --- /dev/null +++ b/layout/reftests/svg/foreignObject-dynamic-abspos-01-ref.html @@ -0,0 +1,10 @@ + +
+
+ + +
+ This is a test +
+
+
diff --git a/layout/reftests/svg/foreignObject-dynamic-abspos-01.html b/layout/reftests/svg/foreignObject-dynamic-abspos-01.html new file mode 100644 index 00000000000..583ba42031d --- /dev/null +++ b/layout/reftests/svg/foreignObject-dynamic-abspos-01.html @@ -0,0 +1,18 @@ + +
+
+ + +
+ This is a test +
+
+ +
diff --git a/layout/reftests/svg/reftest.list b/layout/reftests/svg/reftest.list index 05b19d81129..1f873f7b58e 100644 --- a/layout/reftests/svg/reftest.list +++ b/layout/reftests/svg/reftest.list @@ -147,6 +147,7 @@ fails-if(Android) == filter-extref-differentOrigin-01.svg pass.svg # Bug 695385 == foreignObject-start-hidden-01.svg pass.svg # followup from Bug 596765 == foreignObject-start-hidden-02.svg pass.svg == foreignObject-style-change-01.svg pass.svg +== foreignObject-dynamic-abspos-01.html foreignObject-dynamic-abspos-01-ref.html == getElementById-a-element-01.svg pass.svg fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01a.svg gradient-live-01-ref.svg # bug 696674 fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01b.svg gradient-live-01-ref.svg # bug 696674 diff --git a/layout/svg/base/src/svg.css b/layout/svg/base/src/svg.css index 3ef75ead485..b9cd326252b 100644 --- a/layout/svg/base/src/svg.css +++ b/layout/svg/base/src/svg.css @@ -64,6 +64,7 @@ foreignObject { *|*::-moz-svg-foreign-content { display: block !important; - position: static !important; + /* We need to be an absolute container */ + position: relative !important; text-indent: 0; }