+2012-11-29 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>
+
+ [WK2] TiledBackingStore: User events are sent to web page before it is shown
+ https://bugs.webkit.org/show_bug.cgi?id=101753
+
+ 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):
+
2012-11-29 Allan Sandfeld Jensen <allan.jensen@digia.com>
Possible to resize out of bounds
return;
}
#endif
-
bool handled = false;
-
if (m_pageOverlay) {
// Let the page overlay handle the event.
handled = m_pageOverlay->mouseEvent(mouseEvent);
}
- if (!handled) {
+ if (!handled && canHandleUserEvents()) {
CurrentEvent currentEvent(mouseEvent);
// We need to do a full, normal hit test during this mouse event if the page is active or if a mouse
- // button is currently pressed. It is possible that neither of those things will be true since on
- // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
+ // button is currently pressed. It is possible that neither of those things will be true since on
+ // Lion when legacy scrollbars are enabled, WebKit receives mouse events all the time. If it is one
// of those cases where the page is not active and the mouse is not pressed, then we can fire a more
// efficient scrollbars-only version of the event.
bool onlyUpdateScrollbars = !(m_page->focusController()->isActive() || (mouseEvent.button() != WebMouseEvent::NoButton));
void WebPage::wheelEvent(const WebWheelEvent& wheelEvent)
{
- CurrentEvent currentEvent(wheelEvent);
+ bool handled = false;
- bool handled = handleWheelEvent(wheelEvent, m_page.get());
+ if (canHandleUserEvents()) {
+ CurrentEvent currentEvent(wheelEvent);
+
+ handled = handleWheelEvent(wheelEvent, m_page.get());
+ }
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(wheelEvent.type()), handled));
}
void WebPage::keyEvent(const WebKeyboardEvent& keyboardEvent)
{
- CurrentEvent currentEvent(keyboardEvent);
+ bool handled = false;
- bool handled = handleKeyEvent(keyboardEvent, m_page.get());
- // FIXME: Platform default behaviors should be performed during normal DOM event dispatch (in most cases, in default keydown event handler).
- if (!handled)
- handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
+ if (canHandleUserEvents()) {
+ CurrentEvent currentEvent(keyboardEvent);
+ handled = handleKeyEvent(keyboardEvent, m_page.get());
+ // FIXME: Platform default behaviors should be performed during normal DOM event dispatch (in most cases, in default keydown event handler).
+ if (!handled)
+ handled = performDefaultBehaviorForKeyEvent(keyboardEvent);
+ }
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(keyboardEvent.type()), handled));
}
void WebPage::gestureEvent(const WebGestureEvent& gestureEvent)
{
- CurrentEvent currentEvent(gestureEvent);
+ bool handled = false;
+
+ if (canHandleUserEvents()) {
+ CurrentEvent currentEvent(gestureEvent);
- bool handled = handleGestureEvent(gestureEvent, m_page.get());
+ handled = handleGestureEvent(gestureEvent, m_page.get());
+ }
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(gestureEvent.type()), handled));
}
#endif
void WebPage::touchEvent(const WebTouchEvent& touchEvent)
{
- CurrentEvent currentEvent(touchEvent);
+ bool handled = false;
- bool handled = handleTouchEvent(touchEvent, m_page.get());
+ if (canHandleUserEvents()) {
+ CurrentEvent currentEvent(touchEvent);
+ handled = handleTouchEvent(touchEvent, m_page.get());
+ }
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(touchEvent.type()), handled));
}
m_page->setCanStartMedia(true);
}
+inline bool WebPage::canHandleUserEvents() const
+{
+#if USE(TILED_BACKING_STORE)
+ // Should apply only if the area was frozen by didStartPageTransition().
+ return !m_drawingArea->layerTreeStateIsFrozen();
+#endif
+ return true;
+}
+
void WebPage::setIsInWindow(bool isInWindow)
{
if (!isInWindow) {