⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 136133 in webkit


Ignore:
Timestamp:
Nov 29, 2012, 7:48:33 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

[WK2] TiledBackingStore: User events are sent to web page before it is shown
​https://bugs.webkit.org/show_bug.cgi?id=101753

Patch by Mikhail Pozdnyakov <​mikhail.pozdnyakov@intel.com> on 2012-11-29
Reviewed by Jocelyn Turcotte.

User events are suppressed on WEB process side while drawing area is frozen.

  • WebProcess/WebPage/WebPage.cpp:

(WebKit::WebPage::mouseEvent):
(WebKit::WebPage::wheelEvent):
(WebKit::WebPage::keyEvent):
(WebKit::WebPage::gestureEvent):
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::sendIfEventCannotBeHandled):
(WebKit):
(WebKit::WebPage::didCompletePageTransition):

  • WebProcess/WebPage/WebPage.h:

(WebPage):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r136129 r136133  
     12012-11-29  Mikhail Pozdnyakov  <mikhail.pozdnyakov@intel.com>
     2
     3        [WK2] TiledBackingStore: User events are sent to web page before it is shown
     4        https://bugs.webkit.org/show_bug.cgi?id=101753
     5
     6        Reviewed by Jocelyn Turcotte.
     7
     8        User events are suppressed on WEB process side while drawing area is frozen.
     9
     10        * WebProcess/WebPage/WebPage.cpp:
     11        (WebKit::WebPage::mouseEvent):
     12        (WebKit::WebPage::wheelEvent):
     13        (WebKit::WebPage::keyEvent):
     14        (WebKit::WebPage::gestureEvent):
     15        (WebKit::WebPage::touchEvent):
     16        (WebKit::WebPage::sendIfEventCannotBeHandled):
     17        (WebKit):
     18        (WebKit::WebPage::didCompletePageTransition):
     19        * WebProcess/WebPage/WebPage.h:
     20        (WebPage):
     21
    1222012-11-29  Allan Sandfeld Jensen  <allan.jensen@digia.com>
    223
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp

    r135952 r136133  
    15071507    }
    15081508#endif
    1509    
    15101509    bool handled = false;
    1511    
    15121510    if (m_pageOverlay) {
    15131511        // Let the page overlay handle the event.
    15141512        handled = m_pageOverlay->mouseEvent(mouseEvent);
    15151513    }
     1514
     1515    if (!handled && canHandleUserEvents()) {
     1516        CurrentEvent currentEvent(mouseEvent);
     1517
     1518        // We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
     1519        // button is currently pressed. It is possible that neither of those things will be true since on
     1520        // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
     1521        // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
     1522        // efficient scrollbars-only version of the event.
     1523        bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
     1524        handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
     1525    }
     1526
     1527    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled));
     1528}
     1529
     1530void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& handled)
     1531{
     1532    handled = m_pageOverlay && m_pageOverlay->mouseEvent(mouseEvent);
    15161533
    15171534    if (!handled) {
    … …  
    15261543        handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
    15271544    }
    1528 
    1529     send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(mouseEvent.type()), handled));
    1530 }
    1531 
    1532 void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& handled)
    1533 {
    1534     handled = m_pageOverlay && m_pageOverlay->mouseEvent(mouseEvent);
    1535 
    1536     if (!handled) {
    1537         CurrentEvent currentEvent(mouseEvent);
    1538 
    1539         // We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
    1540         // button is currently pressed. It is possible that neither of those things will be true since on
    1541         // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
    1542         // of those cases where the page is not active and the mouse is not pressed, then we can fire a more
    1543         // efficient scrollbars-only version of the event.
    1544         bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
    1545         handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars);
    1546     }
    15471545}
    15481546
    … …  
    15591557void WebPage::wheelEvent(const WebWheelEvent& wheelEvent)
    15601558{
    1561     CurrentEvent currentEvent(wheelEvent);
    1562 
    1563     bool handled = handleWheelEvent(wheelEvent, m_page.get());
     1559    bool handled = false;
     1560
     1561    if (canHandleUserEvents()) {
     1562        CurrentEvent currentEvent(wheelEvent);
     1563
     1564        handled = handleWheelEvent(wheelEvent, m_page.get());
     1565    }
    15641566    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
    15651567}
    … …  
    15841586void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
    15851587{
    1586     CurrentEvent currentEvent(keyboardEvent);
    1587 
    1588     bool handled = handleKeyEvent(keyboardEvent, m_page.get());
    1589     // FIXME: Platform default behaviors should be performed during normal DOM event dispatch (in most cases, in default keydown event handler).
    1590     if (!handled)
    1591         handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
    1592 
     1588    bool handled = false;
     1589
     1590    if (canHandleUserEvents()) {
     1591        CurrentEvent currentEvent(keyboardEvent);
     1592
     1593        handled = handleKeyEvent(keyboardEvent, m_page.get());
     1594        // FIXME: Platform default behaviors should be performed during normal DOM event dispatch (in most cases, in default keydown event handler).
     1595        if (!handled)
     1596            handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
     1597    }
    15931598    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled));
    15941599}
    … …  
    16161621void WebPage::gestureEvent(const WebGestureEvent& gestureEvent)
    16171622{
    1618     CurrentEvent currentEvent(gestureEvent);
    1619 
    1620     bool handled = handleGestureEvent(gestureEvent, m_page.get());
     1623    bool handled = false;
     1624
     1625    if (canHandleUserEvents()) {
     1626        CurrentEvent currentEvent(gestureEvent);
     1627
     1628        handled = handleGestureEvent(gestureEvent, m_page.get());
     1629    }
    16211630    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(gestureEvent.type()), handled));
    16221631}
    … …  
    17341743void WebPage::touchEvent(const WebTouchEvent& touchEvent)
    17351744{
    1736     CurrentEvent currentEvent(touchEvent);
    1737 
    1738     bool handled = handleTouchEvent(touchEvent, m_page.get());
    1739 
     1745    bool handled = false;
     1746
     1747    if (canHandleUserEvents()) {
     1748        CurrentEvent currentEvent(touchEvent);
     1749
     1750        handled = handleTouchEvent(touchEvent, m_page.get());
     1751    }
    17401752    send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(touchEvent.type()), handled));
    17411753}
    … …  
    18821894    if (m_page)
    18831895        m_page->setCanStartMedia(true);
     1896}
     1897
     1898inline bool WebPage::canHandleUserEvents() const
     1899{
     1900#if USE(TILED_BACKING_STORE)
     1901    // Should apply only if the area was frozen by didStartPageTransition().
     1902    return !m_drawingArea->layerTreeStateIsFrozen();
     1903#endif
     1904    return true;
    18841905}
    18851906
  • trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h

    r135915 r136133  
    782782    void setCanStartMediaTimerFired();
    783783
     784    bool canHandleUserEvents() const;
     785
    784786    static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
    785787
Note: See TracChangeset for help on using the changeset viewer.