[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.16-1409-g5afdf4d
jorlow at chromium.org
jorlow at chromium.org
Thu Dec 3 13:19:25 UTC 2009
The following commit has been merged in the webkit-1.1 branch:
commit 3344bce0f9d750d7ae187be3c516b52e0264c14d
Author: jorlow at chromium.org <jorlow at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 26 20:11:41 2009 +0000
2009-10-21 Jeremy Orlow <jorlow at chromium.org>
Reviewed by Darin Adler.
Storage events should use Document::url() rather than documentURI()
https://bugs.webkit.org/show_bug.cgi?id=30535
Storage events should use Document::url() rather than Document::documentURI()
per http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-October/023703.html
Test: storage/domstorage/documentURI.html
* storage/StorageEventDispatcher.cpp:
(WebCore::StorageEventDispatcher::dispatch):
2009-10-26 Sam Weinig <sam at webkit.org>
Rubber-stamped by Darin Adler.
Rollout r50041-50043. The HTML5 spec changed to make HTMLOptionsCollection
inherit from HTMLCollection.
* fast/dom/wrapper-classes-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50088 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index db17691..cf80f32 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -539,6 +539,26 @@
2009-10-21 Jeremy Orlow <jorlow at chromium.org>
+ Storage events should use Document::url() rather than documentURI()
+ https://bugs.webkit.org/show_bug.cgi?id=30535
+
+ Storage events should use Document::url() rather than Document::documentURI()
+ per http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-October/023703.html
+
+ Add a test for this. Since storage events are sync, re-order when
+ evalAndLog logs and evaluates instructions.
+
+ * fast/js/resources/js-test-pre.js:
+ (evalAndLog):
+ * storage/domstorage/documentURI-expected.txt: Added.
+ * storage/domstorage/documentURI.html: Added.
+ * storage/domstorage/script-tests/documentURI.js: Added.
+ (test):
+ (firstEvent):
+ (secondEvent):
+
+2009-10-21 Jeremy Orlow <jorlow at chromium.org>
+
Reviewed by Darin Adler.
Combine local and session storage tests into one and use script-tests properly
diff --git a/LayoutTests/fast/js/resources/js-test-pre.js b/LayoutTests/fast/js/resources/js-test-pre.js
index 4d4651a..a393a3e 100644
--- a/LayoutTests/fast/js/resources/js-test-pre.js
+++ b/LayoutTests/fast/js/resources/js-test-pre.js
@@ -76,18 +76,16 @@ function evalAndLog(_a)
{
if (typeof _a != "string")
debug("WARN: tryAndLog() expects a string argument");
- var exception;
+
+ // Log first in case things go horribly wrong or this causes a sync event.
+ debug(_a);
+
var _av;
try {
_av = eval(_a);
} catch (e) {
- exception = e;
+ testFailed(_a + " threw exception " + e);
}
-
- if (exception)
- testFailed(_a + " threw exception " + exception);
- else
- debug(_a);
}
function shouldBe(_a, _b)
diff --git a/LayoutTests/storage/domstorage/documentURI-expected.txt b/LayoutTests/storage/domstorage/documentURI-expected.txt
new file mode 100644
index 0000000..6bccdb0
--- /dev/null
+++ b/LayoutTests/storage/domstorage/documentURI-expected.txt
@@ -0,0 +1,37 @@
+Test that changing documentURI has no effects on storage events.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Testing sessionStorage
+storage.clear()
+PASS storage.length is 0
+window.onstorage = firstEvent
+storage.foo = '123'
+First event fired
+Saving URI
+document.documentURI = 'abc'
+PASS document.documentURI is "abc"
+window.onstorage = secondEvent
+storage.foo = 'xyz'
+Second event fired
+PASS true is true
+
+
+Testing localStorage
+storage.clear()
+PASS storage.length is 0
+window.onstorage = firstEvent
+storage.foo = '123'
+First event fired
+Saving URI
+document.documentURI = 'abc'
+PASS document.documentURI is "abc"
+window.onstorage = secondEvent
+storage.foo = 'xyz'
+Second event fired
+PASS true is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/storage/domstorage/documentURI.html b/LayoutTests/storage/domstorage/documentURI.html
new file mode 100644
index 0000000..01f6a98
--- /dev/null
+++ b/LayoutTests/storage/domstorage/documentURI.html
@@ -0,0 +1,12 @@
+<html>
+<head>
+<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<script src="../../fast/js/resources/js-test-post-function.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="script-tests/documentURI.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/storage/domstorage/script-tests/documentURI.js b/LayoutTests/storage/domstorage/script-tests/documentURI.js
new file mode 100644
index 0000000..93fb08b
--- /dev/null
+++ b/LayoutTests/storage/domstorage/script-tests/documentURI.js
@@ -0,0 +1,50 @@
+description("Test that changing documentURI has no effects on storage events.");
+
+function test(storageString)
+{
+ window.storage = eval(storageString);
+ if (!storage) {
+ testFailed(storageString + " DOES NOT exist");
+ return;
+ }
+
+ debug("Testing " + storageString);
+
+ window.onstorage = null;
+ evalAndLog("storage.clear()");
+ shouldBe("storage.length", "0");
+
+ evalAndLog("window.onstorage = firstEvent");
+ evalAndLog("storage.foo = '123'");
+}
+
+function firstEvent(e)
+{
+ debug("First event fired");
+ debug("Saving URI");
+ window.lastURI = e.uri;
+
+ evalAndLog("document.documentURI = 'abc'");
+ shouldBeEqualToString("document.documentURI", "abc");
+
+ evalAndLog("window.onstorage = secondEvent");
+ evalAndLog("storage.foo = 'xyz'");
+}
+
+function secondEvent(e)
+{
+ debug("Second event fired");
+ shouldBeTrue(String(window.lastURI == e.uri));
+
+ if (done) {
+ window.successfullyParsed = true;
+ isSuccessfullyParsed();
+ }
+}
+
+window.done = false;
+test("sessionStorage");
+debug("");
+debug("");
+window.done = true;
+test("localStorage");
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 393e69a..804df25 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-21 Jeremy Orlow <jorlow at chromium.org>
+
+ Reviewed by Darin Adler.
+
+ Storage events should use Document::url() rather than documentURI()
+ https://bugs.webkit.org/show_bug.cgi?id=30535
+
+ Storage events should use Document::url() rather than Document::documentURI()
+ per http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-October/023703.html
+
+ Test: storage/domstorage/documentURI.html
+
+ * storage/StorageEventDispatcher.cpp:
+ (WebCore::StorageEventDispatcher::dispatch):
+
2009-10-26 Sam Weinig <sam at webkit.org>
Rubber-stamped by Darin Adler.
diff --git a/WebCore/storage/StorageEventDispatcher.cpp b/WebCore/storage/StorageEventDispatcher.cpp
index d2eab66..9763e07 100644
--- a/WebCore/storage/StorageEventDispatcher.cpp
+++ b/WebCore/storage/StorageEventDispatcher.cpp
@@ -55,7 +55,7 @@ void StorageEventDispatcher::dispatch(const String& key, const String& oldValue,
}
for (unsigned i = 0; i < frames.size(); ++i)
- frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->documentURI(), frames[i]->domWindow()->sessionStorage()));
+ frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->sessionStorage()));
} else {
// Send events to every page.
const HashSet<Page*>& pages = page->group().pages();
@@ -68,7 +68,7 @@ void StorageEventDispatcher::dispatch(const String& key, const String& oldValue,
}
for (unsigned i = 0; i < frames.size(); ++i)
- frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->documentURI(), frames[i]->domWindow()->localStorage()));
+ frames[i]->document()->dispatchWindowEvent(StorageEvent::create(eventNames().storageEvent, key, oldValue, newValue, sourceFrame->document()->url(), frames[i]->domWindow()->localStorage()));
}
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list