summaryrefslogtreecommitdiffstats
path: root/webkit/data
diff options
context:
space:
mode:
authorager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-02 08:35:45 +0000
committerager@google.com <ager@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-02 08:35:45 +0000
commit7b9531b524c6453abe9bc9c2f77928e7cc0b2965 (patch)
tree1e9cc942349ded7bf28845683158e90137799d16 /webkit/data
parent8177fe1be37353f6a831bfddafec1df32cd109eb (diff)
downloadchromium_src-7b9531b524c6453abe9bc9c2f77928e7cc0b2965.zip
chromium_src-7b9531b524c6453abe9bc9c2f77928e7cc0b2965.tar.gz
chromium_src-7b9531b524c6453abe9bc9c2f77928e7cc0b2965.tar.bz2
Create node wrappers in the context to which the nodes belong instead
of the context of the code accessing them. This fixes the issue where the prototype library does not work if the JavaScript console is open. Review URL: http://codereview.chromium.org/4300 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/data')
-rw-r--r--webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html28
-rw-r--r--webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt1
-rw-r--r--webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html33
3 files changed, 62 insertions, 0 deletions
diff --git a/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html b/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html
new file mode 100644
index 0000000..fe82461
--- /dev/null
+++ b/webkit/data/layout_tests/chrome/fast/dom/resources/wrapper-context-inner.html
@@ -0,0 +1,28 @@
+<html>
+<body onload="RunTest()">
+<script>
+// Used from the top frame to know when this frame has been loaded.
+var loaded = false;
+
+// After the top frame has accessed the document of this frame, we
+// test that the document wrapper was created in this context and
+// not in the top context.
+function RunTest() {
+ loaded = true;
+ if (top.innerDocument) {
+ var paragraph = document.createElement('p');
+ if (HTMLElement.prototype.isPrototypeOf(paragraph)) {
+ top.WriteOutput("PASS");
+ } else {
+ top.WriteOutput("FAIL");
+ }
+ if (window.layoutTestController) {
+ layoutTestController.notifyDone();
+ }
+ } else {
+ setTimeout(RunTest, 100);
+ }
+}
+</script>
+</body>
+</html>
diff --git a/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt
new file mode 100644
index 0000000..0cdd613
--- /dev/null
+++ b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context-expected.txt
@@ -0,0 +1 @@
+PASS
diff --git a/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html
new file mode 100644
index 0000000..e81c40a
--- /dev/null
+++ b/webkit/data/layout_tests/chrome/fast/dom/wrapper-context.html
@@ -0,0 +1,33 @@
+<html>
+<body onload="AccessInnerDocument()">
+<div id="output"></div>
+<iframe id="inner" src="resources/wrapper-context-inner.html"></iframe>
+<script>
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+}
+
+// Write to the output div.
+function WriteOutput(s) {
+ var paragraph = document.createElement("p");
+ paragraph.innerHTML = s;
+ document.getElementById("output").appendChild(paragraph);
+}
+
+// Used from the inner frame to know when this frame has accessed
+// the document of the inner frame.
+var innerDocument;
+
+// Once the inner frame has loaded, access it's document and assign
+// the wrapper to innerDocument.
+function AccessInnerDocument() {
+ if (inner.loaded) {
+ innerDocument = inner.document;
+ } else {
+ setTimeout(AccessInnerDocument, 100);
+ }
+}
+</script>
+</body>
+</html>