Changeset 45257 in webkit


Ignore:
Timestamp:
Jun 26, 2009 3:06:33 AM (15 years ago)
Author:
eric@webkit.org
Message:

2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

Bug 20303: [Qt] Key events are not working in frames.

Add a layout test to test the event is sent to the right sub-frame.

  • platform/qt/fast/events/event-sender-keydown-frame-expected.txt: Added.
  • platform/qt/fast/events/event-sender-keydown-frame.html: Added.

2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

Test: platform/qt/fast/events/event-sender-keydown-frame.html

Bug 20303: [Qt] Key events are not working in frames.

Merge scrolling handling code in qt and win port, move it to
EventHandler.

  • page/EventHandler.cpp: (WebCore::EventHandler::scrollRecursively):
  • page/EventHandler.h:

2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

Bug 20303: [Qt] Key events are not working in frames.

Send scrolling events to current focused frame, bubble the event
up to parent frame if it is not handled. Use EventHandler's new
shared scrolling code.

  • Api/qwebpage.cpp: (QWebPagePrivate::keyPressEvent): (QWebPagePrivate::handleScrolling):
  • Api/qwebpage_p.h:

2009-06-26 Yongjun Zhang <yongjun.zhang@nokia.com>

Reviewed by Eric Seidel.

Bug 20303: [Qt] Key events are not working in frames.

Move the scroll handling code to EventHandler so that other
ports can share the functionality.

  • WebView.cpp: (WebView::keyDown): (EnumTextMatches::QueryInterface):
Location:
trunk
Files:
2 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r45256 r45257  
     12009-06-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Bug 20303: [Qt] Key events are not working in frames.
     6
     7        Add a layout test to test the event is sent to the right sub-frame.
     8
     9        * platform/qt/fast/events/event-sender-keydown-frame-expected.txt: Added.
     10        * platform/qt/fast/events/event-sender-keydown-frame.html: Added.
     11
    1122009-06-26  Rob Buis  <rwlbuis@gmail.com>
    213
  • trunk/WebCore/ChangeLog

    r45256 r45257  
     12009-06-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Test: platform/qt/fast/events/event-sender-keydown-frame.html
     6
     7        Bug 20303: [Qt] Key events are not working in frames.
     8
     9        Merge scrolling handling code in qt and win port, move it to
     10        EventHandler.
     11
     12        * page/EventHandler.cpp:
     13        (WebCore::EventHandler::scrollRecursively):
     14        * page/EventHandler.h:
     15
    1162009-06-26  Rob Buis  <rwlbuis@gmail.com>
    217
  • trunk/WebCore/page/EventHandler.cpp

    r44624 r45257  
    855855
    856856    return false;
     857}
     858
     859bool EventHandler::scrollRecursively(ScrollDirection direction, ScrollGranularity granularity)
     860{
     861    bool handled = scrollOverflow(direction, granularity);
     862    if (!handled) {
     863        Frame* frame = m_frame;
     864        do {
     865            FrameView* view = frame->view();
     866            handled = view ? view->scroll(direction, granularity) : false;
     867            frame = frame->tree()->parent();
     868        } while (!handled && frame);
     869     }
     870
     871    return handled;
    857872}
    858873
  • trunk/WebCore/page/EventHandler.h

    r44379 r45257  
    110110    bool scrollOverflow(ScrollDirection, ScrollGranularity);
    111111
     112    bool scrollRecursively(ScrollDirection, ScrollGranularity);
     113
    112114    bool shouldDragAutoNode(Node*, const IntPoint&) const; // -webkit-user-drag == auto
    113115
  • trunk/WebKit/qt/Api/qwebpage.cpp

    r45220 r45257  
    797797        QFontMetrics fm(defaultFont);
    798798        int fontHeight = fm.height();
    799         if (!handleScrolling(ev)) {
     799        if (!handleScrolling(ev, frame)) {
    800800            switch (ev->key()) {
    801801            case Qt::Key_Back:
     
    10001000}
    10011001
    1002 bool QWebPagePrivate::handleScrolling(QKeyEvent *ev)
     1002bool QWebPagePrivate::handleScrolling(QKeyEvent *ev, Frame *frame)
    10031003{
    10041004    ScrollDirection direction;
     
    10471047    }
    10481048
    1049     if (!mainFrame->d->frame->eventHandler()->scrollOverflow(direction, granularity))
    1050         mainFrame->d->frame->view()->scroll(direction, granularity);
    1051 
    1052     return true;
     1049    return frame->eventHandler()->scrollRecursively(direction, granularity);
    10531050}
    10541051
  • trunk/WebKit/qt/Api/qwebpage_p.h

    r41151 r45257  
    4646    class Node;
    4747    class Page;
     48    class Frame;
    4849
    4950#ifndef QT_NO_CURSOR
     
    114115    void shortcutOverrideEvent(QKeyEvent*);
    115116    void leaveEvent(QEvent *);
    116     bool handleScrolling(QKeyEvent*);
     117    bool handleScrolling(QKeyEvent*, WebCore::Frame*);
    117118
    118119#ifndef QT_NO_SHORTCUT
  • trunk/WebKit/qt/ChangeLog

    r45220 r45257  
     12009-06-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Bug 20303: [Qt] Key events are not working in frames.
     6
     7        Send scrolling events to current focused frame, bubble the event
     8        up to parent frame if it is not handled.  Use EventHandler's new
     9        shared scrolling code.
     10
     11        * Api/qwebpage.cpp:
     12        (QWebPagePrivate::keyPressEvent):
     13        (QWebPagePrivate::handleScrolling):
     14        * Api/qwebpage_p.h:
     15
    1162009-06-25  Jakub Wieczorek  <faw217@gmail.com>
    217
  • trunk/WebKit/win/ChangeLog

    r44995 r45257  
     12009-06-26  Yongjun Zhang  <yongjun.zhang@nokia.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Bug 20303: [Qt] Key events are not working in frames.
     6
     7        Move the scroll handling code to EventHandler so that other
     8        ports can share the functionality.
     9
     10        * WebView.cpp:
     11        (WebView::keyDown):
     12        (EnumTextMatches::QueryInterface):
     13
    1142009-06-23  Anders Carlsson  <andersca@apple.com>
    215
  • trunk/WebKit/win/WebView.cpp

    r44890 r45257  
    17231723    }
    17241724
    1725     if (!frame->eventHandler()->scrollOverflow(direction, granularity)) {
    1726         handled = frame->view()->scroll(direction, granularity);
    1727         Frame* parent = frame->tree()->parent();
    1728         while(!handled && parent) {
    1729             handled = parent->view()->scroll(direction, granularity);
    1730             parent = parent->tree()->parent();
    1731         }
    1732     }
    1733     return handled;
     1725    return frame->eventHandler()->scrollRecursively(direction, granularity);
    17341726}
    17351727
Note: See TracChangeset for help on using the changeset viewer.