diff options
author | fqian@google.com <fqian@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-10 16:42:41 +0000 |
---|---|---|
committer | fqian@google.com <fqian@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-10 16:42:41 +0000 |
commit | 6501779376fc890a5613519050756a9d6cf48ee8 (patch) | |
tree | d14bf31d29d2bfbcd4515feeb9902e65e3e67ff2 /webkit/data/layout_tests | |
parent | fca43faacfed770dd87246fdd2367df955b3df86 (diff) | |
download | chromium_src-6501779376fc890a5613519050756a9d6cf48ee8.zip chromium_src-6501779376fc890a5613519050756a9d6cf48ee8.tar.gz chromium_src-6501779376fc890a5613519050756a9d6cf48ee8.tar.bz2 |
BUG = 1357667
Redo the fix of issue 1357667. Previous fix does not address all cases (HTMLLinkElement.sheet).
It works by create a hidden reference from JS wrapper of StyleSheet object to its owner node.
This is down when creating the JS wrapper object.
Add a test for HTMLLinkElement that crashes both Chrome and Safari 3.1.2.
Review URL: http://codereview.chromium.org/1678
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/data/layout_tests')
2 files changed, 38 insertions, 0 deletions
diff --git a/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2-expected.txt b/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2-expected.txt new file mode 100644 index 0000000..5e51726 --- /dev/null +++ b/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2-expected.txt @@ -0,0 +1,3 @@ +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. + +Test passed. diff --git a/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2.html b/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2.html new file mode 100644 index 0000000..bf6d252 --- /dev/null +++ b/webkit/data/layout_tests/pending/fast/dom/StyleSheet/ownerNode-lifetime-expected-2.html @@ -0,0 +1,35 @@ +<html> +<link rel="stylesheet" type="text/css" src="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 { + for (var i = 0; i < 5000; 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> |