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..bce3fda1a53ac287f784da216ab935fd508327ab |
--- /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"> |
+</head> |
+<body> |
+<script> |
+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> |