summaryrefslogtreecommitdiffstats
path: root/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html
diff options
context:
space:
mode:
Diffstat (limited to 'LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html')
-rw-r--r--LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html33
1 files changed, 33 insertions, 0 deletions
diff --git a/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html
new file mode 100644
index 0000000..54b1ac4
--- /dev/null
+++ b/LayoutTests/fast/dom/StyleSheet/ownerNode-lifetime.html
@@ -0,0 +1,33 @@
+<head>
+<script>
+function runTest()
+{
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var styleElement = document.createElement('style');
+ var styleSheet = styleElement.sheet;
+ styleElement = null;
+
+ // create lots of objects to force a garbage collection
+ var i = 0;
+ var s;
+ while (i < 5000) {
+ i = i+1.11;
+ s = s + " ";
+ }
+
+ styleSheet.ownerNode.cloneNode();
+
+ document.getElementById("result").innerHTML = "Test passed.";
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>
+This test verifies that style sheets 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>