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

japhet at chromium.org japhet at chromium.org
Thu Apr 8 02:10:28 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 48bb260710ecf44d04c5e377abe28718244c2ea9
Author: japhet at chromium.org <japhet at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 4 23:01:45 2010 +0000

    2010-03-04  Nate Chapin  <japhet at chromium.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            Fix the case where we do a same document navigation, scroll,
            then repeat the same document navigation.  Currently, the second
            navigation does nothing.
    
            https://bugs.webkit.org/show_bug.cgi?id=35547
    
            Test: fast/loader/repeat-same-document-navigation.html
    
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::loadInSameDocument): Call scrollToFragment() whether or not the hash changed.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55555 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 494d1c9..75b639b 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-03-04  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Test for https://bugs.webkit.org/show_bug.cgi?id=35547.
+
+        * fast/loader/repeat-same-document-navigation-expected.txt: Added.
+        * fast/loader/repeat-same-document-navigation.html: Added.
+
 2010-03-04  Dan Bernstein  <mitz at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/fast/loader/repeat-same-document-navigation-expected.txt b/LayoutTests/fast/loader/repeat-same-document-navigation-expected.txt
new file mode 100644
index 0000000..f27b991
--- /dev/null
+++ b/LayoutTests/fast/loader/repeat-same-document-navigation-expected.txt
@@ -0,0 +1,2 @@
+Anchor link
+Scroll position is 608px
diff --git a/LayoutTests/fast/loader/repeat-same-document-navigation.html b/LayoutTests/fast/loader/repeat-same-document-navigation.html
new file mode 100644
index 0000000..dd264b9
--- /dev/null
+++ b/LayoutTests/fast/loader/repeat-same-document-navigation.html
@@ -0,0 +1,35 @@
+<html>
+<head>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function clickLink() {
+    var link = document.getElementById("anchorLink");
+    eventSender.mouseMoveTo(link.offsetLeft + 2, link.offsetTop + 2);
+    eventSender.mouseDown(); 
+    eventSender.mouseUp(); 
+}
+
+function run() {
+    clickLink();
+    window.scroll(0, 0);
+    clickLink();
+    var scrollY = window.scrollY;
+    var line = document.createElement('div');
+    line.appendChild(document.createTextNode("Scroll position is " + scrollY + "px"));
+    document.getElementById('anchor').appendChild(line);
+    layoutTestController.notifyDone();    
+}
+
+</script>
+</head>
+<body onload="run();">
+<div style="height: 600px">
+<a id="anchorLink" href="#anchor">Anchor link</a>
+</div>
+<div id="anchor" style="height: 600px"></div>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 07f7887..ad91a71 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-03-04  Nate Chapin  <japhet at chromium.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Fix the case where we do a same document navigation, scroll,
+        then repeat the same document navigation.  Currently, the second
+        navigation does nothing.
+
+        https://bugs.webkit.org/show_bug.cgi?id=35547
+
+        Test: fast/loader/repeat-same-document-navigation.html
+
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::loadInSameDocument): Call scrollToFragment() whether or not the hash changed.
+
 2010-03-04  Simon Fraser  <simon.fraser at apple.com>
 
         Build fix.
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index d1aae7e..54c7972 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -1757,11 +1757,11 @@ void FrameLoader::loadInSameDocument(const KURL& url, SerializedScriptValue* sta
     // It's important to model this as a load that starts and immediately finishes.
     // Otherwise, the parent frame may think we never finished loading.
     started();
-    
-    if (hashChange) {
-        if (FrameView* view = m_frame->view())
-            view->scrollToFragment(m_URL);
-    }
+
+    // We need to scroll to the fragment whether or not a hash change occurred, since
+    // the user might have scrolled since the previous navigation.
+    if (FrameView* view = m_frame->view())
+        view->scrollToFragment(m_URL);
     
     m_isComplete = false;
     checkCompleted();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list