2010-04-06 23:42:41 +04:00
|
|
|
<!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.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();
|
|
|
|
|
|
|
|
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) {
|
2011-05-01 02:16:19 +04:00
|
|
|
return SpecialPowers.DOMWindowUtils
|
|
|
|
.getVisitedDependentComputedStyle(elem, "", property);
|
2010-04-06 23:42:41 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2010-07-29 01:51:37 +04:00
|
|
|
subwin.removeEventListener("MozAfterPaint", paint_listener, false);
|
2010-04-06 23:42:41 +04:00
|
|
|
var s = document.createElement("script");
|
2010-07-29 01:51:37 +04:00
|
|
|
s.src = "visited_image_loading.sjs?waitforresult";
|
2010-04-06 23:42:41 +04:00
|
|
|
document.body.appendChild(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
</pre>
|
|
|
|
</body>
|
|
|
|
</html>
|