summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html')
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html37
1 files changed, 37 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html
new file mode 100644
index 0000000..ca6fa16
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime-2.html
@@ -0,0 +1,37 @@
+<html>
+<link rel="stylesheet" type="text/css" href="theme.css"/>
+
+<script>
+function runTest() {
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var linkElement = document.getElementsByTagName('link')[0];
+ var styleSheet = linkElement.sheet;
+
+ // delete link element
+ linkElement.parentNode.removeChild(linkElement);
+ linkElement = null;
+
+ if (window.gc) {
+ window.gc();
+ } else if (GCController) {
+ GCController.collect();
+ } else {
+ for (var i = 0; i < 10000; i++)
+ new Object();
+ }
+ styleSheet.ownerNode.cloneNode();
+
+ document.getElementById("result").innerHTML = "Test passed.";
+}
+</script>
+<body onload="runTest()">
+<p>
+This test verifies that style sheet do not outlive their elements.
+Since you can get back to the element with the ownerNode attribute,
+it's important to keep the element alive.
+</p>
+<p id="result">TEST HAS NOT RUN YET.</p>
+</body>
+</html>