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 327036 698b5719c9ee
parent 327035 15f2799c3990
child 327037 7e747433d1c9
push id85085
push userVYV03354@nifty.ne.jp
push dateThu, 22 Dec 2016 23:14:32 +0000
treeherdermozilla-inbound@698b5719c9ee [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;
+  }
+}