Bug 640917. Treat foreignObject as a fixed position containing block. r=jwatt
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 21 Feb 2012 18:01:41 -0500
changeset 87352 5a90ee43d1f00e6c45ad8e2d95dba3d680c1bf50
parent 87351 fb6e8ee380fee46afd7509b7b7bad6632639bb22
child 87353 d0a7f8c60cccc4c0fb7478704259811bd214fb8d
push id22114
push userbmo@edmorley.co.uk
push dateWed, 22 Feb 2012 14:11:35 +0000
treeherdermozilla-central@e722d2ab78da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs640917
milestone13.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 640917. Treat foreignObject as a fixed position containing block. r=jwatt
layout/reftests/svg/foreignObject-dynamic-fixedpos-01.html
layout/reftests/svg/foreignObject-fixedpos-01.html
layout/reftests/svg/reftest.list
layout/svg/base/src/svg.css
copy from layout/reftests/svg/foreignObject-dynamic-abspos-01.html
copy to layout/reftests/svg/foreignObject-dynamic-fixedpos-01.html
--- a/layout/reftests/svg/foreignObject-dynamic-abspos-01.html
+++ b/layout/reftests/svg/foreignObject-dynamic-fixedpos-01.html
@@ -1,14 +1,14 @@
 <!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:absolute; top: 0; left: 0">
+    <div id="x" style="position:fixed; top: 0; left: 0">
       This is a test
     </div>
   </foreignObject>
   <script>
     document.body.offsetWidth;
     var kid = document.getElementById("x");
     var parent = kid.parentNode;
     var nextSibling = kid.nextSibling;
copy from layout/reftests/svg/foreignObject-dynamic-abspos-01-ref.html
copy to layout/reftests/svg/foreignObject-fixedpos-01.html
--- a/layout/reftests/svg/foreignObject-dynamic-abspos-01-ref.html
+++ b/layout/reftests/svg/foreignObject-fixedpos-01.html
@@ -1,10 +1,10 @@
 <!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:absolute; top: 0; left: 0">
+    <div id="x" style="position:fixed; top: 0; left: 0">
       This is a test
     </div>
   </foreignObject>
 </svg>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -143,16 +143,18 @@ fails-if(Android) == filter-extref-diffe
 == foreignObject-form-theme.svg foreignObject-form-theme-ref.html
 == foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html
 == foreignObject-move-repaint-01.svg pass.svg
 == foreignObject-overflow-01.svg pass.svg
 == 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
+== foreignObject-fixedpos-01.html foreignObject-dynamic-abspos-01-ref.html
+== foreignObject-dynamic-fixedpos-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
 fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01c.svg gradient-live-01-ref.svg # bug 696674
 fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated) == gradient-live-01d.svg gradient-live-01-ref.svg # bug 696674
 fails == inline-in-xul-basic-01.xul pass.svg
 == invalid-text-01.svg pass.svg
 == lang-attribute-01.svg pass.svg
--- a/layout/svg/base/src/svg.css
+++ b/layout/svg/base/src/svg.css
@@ -59,12 +59,12 @@ foreignObject {
 @media all and (-moz-is-resource-document) {
  foreignObject *|* {
    -moz-appearance: none !important;
  }
 }
 
 *|*::-moz-svg-foreign-content {
   display: block !important;
-  /* We need to be an absolute container */
-  position: relative !important;
+  /* We need to be an absolute and fixed container */
+  -moz-transform: translate(0) !important;
   text-indent: 0;
 }