Title: [134117] trunk/Source/WebKit/blackberry
- Revision
- 134117
- Author
- [email protected]
- Date
- 2012-11-09 14:33:31 -0800 (Fri, 09 Nov 2012)
Log Message
[BlackBerry] Adding a sound to touch events on anchor elements
https://bugs.webkit.org/show_bug.cgi?id=101655
Patch by Otto Derek Cheung <[email protected]> on 2012-11-09
Reviewed by Antonio Gomes.
Adding audio feedback to touchevents on html anchor elements.
The feedback is called directly from client instead of using the
mouseup event to avoid the delay between touch start and end caused
by the tap sequence recognizer.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPage::playSoundIfAnchorIsTarget):
(WebKit):
* Api/WebPage.h:
* WebKitSupport/TouchEventHandler.cpp:
(WebKit):
(BlackBerry::WebKit::TouchEventHandler::playSoundIfAnchorIsTarget):
* WebKitSupport/TouchEventHandler.h:
(TouchEventHandler):
Modified Paths
Diff
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (134116 => 134117)
--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-11-09 22:32:49 UTC (rev 134116)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp 2012-11-09 22:33:31 UTC (rev 134117)
@@ -4114,6 +4114,11 @@
return d->m_touchEventHandler->handleTouchPoint(tPoint, useFatFingers);
}
+void WebPage::playSoundIfAnchorIsTarget() const
+{
+ d->m_touchEventHandler->playSoundIfAnchorIsTarget();
+}
+
bool WebPagePrivate::dispatchTouchPointAsMouseEventToFullScreenPlugin(PluginView* pluginView, const Platform::TouchPoint& point)
{
NPEvent npEvent;
Modified: trunk/Source/WebKit/blackberry/Api/WebPage.h (134116 => 134117)
--- trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-11-09 22:32:49 UTC (rev 134116)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.h 2012-11-09 22:33:31 UTC (rev 134117)
@@ -157,6 +157,8 @@
void touchEventCancel();
bool touchPointAsMouseEvent(const Platform::TouchPoint&, bool useFatFingers = true);
+ void playSoundIfAnchorIsTarget() const;
+
// Returns true if the key stroke was handled by WebKit.
bool keyEvent(const Platform::KeyboardEvent&);
Modified: trunk/Source/WebKit/blackberry/ChangeLog (134116 => 134117)
--- trunk/Source/WebKit/blackberry/ChangeLog 2012-11-09 22:32:49 UTC (rev 134116)
+++ trunk/Source/WebKit/blackberry/ChangeLog 2012-11-09 22:33:31 UTC (rev 134117)
@@ -1,3 +1,26 @@
+2012-11-09 Otto Derek Cheung <[email protected]>
+
+ [BlackBerry] Adding a sound to touch events on anchor elements
+ https://bugs.webkit.org/show_bug.cgi?id=101655
+
+ Reviewed by Antonio Gomes.
+
+ Adding audio feedback to touchevents on html anchor elements.
+
+ The feedback is called directly from client instead of using the
+ mouseup event to avoid the delay between touch start and end caused
+ by the tap sequence recognizer.
+
+ * Api/WebPage.cpp:
+ (BlackBerry::WebKit::WebPage::playSoundIfAnchorIsTarget):
+ (WebKit):
+ * Api/WebPage.h:
+ * WebKitSupport/TouchEventHandler.cpp:
+ (WebKit):
+ (BlackBerry::WebKit::TouchEventHandler::playSoundIfAnchorIsTarget):
+ * WebKitSupport/TouchEventHandler.h:
+ (TouchEventHandler):
+
2012-11-09 George Staikos <[email protected]>
[BlackBerry] Remove obsolete tokenizer settings
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp (134116 => 134117)
--- trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp 2012-11-09 22:32:49 UTC (rev 134116)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.cpp 2012-11-09 22:33:31 UTC (rev 134117)
@@ -19,6 +19,7 @@
#include "config.h"
#include "TouchEventHandler.h"
+#include "BlackBerryPlatformSystemSound.h"
#include "DOMSupport.h"
#include "Document.h"
#include "DocumentMarkerController.h"
@@ -182,6 +183,13 @@
return page->viewportSize().width() < page->contentsSize().width() || page->viewportSize().height() < page->contentsSize().height();
}
+
+void TouchEventHandler::playSoundIfAnchorIsTarget() const
+{
+ if (m_lastFatFingersResult.node() && m_lastFatFingersResult.node()->isLink())
+ BlackBerry::Platform::SystemSound::instance()->playSound(BlackBerry::Platform::SystemSoundType::InputKeypress);
+}
+
bool TouchEventHandler::handleTouchPoint(Platform::TouchPoint& point, bool useFatFingers)
{
// Enable input mode on any touch event.
Modified: trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h (134116 => 134117)
--- trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h 2012-11-09 22:32:49 UTC (rev 134116)
+++ trunk/Source/WebKit/blackberry/WebKitSupport/TouchEventHandler.h 2012-11-09 22:33:31 UTC (rev 134117)
@@ -39,6 +39,8 @@
void touchEventCancel();
void touchHoldEvent();
+ void playSoundIfAnchorIsTarget() const;
+
bool shouldSuppressMouseDownOnTouchDown() const;
const FatFingersResult& lastFatFingersResult() const { return m_lastFatFingersResult; }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes