Bug 1089417 patch 3 - Add mochitest. r=heycam

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.
This commit is contained in:
L. David Baron 2014-12-05 15:50:00 -08:00
Родитель 5e88cfd187
Коммит f7ac009fee
3 изменённых файлов: 59 добавлений и 0 удалений

Просмотреть файл

@ -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>

Просмотреть файл

@ -105,6 +105,8 @@ support-files = file_bug645998-1.css file_bug645998-2.css
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]

Просмотреть файл

@ -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>