[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.20-204-g221d8e8
beidson at apple.com
beidson at apple.com
Wed Feb 10 22:11:54 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 12ac851a005f93e725724e429435fe6a82791988
Author: beidson at apple.com <beidson at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 4 03:28:12 2010 +0000
REGRESSION (r51644): WebCore/manual-tests/linkjump-1.html fails
<rdar://problem/7595694> and https://bugs.webkit.org/show_bug.cgi?id=34550
Reviewed by Alexey Proskuryakov.
WebCore:
Tests: fast/loader/document-with-fragment-url-1.html
fast/loader/document-with-fragment-url-2.html
fast/loader/document-with-fragment-url-3.html
fast/loader/document-with-fragment-url-4.html
* platform/KURL.cpp:
(WebCore::KURL::init): When resolving new URL from an empty reference relative to an absolute URL,
any fragment identifier from the absolute URL should be removed from the resulting resolution.
LayoutTests:
* fast/loader/document-with-fragment-url-1-expected.txt: Added.
* fast/loader/document-with-fragment-url-1.html: Added.
* fast/loader/document-with-fragment-url-2-expected.txt: Added.
* fast/loader/document-with-fragment-url-2.html: Added.
* fast/loader/document-with-fragment-url-3-expected.txt: Added.
* fast/loader/document-with-fragment-url-3.html: Added.
* fast/loader/document-with-fragment-url-4-expected.txt: Added.
* fast/loader/document-with-fragment-url-4.html: Added.
* fast/loader/resources/document-with-fragment-url-test.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 7eaf353..5bff8b4 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-03 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ REGRESSION (r51644): WebCore/manual-tests/linkjump-1.html fails
+ <rdar://problem/7595694> and https://bugs.webkit.org/show_bug.cgi?id=34550
+
+ * fast/loader/document-with-fragment-url-1-expected.txt: Added.
+ * fast/loader/document-with-fragment-url-1.html: Added.
+ * fast/loader/document-with-fragment-url-2-expected.txt: Added.
+ * fast/loader/document-with-fragment-url-2.html: Added.
+ * fast/loader/document-with-fragment-url-3-expected.txt: Added.
+ * fast/loader/document-with-fragment-url-3.html: Added.
+ * fast/loader/document-with-fragment-url-4-expected.txt: Added.
+ * fast/loader/document-with-fragment-url-4.html: Added.
+ * fast/loader/resources/document-with-fragment-url-test.html: Added.
+
2010-02-03 Fumitoshi Ukai <ukai at chromium.org>
Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-1-expected.txt b/LayoutTests/fast/loader/document-with-fragment-url-1-expected.txt
new file mode 100644
index 0000000..af29586
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-1-expected.txt
@@ -0,0 +1,6 @@
+ALERT: First load complete. URL's current hash is
+ALERT: Hash changed to #foo
+ALERT: Second load complete. URL's current hash is
+Click the following link to navigate to #foo on this page. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.
+Click here to go to #foo
+Click here to return to the original page with the original url
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-1.html b/LayoutTests/fast/loader/document-with-fragment-url-1.html
new file mode 100644
index 0000000..13cd245
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-1.html
@@ -0,0 +1,55 @@
+<script>
+
+if (!sessionStorage.in_document_with_fragment_url_1)
+ sessionStorage.in_document_with_fragment_url_1 = true;
+else
+ delete sessionStorage.in_document_with_fragment_url_1;
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function documentURLHash()
+{
+ var index = document.URL.lastIndexOf("#");
+ if (index == -1)
+ return "";
+ return document.URL.substring(index);
+}
+
+function hashChanged()
+{
+ alert("Hash changed to " + documentURLHash());
+ setTimeout("clickSecondAnchor();", 0);
+}
+
+function clickSecondAnchor()
+{
+ var rect = document.getElementById("secondanchor").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+}
+
+function loaded()
+{
+ if (sessionStorage.in_document_with_fragment_url_1) {
+ alert("First load complete. URL's current hash is " + documentURLHash());
+ var rect = document.getElementById("firstanchor").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ } else {
+ alert("Second load complete. URL's current hash is " + documentURLHash());
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+</script>
+<body onhashchange="hashChanged();" onload="loaded();">
+Click the following link to navigate to #foo on this page. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.<br>
+<a id="firstanchor" href="#foo">Click here to go to #foo</a><br>
+<div id="foo"><a id="secondanchor" href="">Click here to return to the original page with the original url</a></div>
+</body>
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-2-expected.txt b/LayoutTests/fast/loader/document-with-fragment-url-2-expected.txt
new file mode 100644
index 0000000..e5dd0e6
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-2-expected.txt
@@ -0,0 +1,5 @@
+ALERT: First load complete. URL's current hash is #foo
+ALERT: Second load complete. URL's current hash is
+Click here to go to the top of the page
+
+This page should manually be loaded with "#foo" appended to the URL. When you then click the link, the page should navigate to the url without #foo.
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-2.html b/LayoutTests/fast/loader/document-with-fragment-url-2.html
new file mode 100644
index 0000000..25929c2
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-2.html
@@ -0,0 +1,9 @@
+<script>
+if (window.layoutTestController) {
+ layoutTestController.waitUntilDone();
+ layoutTestController.dumpAsText();
+}
+
+location = "resources/document-with-fragment-url-test.html#foo";
+
+</script>
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-3-expected.txt b/LayoutTests/fast/loader/document-with-fragment-url-3-expected.txt
new file mode 100644
index 0000000..232c56c
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-3-expected.txt
@@ -0,0 +1,5 @@
+ALERT: First load complete. URL's current hash is
+ALERT: After pushState, the URL's current hash is #foo
+ALERT: Second load complete. URL's current hash is
+This page uses history.pushState() to add #foo to its URL. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.
+Click here to return to the original page with the original url
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-3.html b/LayoutTests/fast/loader/document-with-fragment-url-3.html
new file mode 100644
index 0000000..c5d296e
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-3.html
@@ -0,0 +1,47 @@
+<script>
+
+if (!sessionStorage.in_document_with_fragment_url_3)
+ sessionStorage.in_document_with_fragment_url_3 = true;
+else
+ delete sessionStorage.in_document_with_fragment_url_3;
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function documentURLHash()
+{
+ var index = document.URL.lastIndexOf("#");
+ if (index == -1)
+ return "";
+ return document.URL.substring(index);
+}
+
+function hashChanged()
+{
+ alert("Hash changed to " + documentURLHash() + " which is interesting because we shouldn't get a hashchange event in this test.");
+}
+
+function loaded()
+{
+ if (sessionStorage.in_document_with_fragment_url_3) {
+ alert("First load complete. URL's current hash is " + documentURLHash());
+ history.pushState(null, null, "#foo");
+ alert("After pushState, the URL's current hash is " + documentURLHash());
+ var rect = document.getElementById("clickanchor").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ } else {
+ alert("Second load complete. URL's current hash is " + documentURLHash());
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+</script>
+<body onhashchange="hashChanged();" onload="loaded();">
+This page uses history.pushState() to add #foo to its URL. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.<br>
+<a id="clickanchor" href="">Click here to return to the original page with the original url</a>
+</body>
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-4-expected.txt b/LayoutTests/fast/loader/document-with-fragment-url-4-expected.txt
new file mode 100644
index 0000000..f81f485
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-4-expected.txt
@@ -0,0 +1,5 @@
+ALERT: First load complete. URL's current hash is
+ALERT: After replaceState, the URL's current hash is #foo
+ALERT: Second load complete. URL's current hash is
+This page uses history.replaceState() to add #foo to its URL. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.
+Click here to return to the original page with the original url
diff --git a/LayoutTests/fast/loader/document-with-fragment-url-4.html b/LayoutTests/fast/loader/document-with-fragment-url-4.html
new file mode 100644
index 0000000..91be256
--- /dev/null
+++ b/LayoutTests/fast/loader/document-with-fragment-url-4.html
@@ -0,0 +1,47 @@
+<script>
+
+if (!sessionStorage.in_document_with_fragment_url_4)
+ sessionStorage.in_document_with_fragment_url_4 = true;
+else
+ delete sessionStorage.in_document_with_fragment_url_4;
+
+if (window.layoutTestController) {
+ layoutTestController.dumpAsText();
+ layoutTestController.waitUntilDone();
+}
+
+function documentURLHash()
+{
+ var index = document.URL.lastIndexOf("#");
+ if (index == -1)
+ return "";
+ return document.URL.substring(index);
+}
+
+function hashChanged()
+{
+ alert("Hash changed to " + documentURLHash() + " which is interesting because we shouldn't get a hashchange event in this test.");
+}
+
+function loaded()
+{
+ if (sessionStorage.in_document_with_fragment_url_4) {
+ alert("First load complete. URL's current hash is " + documentURLHash());
+ history.replaceState(null, null, "#foo");
+ alert("After replaceState, the URL's current hash is " + documentURLHash());
+ var rect = document.getElementById("clickanchor").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ } else {
+ alert("Second load complete. URL's current hash is " + documentURLHash());
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+</script>
+<body onhashchange="hashChanged();" onload="loaded();">
+This page uses history.replaceState() to add #foo to its URL. Then click the second link, which has an empty href and should take you back to the original URL without the #foo.<br>
+<a id="clickanchor" href="">Click here to return to the original page with the original url</a>
+</body>
diff --git a/LayoutTests/fast/loader/resources/document-with-fragment-url-test.html b/LayoutTests/fast/loader/resources/document-with-fragment-url-test.html
new file mode 100644
index 0000000..33fa440
--- /dev/null
+++ b/LayoutTests/fast/loader/resources/document-with-fragment-url-test.html
@@ -0,0 +1,40 @@
+<script>
+
+if (!sessionStorage.in_document_with_fragment_url_2)
+ sessionStorage.in_document_with_fragment_url_2 = true;
+else
+ delete sessionStorage.in_document_with_fragment_url_2;
+
+function documentURLHash()
+{
+ var index = document.URL.lastIndexOf("#");
+ if (index == -1)
+ return "";
+ return document.URL.substring(index);
+}
+
+function hashChanged()
+{
+ alert("hashChanged to " + documentURLHash() + " which is interesting because this particular test shouldn't generated a hashchange event");
+}
+
+function loaded()
+{
+ if (sessionStorage.in_document_with_fragment_url_2) {
+ alert("First load complete. URL's current hash is " + documentURLHash());
+ var rect = document.getElementById("clickElement").getBoundingClientRect();
+ eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ } else {
+ alert("Second load complete. URL's current hash is " + documentURLHash());
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+ }
+}
+
+</script>
+<body onhashchange="hashChanged();" onload="loaded();">
+<div id="foo"><a id="clickElement" href="">Click here to go to the top of the page</a></div><br>
+This page should manually be loaded with "#foo" appended to the URL. When you then click the link, the page should navigate to the url without #foo.
+</body>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f858f9b..df95afa 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,19 @@
+2010-02-03 Brady Eidson <beidson at apple.com>
+
+ Reviewed by Alexey Proskuryakov.
+
+ REGRESSION (r51644): WebCore/manual-tests/linkjump-1.html fails
+ <rdar://problem/7595694> and https://bugs.webkit.org/show_bug.cgi?id=34550
+
+ Tests: fast/loader/document-with-fragment-url-1.html
+ fast/loader/document-with-fragment-url-2.html
+ fast/loader/document-with-fragment-url-3.html
+ fast/loader/document-with-fragment-url-4.html
+
+ * platform/KURL.cpp:
+ (WebCore::KURL::init): When resolving new URL from an empty reference relative to an absolute URL,
+ any fragment identifier from the absolute URL should be removed from the resulting resolution.
+
2010-02-03 Kwang Yul Seo <skyul at company100.net>
Reviewed by Eric Seidel.
diff --git a/WebCore/platform/KURL.cpp b/WebCore/platform/KURL.cpp
index b059c44..79bb6e2 100644
--- a/WebCore/platform/KURL.cpp
+++ b/WebCore/platform/KURL.cpp
@@ -422,9 +422,9 @@ void KURL::init(const KURL& base, const String& relative, const TextEncoding& en
switch (str[0]) {
case '\0':
- // the reference must be empty - the RFC says this is a
- // reference to the same document
+ // The reference is empty, so this is a reference to the same document with any fragment identifier removed.
*this = base;
+ removeFragmentIdentifier();
break;
case '#': {
// must be fragment-only reference
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list