WebCore:
authoralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2008 22:58:50 +0000 (22:58 +0000)
committeralice.liu@apple.com <alice.liu@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2008 22:58:50 +0000 (22:58 +0000)
        Reviewed by Maciej.

        Fixed <rdar://5283861> (problems scrolling in gmail message content area)

        * platform/ScrollView.h:
        * platform/win/ScrollViewWin.cpp:
        (WebCore::ScrollView::scroll):
         Changed return value to bool to reflect success of scroll attempt

WebKit/win:

        Reviewed by Maciej.

        Fixed <rdar://5283861> (problems scrolling in gmail message content area)

        * WebView.cpp:
        (WebView::keyDown):
        bubble scrolling from a key event

LayoutTests:

        Reviewed by Maciej.

        Added test for <rdar://5283861> (problems scrolling in gmail message content area)

        * fast/frames/iframe-scroll-page-up-down-expected.txt: Added.
        * fast/frames/iframe-scroll-page-up-down.html: Added.
        * fast/frames/resources/iframe-scroll-page-up-down-1.html: Added.
        * fast/frames/resources/iframe-scroll-page-up-down-2.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/frames/iframe-scroll-page-up-down-expected.txt [new file with mode: 0644]
LayoutTests/fast/frames/iframe-scroll-page-up-down.html [new file with mode: 0644]
LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-1.html [new file with mode: 0644]
LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-2.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/platform/ScrollView.h
WebCore/platform/win/ScrollViewWin.cpp
WebKit/win/ChangeLog
WebKit/win/WebView.cpp

index 2ce96753294f6e8c46660f101389427957c00f6c..d5b7949dbe57e08e94b8b84b6f06d7f9a2c075fb 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-02  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Maciej.
+
+        Added test for <rdar://5283861> (problems scrolling in gmail message content area)
+
+        * fast/frames/iframe-scroll-page-up-down-expected.txt: Added.
+        * fast/frames/iframe-scroll-page-up-down.html: Added.
+        * fast/frames/resources/iframe-scroll-page-up-down-1.html: Added.
+        * fast/frames/resources/iframe-scroll-page-up-down-2.html: Added.
+
 2008-01-02  Adam Roben  <aroben@apple.com>
 
         * platform/win/Skipped: Added some more failures.
diff --git a/LayoutTests/fast/frames/iframe-scroll-page-up-down-expected.txt b/LayoutTests/fast/frames/iframe-scroll-page-up-down-expected.txt
new file mode 100644 (file)
index 0000000..0a76664
--- /dev/null
@@ -0,0 +1,5 @@
+top 
+
+bottom
+PASSED test 1
+PASSED test 2
diff --git a/LayoutTests/fast/frames/iframe-scroll-page-up-down.html b/LayoutTests/fast/frames/iframe-scroll-page-up-down.html
new file mode 100644 (file)
index 0000000..c4cbc58
--- /dev/null
@@ -0,0 +1,69 @@
+<html>\r
+<head>\r
+<script>\r
+function test() \r
+{\r
+    if (!window.layoutTestController)\r
+        return;\r
+\r
+    if (window.layoutTestController)\r
+        layoutTestController.dumpAsText();\r
+\r
+    // 1st test: iframes scrolled to top, top level document scrolled to bottom\r
+    // pageup in innermost iframe should scroll top level document up\r
+    window[0][0].scrollTo(0,0);\r
+    window[0].scrollTo(0,0);\r
+    window.scrollTo(0, document.body.offsetHeight);\r
+    var oldScrollTop = document.body.scrollTop;\r
+    var focus1 = window[0][0].document.getElementById("focus1");\r
+    focus1.focus();    \r
+    eventSender.keyDown("pageUp");\r
+    var test1Passed = false;\r
+    if (document.body.scrollTop < oldScrollTop)\r
+        test1Passed = true;\r
+\r
+    // 2nd test: iframes scrolled to bottom, top level document scrolled to top\r
+    // pagedown in innermost iframe should scroll top level document down\r
+    window[0][0].scrollTo(0,window[0][0].document.body.offsetHeight);\r
+    window[0].scrollTo(0,window[0].document.body.offsetHeight);\r
+    window.scrollTo(0, 0);\r
+    oldScrollTop = document.body.scrollTop\r
+    var focus2 = window[0][0].document.getElementById("focus2");\r
+    focus2.focus();\r
+    eventSender.keyDown("pageDown");\r
+    var test2Passed = false;\r
+    if (document.body.scrollTop > oldScrollTop)\r
+        test2Passed = true;\r
+\r
+    printResults(test1Passed, test2Passed);\r
+}\r
+\r
+function printResults(test1Passed, test2Passed) \r
+{\r
+    var console = document.createElement("div");\r
+    if (test1Passed)\r
+        console.innerHTML = "PASSED test 1";\r
+    else\r
+        console.innerHTML = "FAILED test 1";\r
+    console.innerHTML += "<br>";\r
+    if (test2Passed)\r
+        console.innerHTML += "PASSED test 2";\r
+    else\r
+        console.innerHTML += "FAILED test 2";\r
+\r
+    document.body.appendChild(console);\r
+        \r
+}\r
+</script>\r
+</head>\r
+<body onload="window.resizeTo(500,587); test();">\r
+<div id="testDiv">\r
+top\r
+<br>\r
+<div style="height:200px"></div>\r
+<iframe id="frame" width="450px" height="235px" src="./resources/iframe-scroll-page-up-down-1.html"></iframe>\r
+<div style="height:200px"></div>\r
+bottom\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-1.html b/LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-1.html
new file mode 100644 (file)
index 0000000..f42e567
--- /dev/null
@@ -0,0 +1,10 @@
+<html>\r
+<body>\r
+top\r
+<br>\r
+<div style="height:100px"></div>\r
+<iframe width="400px" height="100px" src="./iframe-scroll-page-up-down-2.html"></iframe>\r
+<div style="height:100px"></div>\r
+bottom\r
+</body>\r
+</html>\r
diff --git a/LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-2.html b/LayoutTests/fast/frames/resources/iframe-scroll-page-up-down-2.html
new file mode 100644 (file)
index 0000000..007cb78
--- /dev/null
@@ -0,0 +1,15 @@
+<html>\r
+<body contenteditable=true onclick="alert('clicked');">\r
+<input id="focus1" value="focus here and page up">\r
+<br>\r
+2<br>\r
+3<br>\r
+4<br>\r
+5<br>\r
+6<br>\r
+7<br>\r
+8<br>\r
+9<br>\r
+<input id="focus2" value="focus here and page down">\r
+</body>\r
+</html>\r
index 3c2fdd1545ffddc31b82e2f61f25bd0fc05d5aa8..1e3b58d98bbaabe070d3948add894f3381712501 100644 (file)
@@ -1,3 +1,14 @@
+2008-01-02  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Maciej.
+
+        Fixed <rdar://5283861> (problems scrolling in gmail message content area)
+
+        * platform/ScrollView.h:
+        * platform/win/ScrollViewWin.cpp:
+        (WebCore::ScrollView::scroll):
+         Changed return value to bool to reflect success of scroll attempt
+
 2008-01-02  Alexey Proskuryakov  <ap@webkit.org>
 
         Fixed a typo (pointed out in review, but I somehow missed it at first).
