Index: LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml |
diff --git a/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml b/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml |
index a18026e3bd5aa53c24142094a9a47cfb2417c25e..5b0e7c3d97f84409f5e22251bd1253a884c44a8f 100644 |
--- a/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml |
+++ b/LayoutTests/fast/dom/StyleSheet/detached-style-pi-2.xhtml |
@@ -8,8 +8,11 @@ |
Test that <xml-stylesheet> processing instructions only have stylesheets when in document.</p> |
<pre id="result"></pre> |
<script> |
-if (window.testRunner) |
+<![CDATA[ |
+if (window.testRunner) { |
testRunner.dumpAsText(); |
+ testRunner.waitUntilDone(); |
+} |
sheet = document.styleSheets[0]; |
pi = document.firstChild; |
@@ -22,13 +25,25 @@ function finishTest() |
result.innerHTML += "Not in document: " + ((pi.sheet === null) ? "PASS" : ("FAIL: " + pi.sheet)) + "\n"; |
document.appendChild(pi); |
+ window.requestAnimationFrame(finishTest2); |
+} |
- // This subtest fails in Firefox 4.0b8 - apparently, adding a processing instruction doens't trigger load. |
- result.innerHTML += "After adding to document: " + ((pi.sheet === null) ? ("FAIL: " + pi.sheet) : "PASS") + "\n"; |
+var retryCount = 0; |
+function finishTest2() { |
+ // This subtest may fail because loading the resource may not complete immediately after |
+ // appendChild(). |
+ if (pi.sheet === null && ++retryCount < 10) { |
+ window.requestAnimationFrame(finishTest2); |
+ return; |
+ } |
+ |
+ result.innerHTML += "After adding to document: " + ((pi.sheet === null) ? ("FAIL: " + pi.sheet) : "PASS") + "\n"; |
result.innerHTML += "DONE"; |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
} |
- |
+]]> |
</script> |
</body> |
</html> |