[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
weinig at apple.com
weinig at apple.com
Wed Dec 22 13:49:21 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit f7ab856aec5bae092295ae4974d4425869709b25
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 27 22:55:14 2010 +0000
Add remaining event handlers to WKView.
Reviewed by Anders Carlsson.
Also fixes <rdar://problem/8467058>
Does not get decidePolicyForNavigationAction callback when middle clicking a link
- Adds otherButton and rightButton NSResponder event handlers to WKView.
- Renames WebPageProxy event handlers to use the handle prefix.
- Uses a macro to reduce duplicate code for WKView event handlers.
- Add view parameter to WebEventFactory::createWebKeyboardEvent on the mac
for uniformity.
* Shared/mac/WebEventFactory.h:
* Shared/mac/WebEventFactory.mm:
(WebKit::WebEventFactory::createWebKeyboardEvent):
* UIProcess/API/mac/WKView.mm:
* UIProcess/API/qt/qwkpage.cpp:
(QWKPagePrivate::keyPressEvent):
(QWKPagePrivate::keyReleaseEvent):
(QWKPagePrivate::mouseMoveEvent):
(QWKPagePrivate::mousePressEvent):
(QWKPagePrivate::mouseReleaseEvent):
(QWKPagePrivate::mouseDoubleClickEvent):
(QWKPagePrivate::wheelEvent):
(QWKPagePrivate::touchEvent):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleMouseEvent):
(WebKit::WebPageProxy::handleWheelEvent):
(WebKit::WebPageProxy::handleKeyboardEvent):
(WebKit::WebPageProxy::handleTouchEvent):
* UIProcess/WebPageProxy.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::onMouseEvent):
(WebKit::WebView::onWheelEvent):
(WebKit::WebView::onKeyEvent):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 46bd81b..8d7a2dc 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,42 @@
+2010-09-27 Sam Weinig <sam at webkit.org>
+
+ Reviewed by Anders Carlsson.
+
+ Add remaining event handlers to WKView.
+
+ Also fixes <rdar://problem/8467058>
+ Does not get decidePolicyForNavigationAction callback when middle clicking a link
+
+ - Adds otherButton and rightButton NSResponder event handlers to WKView.
+ - Renames WebPageProxy event handlers to use the handle prefix.
+ - Uses a macro to reduce duplicate code for WKView event handlers.
+ - Add view parameter to WebEventFactory::createWebKeyboardEvent on the mac
+ for uniformity.
+
+ * Shared/mac/WebEventFactory.h:
+ * Shared/mac/WebEventFactory.mm:
+ (WebKit::WebEventFactory::createWebKeyboardEvent):
+ * UIProcess/API/mac/WKView.mm:
+ * UIProcess/API/qt/qwkpage.cpp:
+ (QWKPagePrivate::keyPressEvent):
+ (QWKPagePrivate::keyReleaseEvent):
+ (QWKPagePrivate::mouseMoveEvent):
+ (QWKPagePrivate::mousePressEvent):
+ (QWKPagePrivate::mouseReleaseEvent):
+ (QWKPagePrivate::mouseDoubleClickEvent):
+ (QWKPagePrivate::wheelEvent):
+ (QWKPagePrivate::touchEvent):
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::handleMouseEvent):
+ (WebKit::WebPageProxy::handleWheelEvent):
+ (WebKit::WebPageProxy::handleKeyboardEvent):
+ (WebKit::WebPageProxy::handleTouchEvent):
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/win/WebView.cpp:
+ (WebKit::WebView::onMouseEvent):
+ (WebKit::WebView::onWheelEvent):
+ (WebKit::WebView::onKeyEvent):
+
2010-09-27 Ivan Krstić <ike at apple.com>
Reviewed by Mark Rowe.
diff --git a/WebKit2/Shared/mac/WebEventFactory.h b/WebKit2/Shared/mac/WebEventFactory.h
index 3b0925e..7bc8d97 100644
--- a/WebKit2/Shared/mac/WebEventFactory.h
+++ b/WebKit2/Shared/mac/WebEventFactory.h
@@ -37,7 +37,7 @@ class WebEventFactory {
public:
static WebMouseEvent createWebMouseEvent(NSEvent *event, NSView *windowView);
static WebWheelEvent createWebWheelEvent(NSEvent *event, NSView *windowView);
- static WebKeyboardEvent createWebKeyboardEvent(NSEvent *event);
+ static WebKeyboardEvent createWebKeyboardEvent(NSEvent *event, NSView *windowView);
};
} // namespace WebKit
diff --git a/WebKit2/Shared/mac/WebEventFactory.mm b/WebKit2/Shared/mac/WebEventFactory.mm
index 8e78ae6..ddc0a68 100644
--- a/WebKit2/Shared/mac/WebEventFactory.mm
+++ b/WebKit2/Shared/mac/WebEventFactory.mm
@@ -1013,7 +1013,7 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(NSEvent *event, NSView *windo
return WebWheelEvent(WebEvent::Wheel, positionX, positionY, globalPositionX, globalPositionY, deltaX, deltaY, wheelTicksX, wheelTicksY, granularity, modifiers, timestamp);
}
-WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event)
+WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(NSEvent *event, NSView *)
{
WebEvent::Type type = isKeyUpEvent(event) ? WebEvent::KeyUp : WebEvent::KeyDown;
String text = textFromEvent(event);
diff --git a/WebKit2/UIProcess/API/mac/WKView.mm b/WebKit2/UIProcess/API/mac/WKView.mm
index f97f82c..0751272 100644
--- a/WebKit2/UIProcess/API/mac/WKView.mm
+++ b/WebKit2/UIProcess/API/mac/WKView.mm
@@ -251,53 +251,31 @@ WEBCORE_COMMAND(selectAll)
return YES;
}
-- (void)mouseDown:(NSEvent *)theEvent
-{
- WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(theEvent, self);
- _data->_page->mouseEvent(mouseEvent);
-}
-- (void)mouseUp:(NSEvent *)theEvent
-{
- if (!_data->_page->isValid()) {
- _data->_page->revive();
- _data->_page->loadURL(_data->_page->urlAtProcessExit());
- return;
+#define EVENT_HANDLER(Selector, Type) \
+ - (void)Selector:(NSEvent *)theEvent \
+ { \
+ Web##Type##Event webEvent = WebEventFactory::createWeb##Type##Event(theEvent, self); \
+ _data->_page->handle##Type##Event(webEvent); \
}
- WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(theEvent, self);
- _data->_page->mouseEvent(mouseEvent);
-}
-
-- (void)mouseMoved:(NSEvent *)theEvent
-{
- WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(theEvent, self);
- _data->_page->mouseEvent(mouseEvent);
-}
-
-- (void)mouseDragged:(NSEvent *)theEvent
-{
- WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(theEvent, self);
- _data->_page->mouseEvent(mouseEvent);
-}
-
-- (void)scrollWheel:(NSEvent *)theEvent
-{
- WebWheelEvent wheelEvent = WebEventFactory::createWebWheelEvent(theEvent, self);
- _data->_page->wheelEvent(wheelEvent);
-}
-
-- (void)keyUp:(NSEvent *)theEvent
-{
- WebKeyboardEvent keyboardEvent = WebEventFactory::createWebKeyboardEvent(theEvent);
- _data->_page->keyEvent(keyboardEvent);
-}
-
-- (void)keyDown:(NSEvent *)theEvent
-{
- WebKeyboardEvent keyboardEvent = WebEventFactory::createWebKeyboardEvent(theEvent);
- _data->_page->keyEvent(keyboardEvent);
-}
+EVENT_HANDLER(mouseDown, Mouse)
+EVENT_HANDLER(mouseUp, Mouse)
+EVENT_HANDLER(mouseMoved, Mouse)
+EVENT_HANDLER(mouseDragged, Mouse)
+EVENT_HANDLER(rightMouseDown, Mouse)
+EVENT_HANDLER(rightMouseUp, Mouse)
+EVENT_HANDLER(rightMouseMoved, Mouse)
+EVENT_HANDLER(rightMouseDragged, Mouse)
+EVENT_HANDLER(otherMouseDown, Mouse)
+EVENT_HANDLER(otherMouseUp, Mouse)
+EVENT_HANDLER(otherMouseMoved, Mouse)
+EVENT_HANDLER(otherMouseDragged, Mouse)
+EVENT_HANDLER(scrollWheel, Wheel)
+EVENT_HANDLER(keyUp, Keyboard)
+EVENT_HANDLER(keyDown, Keyboard)
+
+#undef EVENT_HANDLER
- (void)_updateActiveState
{
diff --git a/WebKit2/UIProcess/API/qt/qwkpage.cpp b/WebKit2/UIProcess/API/qt/qwkpage.cpp
index a3af1e2..dfd52f4 100644
--- a/WebKit2/UIProcess/API/qt/qwkpage.cpp
+++ b/WebKit2/UIProcess/API/qt/qwkpage.cpp
@@ -108,13 +108,13 @@ void QWKPagePrivate::paint(QPainter* painter, QRect area)
void QWKPagePrivate::keyPressEvent(QKeyEvent* ev)
{
WebKeyboardEvent keyboardEvent = WebEventFactory::createWebKeyboardEvent(ev);
- page->keyEvent(keyboardEvent);
+ page->handleKeyboardEvent(keyboardEvent);
}
void QWKPagePrivate::keyReleaseEvent(QKeyEvent* ev)
{
WebKeyboardEvent keyboardEvent = WebEventFactory::createWebKeyboardEvent(ev);
- page->keyEvent(keyboardEvent);
+ page->handleKeyboardEvent(keyboardEvent);
}
void QWKPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
@@ -130,31 +130,31 @@ void QWKPagePrivate::mouseMoveEvent(QGraphicsSceneMouseEvent* ev)
lastPos = ev->pos();
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(ev, 0);
- page->mouseEvent(mouseEvent);
+ page->handleMouseEvent(mouseEvent);
}
void QWKPagePrivate::mousePressEvent(QGraphicsSceneMouseEvent* ev)
{
if (tripleClickTimer.isActive() && (ev->pos() - tripleClick).manhattanLength() < QApplication::startDragDistance()) {
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(ev, 3);
- page->mouseEvent(mouseEvent);
+ page->handleMouseEvent(mouseEvent);
return;
}
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(ev, 1);
- page->mouseEvent(mouseEvent);
+ page->handleMouseEvent(mouseEvent);
}
void QWKPagePrivate::mouseReleaseEvent(QGraphicsSceneMouseEvent* ev)
{
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(ev, 0);
- page->mouseEvent(mouseEvent);
+ page->handleMouseEvent(mouseEvent);
}
void QWKPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
{
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(ev, 2);
- page->mouseEvent(mouseEvent);
+ page->handleMouseEvent(mouseEvent);
tripleClickTimer.start(QApplication::doubleClickInterval(), q);
tripleClick = ev->pos().toPoint();
@@ -163,7 +163,7 @@ void QWKPagePrivate::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* ev)
void QWKPagePrivate::wheelEvent(QGraphicsSceneWheelEvent* ev)
{
WebWheelEvent wheelEvent = WebEventFactory::createWebWheelEvent(ev);
- page->wheelEvent(wheelEvent);
+ page->handleWheelEvent(wheelEvent);
}
void QWKPagePrivate::setEditCommandState(const WTF::String&, bool, int)
@@ -234,7 +234,7 @@ void QWKPagePrivate::_q_webActionTriggered(bool checked)
void QWKPagePrivate::touchEvent(QTouchEvent* event)
{
WebTouchEvent touchEvent = WebEventFactory::createWebTouchEvent(event);
- page->touchEvent(touchEvent);
+ page->handleTouchEvent(touchEvent);
}
#endif
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 2828a79..ce2776e 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -376,7 +376,7 @@ void WebPageProxy::setWindowFrame(const IntRect& windowFrame)
#endif
-void WebPageProxy::mouseEvent(const WebMouseEvent& event)
+void WebPageProxy::handleMouseEvent(const WebMouseEvent& event)
{
if (!isValid())
return;
@@ -387,7 +387,7 @@ void WebPageProxy::mouseEvent(const WebMouseEvent& event)
process()->send(Messages::WebPage::MouseEvent(event), m_pageID);
}
-void WebPageProxy::wheelEvent(const WebWheelEvent& event)
+void WebPageProxy::handleWheelEvent(const WebWheelEvent& event)
{
if (!isValid())
return;
@@ -396,7 +396,7 @@ void WebPageProxy::wheelEvent(const WebWheelEvent& event)
process()->send(Messages::WebPage::WheelEvent(event), m_pageID);
}
-void WebPageProxy::keyEvent(const WebKeyboardEvent& event)
+void WebPageProxy::handleKeyboardEvent(const WebKeyboardEvent& event)
{
if (!isValid())
return;
@@ -406,7 +406,7 @@ void WebPageProxy::keyEvent(const WebKeyboardEvent& event)
}
#if ENABLE(TOUCH_EVENTS)
-void WebPageProxy::touchEvent(const WebTouchEvent& event)
+void WebPageProxy::handleTouchEvent(const WebTouchEvent& event)
{
if (!isValid())
return;
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 730f0fc..e171bf5 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -142,11 +142,11 @@ public:
void setWindowFrame(const WebCore::IntRect&);
#endif
- void mouseEvent(const WebMouseEvent&);
- void wheelEvent(const WebWheelEvent&);
- void keyEvent(const WebKeyboardEvent&);
+ void handleMouseEvent(const WebMouseEvent&);
+ void handleWheelEvent(const WebWheelEvent&);
+ void handleKeyboardEvent(const WebKeyboardEvent&);
#if ENABLE(TOUCH_EVENTS)
- void touchEvent(const WebTouchEvent&);
+ void handleTouchEvent(const WebTouchEvent&);
#endif
const String& pageTitle() const { return m_pageTitle; }
diff --git a/WebKit2/UIProcess/win/WebView.cpp b/WebKit2/UIProcess/win/WebView.cpp
index cfe1edb..fa897d6 100644
--- a/WebKit2/UIProcess/win/WebView.cpp
+++ b/WebKit2/UIProcess/win/WebView.cpp
@@ -300,7 +300,7 @@ LRESULT WebView::onMouseEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
}
WebMouseEvent mouseEvent = WebEventFactory::createWebMouseEvent(hWnd, message, wParam, lParam);
- m_page->mouseEvent(mouseEvent);
+ m_page->handleMouseEvent(mouseEvent);
handled = true;
return 0;
@@ -325,7 +325,7 @@ LRESULT WebView::onWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
*/
WebWheelEvent wheelEvent = WebEventFactory::createWebWheelEvent(hWnd, message, wParam, lParam);
- m_page->wheelEvent(wheelEvent);
+ m_page->handleWheelEvent(wheelEvent);
handled = true;
return 0;
@@ -334,7 +334,7 @@ LRESULT WebView::onWheelEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
LRESULT WebView::onKeyEvent(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, bool& handled)
{
WebKeyboardEvent keyboardEvent = WebEventFactory::createWebKeyboardEvent(hWnd, message, wParam, lParam);
- m_page->keyEvent(keyboardEvent);
+ m_page->handleKeyboardEvent(keyboardEvent);
handled = true;
return 0;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list