Bug 1035091 - Add a reftest to ensure @-moz-document works with user sheets. r=cam
authorMasatoshi Kimura <VYV03354@nifty.ne.jp>
Sat, 17 Dec 2016 11:07:36 +0900
changeset 327098 698b5719c9ee
parent 327097 15f2799c3990
child 327099 7e747433d1c9
push id31119
push userkwierso@gmail.com
push dateFri, 23 Dec 2016 22:34:59 +0000
treeherdermozilla-central@da22155a2dc3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscam
bugs1035091
milestone53.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 1035091 - Add a reftest to ensure @-moz-document works with user sheets. r=cam MozReview-Commit-ID: DJWlDO0cODd
layout/reftests/usercss/usercss-ref.html
layout/reftests/usercss/usercss.html
layout/tools/reftest/chrome/userContent.css
--- a/layout/reftests/usercss/usercss-ref.html
+++ b/layout/reftests/usercss/usercss-ref.html
@@ -1,10 +1,12 @@
 <!DOCTYPE html>
 <html>
 <head>
 <style>p { background-color: lime; }</style>
 </head>
 <body>
 <p>This paragraph should have a green background.</p>
 <p>This paragraph should have a green background, too.</p>
+<p>@-moz-document rules should be applied.</p>
+<p>@-moz-document rules should not be applied.</p>
 </body>
 </html>
--- a/layout/reftests/usercss/usercss.html
+++ b/layout/reftests/usercss/usercss.html
@@ -1,10 +1,19 @@
 <!DOCTYPE html>
 <html class="reftest-wait">
 <head>
-<style>p { background-color: red; }</style>
+<style>
+p {
+  background-color: red;
+}
+.reftest-xdomain {
+  background: lime;
+}
+</style>
 </head>
 <body>
 <p class="reftest-usercss">This paragraph should have a green background.</p>
 <p class="reftest-userxbl">This paragraph should have a green background, too.</p>
+<p class="reftest-domain">@-moz-document rules should be applied.</p>
+<p class="reftest-xdomain">@-moz-document rules should not be applied.</p>
 </body>
 </html>
--- a/layout/tools/reftest/chrome/userContent.css
+++ b/layout/tools/reftest/chrome/userContent.css
@@ -1,6 +1,20 @@
 .reftest-usercss {
   background: lime !important;
 }
 .reftest-userxbl {
   -moz-binding: url("binding.xml#reftest-userxbl") !important;
 }
+/*
+ * file: URLs have an empty domain.
+ * Android uses special loopback-to-host address.
+ */
+@-moz-document domain(), domain(10.0.2.2) {
+  .reftest-domain {
+    background: lime !important;
+  }
+}
+@-moz-document domain(example.invalid) {
+  .reftest-xdomain {
+    background: red !important;
+  }
+}