[Qt] Find zoomable area using area-based hit-testing
https://bugs.webkit.org/show_bug.cgi?id=82609
Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-03-30
Reviewed by Kenneth Rohde Christiansen.
Source/WebCore:
Implement API for calculating the best zoomable area for a
tap-to-zoom gesture.
It picks the area with the largest intersection with the touch. In most
cases this will be all areas fully containing the area, and returns the
smallest inner-most of these.
* page/EventHandler.cpp:
(WebCore::EventHandler::bestZoomableAreaForTouchPoint):
* page/EventHandler.h:
* page/TouchAdjustment.cpp:
(WebCore::TouchAdjustment::nodeIsZoomTarget):
(WebCore::TouchAdjustment::appendZoomableSubtargets):
(WebCore::TouchAdjustment::compileZoomableSubtargets):
(WebCore::TouchAdjustment::areaOfIntersection):
(WebCore::TouchAdjustment::findAreaWithLargestIntersection):
(WebCore::findBestZoomableArea):
* page/TouchAdjustment.h:
* platform/graphics/IntSize.h:
(WebCore::IntSize::area):
Source/WebKit2:
Add area to findZoomableAreaForPoint and use new TOUCH_ADJUSTMENT
code-path to find the best zoomable area.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findZoomableAreaForPoint):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/qt/QtWebPageEventHandler.cpp:
(QtWebPageEventHandler::handleDoubleTapEvent):
* WebProcess/WebPage/WebPage.cpp:
(WebKit):
(WebKit::WebPage::findZoomableAreaForPoint):
* WebProcess/WebPage/WebPage.h:
(WebPage):
* WebProcess/WebPage/WebPage.messages.in:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112669
268f45cc-cd09-0410-ab3c-
d52691b4dbfc