Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null.html

Issue 18854017: StyleSheet.ownerNode should be null when it gets orphaned. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/StyleSheet/discarded-sheet-owner-null-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698