Index: LayoutTests/http/tests/resources/testharnessreport.js |
diff --git a/LayoutTests/http/tests/resources/testharnessreport.js b/LayoutTests/http/tests/resources/testharnessreport.js |
index 6e35da5ae1715880635e00aab9953c2dfa84b657..4ef8b70f334d49351eddd706ea87772f1f7588f3 100644 |
--- a/LayoutTests/http/tests/resources/testharnessreport.js |
+++ b/LayoutTests/http/tests/resources/testharnessreport.js |
@@ -109,14 +109,16 @@ add_completion_callback(function (tests, harness_status) { |
} |
} |
- // Add results element to document |
+ // Add results element to document. |
+ if (!document.body) |
+ document.documentElement.appendChild(document.createElement("body")); |
document.body.appendChild(results); |
if (self.testRunner) |
testRunner.notifyDone(); |
} |
- if (!document.body || document.readyState === 'loading') { |
+ if (document.readyState === 'loading') { |
window.addEventListener('load', done); |
} else { |
done(); |