[Qt] Find zoomable area using area-based hit-testing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 15:47:04 +0000 (15:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 30 Mar 2012 15:47:04 +0000 (15:47 +0000)
commit905f8d2ed16566a32177ffa88cc86b92d1f2d5f8
treea5ab27fb28f0cacc3498f9990c535d3228f0d156
parent7ae36790a9451fcd62b2b5d08e38aed59d8b3c98
[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
18 files changed:
LayoutTests/touchadjustment/zoom-basic-expected.txt [new file with mode: 0644]
LayoutTests/touchadjustment/zoom-basic.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/TouchAdjustment.cpp
Source/WebCore/page/TouchAdjustment.h
Source/WebCore/platform/graphics/IntSize.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/qt/QtWebPageEventHandler.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in