index 6cb7976eeca45048a041e06b61fd6679336b1a46..58db6e9ae14ebec843e65d114a25d0a75edf8d76 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006 Apple Computer, Inc.  All rights reserved.
+ * Copyright (C) 2004, 2006, 2007, 2008 Apple Computer, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -110,7 +110,7 @@ namespace WebCore {
         // (like Windows), we need this method in order to do the scroll ourselves.
         void wheelEvent(PlatformWheelEvent&);
 
-        void scroll(ScrollDirection, ScrollGranularity);
+        bool scroll(ScrollDirection, ScrollGranularity);
 
 #if PLATFORM(MAC)
         NSView* getDocumentView() const;
index 69853763cb685df17cbaca12925ca362bd6f5933..893696dab905525d75c4d9acb4f7578ec63f03f3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -689,12 +689,12 @@ void ScrollView::geometryChanged() const
         (*current)->geometryChanged();
 }
 
-void ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
+bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity)
 {
     if  ((direction == ScrollUp || direction == ScrollDown) && m_data->m_vBar)
-        m_data->m_vBar->scroll(direction, granularity);
+        return m_data->m_vBar->scroll(direction, granularity);
     else if (m_data->m_hBar)
-        m_data->m_hBar->scroll(direction, granularity);
+        return m_data->m_hBar->scroll(direction, granularity);
 }
 
 IntRect ScrollView::windowResizerRect()
index f5b630c79c0c52a76899e531a6cc867545565e88..a0ac371553c7b5f70f4d39ec9976c33f3576a73f 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-02  Alice Liu  <alice.liu@apple.com>
+
+        Reviewed by Maciej.
+
+        Fixed <rdar://5283861> (problems scrolling in gmail message content area)
+
+        * WebView.cpp:
+        (WebView::keyDown):
+        bubble scrolling from a key event
+
 2008-01-01  Matt Lilek  <webkit@mattlilek.com>
 
         Attempt to fix the Windows bots until the bots
index e4235030c35d0c9865bc6f6335b08ce6d4933ab9..e04eae191e8ab9ae403efffda31115d1fc7581d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2007 Apple, Inc.  All rights reserved.
+ * Copyright (C) 2006, 2007, 2008 Apple, Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -1476,9 +1476,15 @@ bool WebView::keyDown(WPARAM virtualKeyCode, LPARAM keyData, bool systemKeyDown)
             return false;
     }
 
-    if (!frame->eventHandler()->scrollOverflow(direction, granularity))
-        frame->view()->scroll(direction, granularity);
-    return true;
+    if (!frame->eventHandler()->scrollOverflow(direction, granularity)) {
+        handled = frame->view()->scroll(direction, granularity);
+        Frame* parent = frame->tree()->parent();
+        while(!handled && parent) {
+            handled = parent->view()->scroll(direction, granularity);
+            parent = parent->tree()->parent();
+        }
+    }
+    return handled;
 }
 
 bool WebView::keyPress(WPARAM charCode, LPARAM keyData, bool systemKeyDown)