Changeset 60159 in webkit


Ignore:
Timestamp:
May 25, 2010 6:14:33 AM (14 years ago)
Author:
tonikitoo@webkit.org
Message:

Add an optional "starting node' parameter to scrollRecursively and scrollOverflow of EventHandler
https://bugs.webkit.org/show_bug.cgi?id=39217

Reviewed by Darin Adler.
Patch by Antonio Gomes <tonikitoo@webkit.org>

It would be usefull if scrollOverflow and scrollRecursively methods of EventHandler
could receive a parameter to specify where to start scrolling from. Currently they
start scrolling from either the current focused node or the node where mouse last
pressed on. Patch proposes an aditional starting point as an optional parameter.
Since it is optional, all call sites can remain as are, and if a Null node is passed
in, both methods work as previously.

  • page/EventHandler.cpp:

(WebCore::EventHandler::scrollOverflow):
(WebCore::EventHandler::scrollRecursively):

  • page/EventHandler.h:
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r60157 r60159  
     12010-05-17  Antonio Gomes  <tonikitoo@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Add an optional "starting node' parameter to scrollRecursively and scrollOverflow of EventHandler
     6        https://bugs.webkit.org/show_bug.cgi?id=39217
     7
     8        It would be usefull if scrollOverflow and scrollRecursively methods of EventHandler
     9        could receive a parameter to specify where to start scrolling from. Currently they
     10        start scrolling from either the current focused node or the node where mouse last
     11        pressed on. Patch proposes an aditional starting point as an optional parameter.
     12        Since it is optional, all call sites can remain as are, and if a Null node is passed
     13        in, both methods work as previously.
     14
     15        * page/EventHandler.cpp:
     16        (WebCore::EventHandler::scrollOverflow):
     17        (WebCore::EventHandler::scrollRecursively):
     18        * page/EventHandler.h:
     19
    1202010-05-25  Adam Barth  <abarth@webkit.org>
    221
  • trunk/WebCore/page/EventHandler.cpp

    r60111 r60159  
    972972}
    973973
    974 bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity granularity)
    975 {
    976     Node* node = m_frame->document()->focusedNode();
     974bool EventHandler::scrollOverflow(ScrollDirection direction, ScrollGranularity granularity, Node* startingNode)
     975{
     976    Node* node = startingNode;
     977
     978    if (!node)
     979        node = m_frame->document()->focusedNode();
     980
    977981    if (!node)
    978982        node = m_mousePressNode.get();
     
    989993}
    990994
    991 bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularity granularity)
    992 {
    993     bool handled = scrollOverflow(direction, granularity);
     995bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularity granularity, Node* startingNode)
     996{
     997    bool handled = scrollOverflow(direction, granularity, startingNode);
    994998    if (!handled) {
    995999        Frame* frame = m_frame;
  • trunk/WebCore/page/EventHandler.h

    r58625 r60159  
    131131    static Frame* subframeForTargetNode(Node*);
    132132
    133     bool scrollOverflow(ScrollDirection, ScrollGranularity);
    134 
    135     bool scrollRecursively(ScrollDirection, ScrollGranularity);
     133    bool scrollOverflow(ScrollDirection, ScrollGranularity, Node* startingNode = 0);
     134
     135    bool scrollRecursively(ScrollDirection, ScrollGranularity, Node* startingNode = 0);
    136136
    137137#if ENABLE(DRAG_SUPPORT)
Note: See TracChangeset for help on using the changeset viewer.