4 https://bugzilla.mozilla.org/show_bug.cgi?id=557287
7 <title>Test for Bug
557287</title>
8 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
12 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=557287">Mozilla Bug
147777</a>
14 <script type=
"application/ecmascript" src=
"visited_image_loading.sjs?reset"></script>
15 <script type=
"application/javascript">
17 /** Test for Bug
557287 **/
19 SimpleTest.waitForExplicitFinish();
20 SimpleTest.requestFlakyTimeout(
"untriaged");
24 window.addEventListener(
"load", run);
28 subwin = window.open(
"visited_image_loading_frame.html",
"_blank");
29 subwin.addEventListener(
"load", function() {
30 subdoc = subwin.document;
31 setTimeout(check_link_styled,
50);
35 function visitedDependentComputedStyle(win, elem, property) {
36 return SpecialPowers.DOMWindowUtils
37 .getVisitedDependentComputedStyle(elem,
"", property);
40 function check_link_styled()
42 var vislink = subdoc.getElementById(
"visited");
44 visitedDependentComputedStyle(subwin, vislink,
"background-color");
45 if (bgcolor ==
"rgb(128, 0, 128)") {
46 // We've done our async :visited processing and restyled accordingly.
47 // Make sure that we've actually painted before finishing the test.
48 subwin.addEventListener(
"MozAfterPaint", paint_listener);
49 // do something that forces a paint
50 subdoc.body.appendChild(subdoc.createTextNode(
"new text node"));
52 setTimeout(check_link_styled,
50);
56 function paint_listener(event)
58 subwin.removeEventListener(
"MozAfterPaint", paint_listener);
59 var s = document.createElement(
"script");
60 s.src =
"visited_image_loading.sjs?waitforresult";
61 document.body.appendChild(s);