Changeset 136133 in webkit
- Timestamp:
- Nov 29, 2012, 7:48:33 AM (14 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/WebPage/WebPage.cpp (modified) (7 diffs)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r136129 r136133 1 2012-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 1 22 2012-11-29 Allan Sandfeld Jensen <allan.jensen@digia.com> 2 23 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
r135952 r136133 1507 1507 } 1508 1508 #endif 1509 1510 1509 bool handled = false; 1511 1512 1510 if (m_pageOverlay) { 1513 1511 // Let the page overlay handle the event. 1514 1512 handled = m_pageOverlay->mouseEvent(mouseEvent); 1515 1513 } 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 1530 void WebPage::mouseEventSyncForTesting(const WebMouseEvent& mouseEvent, bool& handled) 1531 { 1532 handled = m_pageOverlay && m_pageOverlay->mouseEvent(mouseEvent); 1516 1533 1517 1534 if (!handled) { … … 1526 1543 handled = handleMouseEvent(mouseEvent, this, onlyUpdateScrollbars); 1527 1544 } 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 mouse1540 // button is currently pressed. It is possible that neither of those things will be true since on1541 // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one1542 // of those cases where the page is not active and the mouse is not pressed, then we can fire a more1543 // 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 }1547 1545 } 1548 1546 … … 1559 1557 void WebPage::wheelEvent(const WebWheelEvent& wheelEvent) 1560 1558 { 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 } 1564 1566 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled)); 1565 1567 } … … 1584 1586 void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent) 1585 1587 { 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 } 1593 1598 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled)); 1594 1599 } … … 1616 1621 void WebPage::gestureEvent(const WebGestureEvent& gestureEvent) 1617 1622 { 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 } 1621 1630 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(gestureEvent.type()), handled)); 1622 1631 } … … 1734 1743 void WebPage::touchEvent(const WebTouchEvent& touchEvent) 1735 1744 { 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 } 1740 1752 send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(touchEvent.type()), handled)); 1741 1753 } … … 1882 1894 if (m_page) 1883 1895 m_page->setCanStartMedia(true); 1896 } 1897 1898 inline 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; 1884 1905 } 1885 1906 -
trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h
r135915 r136133 782 782 void setCanStartMediaTimerFired(); 783 783 784 bool canHandleUserEvents() const; 785 784 786 static bool platformCanHandleRequest(const WebCore::ResourceRequest&); 785 787
Note:
See TracChangeset
for help on using the changeset viewer.