Bug 686581 - Disable theming in SVG images. r=roc
authorMats Palmgren <matspal@gmail.com>
Sat, 24 Sep 2011 10:28:55 +0200
changeset 78807 8068ef5b4dcbd057b25457dafc8e0cf747006e8c
parent 78806 c764918036ab50a93c44c906597e4044ea7a553f
child 78808 a741384059468860ea48a11c58dbf7980ca1ee98
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs686581
milestone9.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 686581 - Disable theming in SVG images. r=roc
layout/reftests/svg/foreignObject-form-no-theme.svg
layout/reftests/svg/foreignObject-form-theme-ref.html
layout/reftests/svg/foreignObject-form-theme.svg
layout/reftests/svg/foreignObject-img-form-theme-ref.html
layout/reftests/svg/foreignObject-img-form-theme.html
layout/reftests/svg/reftest.list
layout/svg/base/src/svg.css
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-form-no-theme.svg
@@ -0,0 +1,14 @@
+<svg xmlns='http://www.w3.org/2000/svg' width='500' height='200'>
+  <foreignObject width='500' height='500'>
+    <div xmlns='http://www.w3.org/1999/xhtml'>
+      <button style='-moz-appearance:none'>this is a button inside of SVG</button>
+      <br/>
+      <select style='-moz-appearance:none'>
+        <option>This is a menu inside of SVG</option>
+        <option>a second menu option</option>
+      </select>
+    </div>
+  </foreignObject>
+</svg>
+
+<!-- Bug 686581 -->
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-form-theme-ref.html
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>Testcase #2 for bug 686581</title>
+    <style type="text/css">
+
+        html,body {
+            color:black; background-color:white; font-size:16px; padding:0; margin:0;
+        }
+
+    </style>
+</head>
+<body>
+      <button>this is a button inside of SVG</button>
+      <br/>
+      <select>
+        <option>This is a menu inside of SVG</option>
+        <option>a second menu option</option>
+      </select>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-form-theme.svg
@@ -0,0 +1,14 @@
+<svg xmlns='http://www.w3.org/2000/svg' width='500' height='200'>
+  <foreignObject width='500' height='500'>
+    <div xmlns='http://www.w3.org/1999/xhtml'>
+      <button>this is a button inside of SVG</button>
+      <br/>
+      <select>
+        <option>This is a menu inside of SVG</option>
+        <option>a second menu option</option>
+      </select>
+    </div>
+  </foreignObject>
+</svg>
+
+<!-- Bug 686581 -->
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-img-form-theme-ref.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>Testcase for bug 686581</title>
+    <style type="text/css">
+        html,body {
+            color:black; background-color:white; font-size:16px; padding:0; margin:0;
+        }
+    </style>
+</head>
+<body>
+
+<img src="foreignObject-form-no-theme.svg">
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/svg/foreignObject-img-form-theme.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html><head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>Testcase for bug 686581</title>
+    <style type="text/css">
+        html,body {
+            color:black; background-color:white; font-size:16px; padding:0; margin:0;
+        }
+    </style>
+</head>
+<body>
+
+<img src="foreignObject-form-theme.svg">
+
+</body>
+</html>
--- a/layout/reftests/svg/reftest.list
+++ b/layout/reftests/svg/reftest.list
@@ -125,16 +125,18 @@ random == dynamic-use-nested-01.svg dyna
 == foreignObject-02.svg foreignObject-02-ref.svg
 == foreignObject-ancestor-style-change-01.svg foreignObject-ancestor-style-change-01-ref.svg
 == foreignObject-change-transform-01.svg pass.svg
 == foreignObject-display-01.svg pass.svg
 == 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-img-form-theme.html foreignObject-img-form-theme-ref.html
+== foreignObject-form-theme.svg foreignObject-form-theme-ref.html
 == getElementById-a-element-01.svg pass.svg
 == gradient-live-01a.svg gradient-live-01-ref.svg
 == gradient-live-01b.svg gradient-live-01-ref.svg
 == gradient-live-01c.svg gradient-live-01-ref.svg
 == gradient-live-01d.svg gradient-live-01-ref.svg
 fails == inline-in-xul-basic-01.xul pass.svg
 == invalid-text-01.svg pass.svg
 == linearGradient-basic-01.svg pass.svg
--- a/layout/svg/base/src/svg.css
+++ b/layout/svg/base/src/svg.css
@@ -39,25 +39,31 @@
 @namespace url(http://www.w3.org/2000/svg);
 
 style, script, symbol {
  display: none;
 }
 
 switch {
  -moz-binding: none !important;
-} 
+}
 
 svg:not(:root), symbol, image, marker, pattern, foreignObject {
  overflow: hidden;
 }
 
 foreignObject {
   margin: 0 ! important;
   padding: 0 ! important;
   border-width: 0 ! important;
 }
 
+@media all and (-moz-is-resource-document) {
+ foreignObject *|* {
+   -moz-appearance: none;
+ }
+}
+
 *|*::-moz-svg-foreign-content {
   display: block !important;
   position: static !important;
   text-indent: 0;
 }