summaryrefslogtreecommitdiffstats
path: root/layout/style/test/test_visited_image_loading_empty.html
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /layout/style/test/test_visited_image_loading_empty.html
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/style/test/test_visited_image_loading_empty.html')
-rw-r--r--layout/style/test/test_visited_image_loading_empty.html67
1 files changed, 67 insertions, 0 deletions
diff --git a/layout/style/test/test_visited_image_loading_empty.html b/layout/style/test/test_visited_image_loading_empty.html
new file mode 100644
index 000000000..42b7c7aff
--- /dev/null
+++ b/layout/style/test/test_visited_image_loading_empty.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML>
+<html>
+<!--
+https://bugzilla.mozilla.org/show_bug.cgi?id=557287
+-->
+<head>
+ <title>Test for Bug 557287</title>
+ <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
+ <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
+</head>
+<body>
+<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=557287">Mozilla Bug 147777</a>
+<iframe id="display" src="visited_image_loading_frame_empty.html"></iframe>
+<pre id="test">
+<script type="application/ecmascript" src="visited_image_loading.sjs?reset"></script>
+<script type="application/javascript">
+
+/** Test for Bug 557287 **/
+
+SimpleTest.waitForExplicitFinish();
+SimpleTest.requestFlakyTimeout("untriaged");
+
+var subdoc, subwin;
+
+window.addEventListener("load", run, false);
+
+function run()
+{
+ var frame = document.getElementById("display");
+ subdoc = frame.contentDocument;
+ subwin = frame.contentWindow;
+ setTimeout(check_link_styled, 50);
+}
+
+function visitedDependentComputedStyle(win, elem, property) {
+ return SpecialPowers.DOMWindowUtils
+ .getVisitedDependentComputedStyle(elem, "", property);
+}
+
+function check_link_styled()
+{
+ var vislink = subdoc.getElementById("visited");
+ var bgcolor =
+ visitedDependentComputedStyle(subwin, vislink, "background-color");
+ if (bgcolor == "rgb(128, 0, 128)") {
+ // We've done our async :visited processing and restyled accordingly.
+ // Make sure that we've actually painted before finishing the test.
+ subwin.addEventListener("MozAfterPaint", paint_listener, false);
+ // do something that forces a paint
+ subdoc.body.appendChild(subdoc.createTextNode("new text node"));
+ } else {
+ setTimeout(check_link_styled, 50);
+ }
+}
+
+function paint_listener(event)
+{
+ subwin.removeEventListener("MozAfterPaint", paint_listener, false);
+ var s = document.createElement("script");
+ s.src = "visited_image_loading.sjs?waitforresult";
+ document.body.appendChild(s);
+}
+
+</script>
+</pre>
+</body>
+</html>