[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 02:00:29 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 89a2486849fc95acb6262b810932b3a6deddcfac
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 26 16:36:33 2010 +0000

    2010-02-26  Dirk Pranke  <dpranke at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Fix the handling of updates to #hash fragments to check for differences
            post-canonicalization rather than comparing pre- to post-. Chromium
            had a bug where we would set the #hash on an about:blank URL and generate
            an onload event because we thought the URL (not just the fragment) was
            changing.
    
            http://bugs.webkit.org/show_bug.cgi?id=35180
    
            * fast/loader/about-blank-hash-change-expected.txt: Added.
            * fast/loader/about-blank-hash-change.html: Added.
    2010-02-26  Dirk Pranke  <dpranke at chromium.org>
    
            Reviewed by Darin Fisher.
    
            Fix the handling of updates to #hash fragments to check for differences
            post-canonicalization rather than comparing pre- to post-. Chromium
            had a bug where we would set the #hash on an about:blank URL and generate
            an onload event because we thought the URL (not just the fragment) was
            changing.
    
            http://bugs.webkit.org/show_bug.cgi?id=35180
    
            Test: fast/loader/about-blank-hash-change.html
    
            * bindings/v8/custom/V8LocationCustom.cpp:
            (WebCore::V8Location::hashAccessorSetter):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55285 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 646c429..2187062 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-02-26  Dirk Pranke  <dpranke at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Fix the handling of updates to #hash fragments to check for differences
+        post-canonicalization rather than comparing pre- to post-. Chromium
+        had a bug where we would set the #hash on an about:blank URL and generate
+        an onload event because we thought the URL (not just the fragment) was
+        changing.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35180
+
+        * fast/loader/about-blank-hash-change-expected.txt: Added.
+        * fast/loader/about-blank-hash-change.html: Added.
+
 2010-02-26  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by David Levin.
diff --git a/LayoutTests/fast/loader/about-blank-hash-change-expected.txt b/LayoutTests/fast/loader/about-blank-hash-change-expected.txt
new file mode 100644
index 0000000..8a1b4fc
--- /dev/null
+++ b/LayoutTests/fast/loader/about-blank-hash-change-expected.txt
@@ -0,0 +1,7 @@
+This test tests parsing of hash fragments in about:blank URLs. Chromium had a bug at one point where setting the hash fragment would cause a load event and in some cases an infinite loop.
+
+See https://bugs.webkit.org/show_bug.cgi?id=35180.
+
+If the text says "PASS" then the onload() event only fired once. If it says "FAIL" then it fired two or more times. Also, the test may time out looping on this event handler (which is also a failure). If the text says "No callback" then something else is broken :)
+
+PASS
diff --git a/LayoutTests/fast/loader/about-blank-hash-change.html b/LayoutTests/fast/loader/about-blank-hash-change.html
new file mode 100644
index 0000000..27f2d57
--- /dev/null
+++ b/LayoutTests/fast/loader/about-blank-hash-change.html
@@ -0,0 +1,29 @@
+<p>This test tests parsing of hash fragments in about:blank URLs. Chromium had
+a bug at one point where setting the hash fragment would cause a load event
+and in some cases an infinite loop.</p>
+
+<p>See <a href="https://bugs.webkit.org/show_bug.cgi?id=35180">
+https://bugs.webkit.org/show_bug.cgi?id=35180</a>.</p>
+
+<p>If the text says "PASS" then the onload() event only fired once. If it
+says "FAIL" then it fired two or more times. Also, the test may time out
+looping on this event handler (which is also a failure). If the text says "No callback" then something else is broken :)</p>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+}
+
+function onload_callback() {
+    var old_hash = inner.location.hash;
+    inner.location.hash = "hash-ref";
+    var c = document.getElementById("content");
+    if (c.innerHTML.match(/^No callback/)) {
+        c.innerHTML = "PASS";
+    } else if (c.innerHTML.match(/^PASS/)) {
+        c.innerHTML = "FAIL";
+    }
+}
+</script>
+<div id="content">No callback</div>
+<iframe name=inner id=inner style="display: none" onload="onload_callback()"
+src="about:blank"></iframe>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2045ef2..3dd14bf 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-02-26  Dirk Pranke  <dpranke at chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Fix the handling of updates to #hash fragments to check for differences
+        post-canonicalization rather than comparing pre- to post-. Chromium
+        had a bug where we would set the #hash on an about:blank URL and generate
+        an onload event because we thought the URL (not just the fragment) was
+        changing.
+
+        http://bugs.webkit.org/show_bug.cgi?id=35180
+
+        Test: fast/loader/about-blank-hash-change.html
+
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::hashAccessorSetter):
+
 2010-02-26  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by David Levin.
diff --git a/WebCore/bindings/v8/custom/V8LocationCustom.cpp b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
index b5df601..8ea8bfa 100644
--- a/WebCore/bindings/v8/custom/V8LocationCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8LocationCustom.cpp
@@ -75,9 +75,14 @@ void V8Location::hashAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Va
 
     if (hash.startsWith("#"))
         hash = hash.substring(1);
-    if (oldRef == hash || (oldRef.isNull() && hash.isEmpty()))
-        return;
+
+    // Note that by parsing the URL and *then* comparing fragments, we are
+    // comparing fragments post-canonicalization, and so this handles the
+    // cases where fragment identifiers are ignored or invalid.
     url.setFragmentIdentifier(hash);
+    String newRef = url.fragmentIdentifier();
+    if (oldRef == newRef || (oldRef.isNull() && newRef.isEmpty()))
+        return;
 
     navigateIfAllowed(frame, url, false, false);
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list