Index: LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null.html |
diff --git a/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null.html b/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..654f8c3d5914c9f5b7367e577336e47558f68bbe |
--- /dev/null |
+++ b/LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null.html |
@@ -0,0 +1,36 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../js/resources/js-test-pre.js"></script> |
+<link id="target", rel="stylesheet" href="old.css"> |
haraken
2013/07/09 05:44:28
Nit: ',' is unnecessary.
|
+</head> |
+<body> |
+<script><!-- |
haraken
2013/07/09 05:44:28
<!-- is unnecessary.
|
+description('This tests that ownerNode of orphan sheet is null.'); |
+ |
+jsTestIsAsync = true; |
+ |
+window.onload = function() |
+{ |
+ oldSheet = target.sheet; |
+ target.setAttribute("href", "new.css"); |
+ |
+ function waitAndTest() { |
+ if (0 <= target.sheet.href.indexOf("old.css")) |
+ return window.setTimeout(waitAndTest, 0); |
+ shouldBeNull("oldSheet.ownerNode"); |
+ if (oldSheet.ownerNode) |
+ return finishJSTest(); |
+ // We need to exercise cached case as well, which can be executed with a reload. |
+ if (0 <= window.location.toString().indexOf("?reloaded")) |
+ return finishJSTest(); |
+ window.location = window.location.toString() + "?reloaded"; |
+ }; |
+ |
+ window.setTimeout(waitAndTest, 0); |
+}; |
+ |
+--></script> |
+<script src="../../js/resources/js-test-post.js"></script> |
+</body> |
+</html> |