Bug 1089417 - Part 3: Add mochitest. r=heycam, a=sledru
authorL. David Baron <dbaron@dbaron.org>
Fri, 05 Dec 2014 15:50:00 -0800
changeset 242336 b2ab9b758ab6c75e790a85efe81f958fa56011eb
parent 242335 add920aeb727f1a058fe910bbc163d2db0ccd37a
child 242337 951c959937211dece83e8736f1544edbc8ecd024
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam, sledru
bugs1089417
milestone36.0a2
Bug 1089417 - Part 3: Add mochitest. r=heycam, a=sledru Note that if I make the style element currently /* empty */ have a rule in it, the test passes. Patch 8 also makes the test pass.
layout/style/test/file_bug1089417_iframe.html
layout/style/test/mochitest.ini
layout/style/test/test_bug1089417.html
new file mode 100644
--- /dev/null
+++ b/layout/style/test/file_bug1089417_iframe.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <title>Bug 1089417</title>
+  <style>
+    html { background: red }
+    @media (min-height: 300px) { html { background: green } }
+  </style>
+  <style id="s">/* empty */</style>
+  <script>
+    document.getElementById("s").disabled = true;
+  </script>
+</head>
+<body>
+
+</body>
+</html>
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -100,16 +100,18 @@ support-files = file_bug645998-1.css fil
 [test_bug771043.html]
 [test_bug798567.html]
 [test_bug798843_pref.html]
 [test_bug829816.html]
 [test_bug874919.html]
 support-files = file_bug829816.css
 [test_bug887741_at-rules_in_declaration_lists.html]
 [test_bug892929.html]
+[test_bug1089417.html]
+support-files = file_bug1089417_iframe.html
 [test_cascade.html]
 [test_ch_ex_no_infloops.html]
 [test_compute_data_with_start_struct.html]
 skip-if = toolkit == 'android'
 [test_computed_style.html]
 [test_computed_style_no_pseudo.html]
 [test_computed_style_prefs.html]
 [test_condition_text.html]
new file mode 100644
--- /dev/null
+++ b/layout/style/test/test_bug1089417.html
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=1089417
+-->
+<head>
+  <meta charset="utf-8">
+  <title>Test for Bug 1089417</title>
+  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+  <script type="application/javascript">
+
+  /** Test for Bug 1089417 **/
+
+  SimpleTest.waitForExplicitFinish();
+
+  function run() {
+    var f = document.getElementById("f");
+    var fwin = f.contentWindow;
+    var fdoc = f.contentDocument;
+
+    f.height = "400";
+    fdoc.getElementById("s").disabled = false;
+    todo_is(fwin.getComputedStyle(fdoc.documentElement).backgroundColor,
+       "rgb(0, 128, 0)",
+       "media query change should have restyled");
+    SimpleTest.finish();
+  }
+
+  </script>
+</head>
+<body onload="run()">
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1089417">Mozilla Bug 1089417</a>
+<div id="display">
+  <iframe id="f" src="file_bug1089417_iframe.html" width="300" height="200"></iframe>
+</div>
+<pre id="test">
+</pre>
+</body>
+</html>