Modified: trunk/Source/WebKit2/ChangeLog (136132 => 136133)
--- trunk/Source/WebKit2/ChangeLog 2012-11-29 15:34:39 UTC (rev 136132)
+++ trunk/Source/WebKit2/ChangeLog 2012-11-29 15:48:33 UTC (rev 136133)
@@ -1,3 +1,24 @@
+2012-11-29 Mikhail Pozdnyakov <[email protected]>
+
+ [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 <[email protected]>
Possible to resize out of bounds
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (136132 => 136133)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-11-29 15:34:39 UTC (rev 136132)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2012-11-29 15:48:33 UTC (rev 136133)
@@ -1506,20 +1506,18 @@
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));
@@ -1558,9 +1556,13 @@
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));
}
@@ -1583,13 +1585,16 @@
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));
}
@@ -1615,9 +1620,13 @@
void WebPage::gestureEvent(const WebGestureEvent& gestureEvent)
{
- CurrentEvent currentEvent(gestureEvent);
+ bool handled = false;
- bool handled = handleGestureEvent(gestureEvent, m_page.get());
+ if (canHandleUserEvents()) {
+ CurrentEvent currentEvent(gestureEvent);
+
+ handled = handleGestureEvent(gestureEvent, m_page.get());
+ }
send(Messages::WebPageProxy::DidReceiveEvent(static_cast<uint32_t>(gestureEvent.type()), handled));
}
#endif
@@ -1733,10 +1742,13 @@
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));
}
@@ -1883,6 +1895,15 @@
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) {
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (136132 => 136133)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-11-29 15:34:39 UTC (rev 136132)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h 2012-11-29 15:48:33 UTC (rev 136133)
@@ -781,6 +781,8 @@
void changeSelectedIndex(int32_t index);
void setCanStartMediaTimerFired();
+ bool canHandleUserEvents() const;
+
static bool platformCanHandleRequest(const WebCore::ResourceRequest&);
OwnPtr<WebCore::Page> m_page;