Simplify hitTestResultAtPoint and nodesFromRect APIs
authorallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2012 16:09:16 +0000 (16:09 +0000)
committerallan.jensen@nokia.com <allan.jensen@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Sep 2012 16:09:16 +0000 (16:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=95720

Reviewed by Antonio Gomes.

.:

Update exported symbols.

* Source/autotools/symbols.filter:

Source/WebCore:

The existing API was overloaded and could be simplified by passing all the bool arguments in
a HitTestRequest argument. This should also help clarify the call as the enum values explicitely
state what they do.

* WebCore.exp.in:
* WebCore.order:
* dom/Document.cpp:
(WebCore::Document::nodesFromRect):
* dom/Document.h:
(Document):
* page/ContextMenuController.cpp:
(WebCore::ContextMenuController::createContextMenu):
* page/DragController.cpp:
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::updateAutoscrollRenderer):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::bestClickableNodeForTouchPoint):
(WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
(WebCore::EventHandler::bestZoomableAreaForTouchPoint):
(WebCore::EventHandler::handleTouchEvent):
* page/EventHandler.h:
(EventHandler):
* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
* page/Frame.cpp:
(WebCore::Frame::visiblePositionForPoint):
(WebCore::Frame::documentAtPoint):
* page/TouchDisambiguation.cpp:
(WebCore::findGoodTouchTargets):
* rendering/HitTestRequest.h:
(HitTestRequest):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):

Source/WebKit/blackberry:

Update calls to new API.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::contextNode):
(BlackBerry::WebKit::WebPagePrivate::nodeForZoomUnderPoint):
(BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
(BlackBerry::WebKit::WebPage::nodeAtPoint):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect):
(BlackBerry::WebKit::FatFingers::getRelevantInfoFromPoint):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):

Source/WebKit/chromium:

Update calls to new API.

* src/ContextMenuClientImpl.cpp:
(WebKit::selectMisspelledWord):
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForNavigationAction):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::characterIndexForPoint):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::isRectTopmost):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleMouseUp):
(WebKit::WebViewImpl::computeBlockBounds):

Source/WebKit/efl:

Update calls to new API.

* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_new):

Source/WebKit/mac:

Update calls to new API.

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::actionDictionary):
* WebView/WebHTMLView.mm:
(-[WebHTMLView elementAtPoint:allowShadowContent:]):

Source/WebKit/qt:

Update calls to new API.

* Api/qwebframe.cpp:
(QWebFrame::hitTestContent):
* Api/qwebpage.cpp:
(QWebPagePrivate::handleSoftwareInputPanel):
(QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch):
(QWebPage::updatePositionDependentActions):
* WebCoreSupport/FrameLoaderClientQt.cpp:
(WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):

Source/WebKit/win:

Update calls to new API.

* WebActionPropertyBag.cpp:
(WebActionPropertyBag::Read):
* WebView.cpp:
(WebView::handleContextMenuEvent):
(WebView::elementAtPoint):

Source/WebKit/wx:

Update calls to new API.

* WebFrame.cpp:
(WebKit::WebFrame::HitTest):

Source/WebKit2:

Update calls to new API and update exported symbols.

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleContextMenuEvent):
(WebKit::WebPage::highlightPotentialActivation): Corrects the misplaced arguments while converting them.
(WebKit::WebPage::findZoomableAreaForPoint):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::characterIndexForPoint):
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::shouldDelayWindowOrderingEvent):
(WebKit::WebPage::acceptsFirstMouse):
* win/WebKit2.def:
* win/WebKit2CFLite.def:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

46 files changed:
ChangeLog
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/page/ContextMenuController.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/FocusController.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/TouchDisambiguation.cpp
Source/WebCore/rendering/HitTestRequest.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/blackberry/Api/WebPage.cpp
Source/WebKit/blackberry/ChangeLog
Source/WebKit/blackberry/WebKitSupport/FatFingers.cpp
Source/WebKit/blackberry/WebKitSupport/SelectionHandler.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ContextMenuClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/WebFrameImpl.cpp
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/ewk/ewk_frame.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/qt/Api/qwebframe.cpp
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebActionPropertyBag.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebFrame.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter

index 197ce60..1e5cf93 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update exported symbols.
+
+        * Source/autotools/symbols.filter:
+
 2012-09-07  Zan Dobersek  <zandobersek@gmail.com>
 
         [GTK] Multiple feature defines in webcore_cppflags can occur
index db2fd30..e33c509 100644 (file)
@@ -1,3 +1,48 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        The existing API was overloaded and could be simplified by passing all the bool arguments in 
+        a HitTestRequest argument. This should also help clarify the call as the enum values explicitely
+        state what they do.
+
+        * WebCore.exp.in:
+        * WebCore.order:
+        * dom/Document.cpp:
+        (WebCore::Document::nodesFromRect):
+        * dom/Document.h:
+        (Document):
+        * page/ContextMenuController.cpp:
+        (WebCore::ContextMenuController::createContextMenu):
+        * page/DragController.cpp:
+        (WebCore::DragController::canProcessDrag):
+        (WebCore::DragController::startDrag):
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::updateAutoscrollRenderer):
+        (WebCore::EventHandler::hitTestResultAtPoint):
+        (WebCore::EventHandler::handleMousePressEvent):
+        (WebCore::EventHandler::handleGestureEvent):
+        (WebCore::EventHandler::bestClickableNodeForTouchPoint):
+        (WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
+        (WebCore::EventHandler::bestZoomableAreaForTouchPoint):
+        (WebCore::EventHandler::handleTouchEvent):
+        * page/EventHandler.h:
+        (EventHandler):
+        * page/FocusController.cpp:
+        (WebCore::updateFocusCandidateIfNeeded):
+        * page/Frame.cpp:
+        (WebCore::Frame::visiblePositionForPoint):
+        (WebCore::Frame::documentAtPoint):
+        * page/TouchDisambiguation.cpp:
+        (WebCore::findGoodTouchTargets):
+        * rendering/HitTestRequest.h:
+        (HitTestRequest):
+        * testing/Internals.cpp:
+        (WebCore::Internals::nodesFromRect):
+
 2012-09-07  Simon Hausmann  <simon.hausmann@nokia.com>
 
         Build of OpenGLShims.cpp against EGL/GLES2 platforms is broken
index a65d5d5..b4769f9 100644 (file)
@@ -158,7 +158,7 @@ __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranu
 __ZN7WebCore12EventHandler15handleAccessKeyERKNS_21PlatformKeyboardEventE
 __ZN7WebCore12EventHandler16handleWheelEventERKNS_18PlatformWheelEventE
 __ZN7WebCore12EventHandler17scrollRecursivelyENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_21FractionalLayoutPointEbbNS_17HitTestScrollbarsEjRKNS_20FractionalLayoutSizeE
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_21FractionalLayoutPointEjRKNS_20FractionalLayoutSizeE
 __ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler24logicalScrollRecursivelyENS_22ScrollLogicalDirectionENS_17ScrollGranularityEPNS_4NodeE
@@ -1354,7 +1354,7 @@ __ZNK7WebCore7RunLoop9TimerBase8isActiveEv
 __ZNK7WebCore8Document10renderViewEv
 __ZNK7WebCore8Document11completeURLERKN3WTF6StringE
 __ZNK7WebCore8Document13axObjectCacheEv
-__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
+__ZNK7WebCore8Document13nodesFromRectEiijjjjj
 __ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
 __ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
 __ZNK7WebCore8Document4bodyEv
index a243432..4d09ead 100644 (file)
@@ -22785,7 +22785,7 @@ __ZNK7WebCore12NodeIterator20updateForNodeRemovalEPNS_4NodeERNS0_11NodePointerE
 __ZN7WebCore27jsNodeIteratorReferenceNodeEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
 __ZNK7WebCore4Node20traversePreviousNodeEPKS0_
 __ZN7WebCore37jsNodeIteratorPrototypeFunctionDetachEPN3JSC9ExecStateE
-__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
+__ZNK7WebCore8Document13nodesFromRectEiijjjjj
 __ZNK7WebCore8Document17handleZeroPaddingERKNS_14HitTestRequestERNS_13HitTestResultE
 __ZN3WTF21ListHashSetTranslatorINS_6RefPtrIN7WebCore4NodeEEELm256ENS_7PtrHashIS4_EEE9translateERPNS_15ListHashSetNodeIS4_Lm256EEERKS4_PNS_24ListHashSetNodeAllocatorIS4_Lm256EEE
 __ZN7WebCore21StaticHashSetNodeListC1ERN3WTF11ListHashSetINS1_6RefPtrINS_4NodeEEELm256ENS1_7PtrHashIS5_EEEE
index 6e328a5..dfc7337 100644 (file)
@@ -1384,7 +1384,7 @@ String Document::suggestedMIMEType() const
 // * making it receive a rect as parameter, i.e. nodesFromRect(x, y, w, h);
 // * making it receive the expading size of each direction separately,
 //   i.e. nodesFromRect(x, y, topSize, rightSize, bottomSize, leftSize);
-PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const
+PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, HitTestRequest::HitTestRequestType hitType) const
 {
     // FIXME: Share code between this, elementFromPoint and caretRangeFromPoint.
     if (!renderer())
@@ -1399,19 +1399,11 @@ PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned
     float zoomFactor = frame->pageZoomFactor();
     LayoutPoint point = roundedLayoutPoint(FloatPoint(centerX * zoomFactor + view()->scrollX(), centerY * zoomFactor + view()->scrollY()));
 
-    int type = HitTestRequest::ReadOnly | HitTestRequest::Active;
+    HitTestRequest request(hitType);
 
     // When ignoreClipping is false, this method returns null for coordinates outside of the viewport.
-    if (ignoreClipping)
-        type |= HitTestRequest::IgnoreClipping;
-    else if (!frameView->visibleContentRect().intersects(HitTestResult::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
+    if (!request.ignoreClipping() && !frameView->visibleContentRect().intersects(HitTestResult::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
         return 0;
-    if (allowShadowContent)
-        type |= HitTestRequest::AllowShadowContent;
-    if (allowChildFrameContent)
-        type |= HitTestRequest::AllowChildFrameContent;
-
-    HitTestRequest request(type);
 
     // Passing a zero padding will trigger a rect hit test, however for the purposes of nodesFromRect,
     // we special handle this case in order to return a valid NodeList.
index 2872e5c..dafe04b 100644 (file)
@@ -34,6 +34,7 @@
 #include "DOMTimeStamp.h"
 #include "DocumentEventQueue.h"
 #include "DocumentTiming.h"
+#include "HitTestRequest.h"
 #include "IconURL.h"
 #include "InspectorCounters.h"
 #include "IntRect.h"
@@ -376,12 +377,10 @@ public:
      * @param rightPadding How much to expand the right of the rectangle
      * @param bottomPadding How much to expand the bottom of the rectangle
      * @param leftPadding How much to expand the left of the rectangle
-     * @param ignoreClipping whether or not to ignore the root scroll frame when retrieving the element.
-     *        If false, this method returns null for coordinates outside of the viewport.
      */
     PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY,
                                        unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
-                                       bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent = false) const;
+                                       HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active) const;
     Element* elementFromPoint(int x, int y) const;
     PassRefPtr<Range> caretRangeFromPoint(int x, int y);
 
index d9019fc..87f3cc4 100644 (file)
@@ -149,7 +149,7 @@ PassOwnPtr<ContextMenu> ContextMenuController::createContextMenu(Event* event)
     HitTestResult result(mouseEvent->absoluteLocation());
 
     if (Frame* frame = event->target()->toNode()->document()->frame())
-        result = frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false);
+        result = frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation());
 
     if (!result.innerNonSharedNode())
         return nullptr;
index c744c18..a1e78b8 100644 (file)
@@ -544,7 +544,7 @@ bool DragController::canProcessDrag(DragData* dragData)
     if (!m_page->mainFrame()->contentRenderer())
         return false;
 
-    result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, true);
+    result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
 
     if (!result.innerNonSharedNode())
         return false;
@@ -726,7 +726,7 @@ bool DragController::startDrag(Frame* src, const DragState& state, DragOperation
     if (!src->view() || !src->contentRenderer())
         return false;
 
-    HitTestResult hitTestResult = src->eventHandler()->hitTestResultAtPoint(dragOrigin, true);
+    HitTestResult hitTestResult = src->eventHandler()->hitTestResultAtPoint(dragOrigin, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     if (!state.m_dragSrc->contains(hitTestResult.innerNode()))
         // The original node being dragged isn't under the drag origin anymore... maybe it was
         // hidden or moved out from under the cursor. Regardless, we don't want to start a drag on
index 001fd6d..3807c55 100644 (file)
@@ -1007,7 +1007,7 @@ void EventHandler::updateAutoscrollRenderer()
     if (!m_autoscrollRenderer)
         return;
 
-    HitTestResult hitTest = hitTestResultAtPoint(m_panScrollStartPos, true);
+    HitTestResult hitTest = hitTestResultAtPoint(m_panScrollStartPos, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
 
     if (Node* nodeAtPoint = hitTest.innerNode())
         m_autoscrollRenderer = nodeAtPoint->renderer();
@@ -1039,22 +1039,17 @@ DragSourceAction EventHandler::updateDragSourceActionsAllowed() const
 }
 #endif // ENABLE(DRAG_SUPPORT)
     
-HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding)
+HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding)
 {
     HitTestResult result(point, padding.height(), padding.width(), padding.height(), padding.width());
 
     if (!m_frame->contentRenderer())
         return result;
-    if (ignoreClipping)
-        hitType |= HitTestRequest::IgnoreClipping;
-    if (allowShadowContent)
-        hitType |= HitTestRequest::AllowShadowContent;
-    if (testScrollbars == ShouldHitTestScrollbars)
-        hitType |= HitTestRequest::TestChildFrameScrollBars;
     // We always need to handle child frame content.
     hitType |= HitTestRequest::AllowChildFrameContent;
 
-    m_frame->contentRenderer()->hitTest(HitTestRequest(hitType), result);
+    HitTestRequest request(hitType);
+    m_frame->contentRenderer()->hitTest(request, result);
 
     // If our HitTestResult is not visible, then we started hit testing too far down the frame chain. 
     // Another hit test at the main frame level should get us the correct visible result.
@@ -1066,12 +1061,12 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool
             FrameView* mainView = mainFrame->view();
             if (resultView && mainView) {
                 IntPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(roundedIntPoint(result.point())));
-                result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding);
+                result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, hitType, padding);
             }
         }
     }
 
-    if (!allowShadowContent)
+    if (!request.allowsShadowContent())
         result.setToNonShadowAncestor();
 
     return result;
@@ -1481,7 +1476,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
     m_mouseDownWasInSubframe = false;
 
     HitTestRequest request(HitTestRequest::Active);
-    // Save the document point we generate in case the window coordinate is invalidated by what happens 
+    // Save the document point we generate in case the window coordinate is invalidated by what happens
     // when we dispatch the event.
     LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.position());
     MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
@@ -2381,7 +2376,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
         eventTarget = m_scrollGestureHandlingNode.get();
 
     if (!eventTarget) {
-        HitTestResult result = hitTestResultAtPoint(gestureEvent.position(), false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
+        HitTestResult result = hitTestResultAtPoint(gestureEvent.position());
         eventTarget = result.targetNode();
     }
 
@@ -2483,9 +2478,8 @@ bool EventHandler::handleGestureScrollCore(const PlatformGestureEvent& gestureEv
 #if ENABLE(TOUCH_ADJUSTMENT)
 bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
 {
-    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
-    HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+    HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent, touchRadius);
 
     IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -2502,9 +2496,8 @@ bool EventHandler::bestClickableNodeForTouchPoint(const IntPoint& touchCenter, c
 
 bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntPoint& targetPoint, Node*& targetNode)
 {
-    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
-    HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+    HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent, touchRadius);
 
     IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -2513,9 +2506,8 @@ bool EventHandler::bestContextMenuNodeForTouchPoint(const IntPoint& touchCenter,
 
 bool EventHandler::bestZoomableAreaForTouchPoint(const IntPoint& touchCenter, const IntSize& touchRadius, IntRect& targetArea, Node*& targetNode)
 {
-    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     IntPoint hitTestPoint = m_frame->view()->windowToContents(touchCenter);
-    HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
+    HitTestResult result = hitTestResultAtPoint(hitTestPoint, HitTestRequest::ReadOnly | HitTestRequest::Active, touchRadius);
 
     IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
     RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
@@ -3557,7 +3549,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
         unsigned touchPointTargetKey = point.id() + 1;
         RefPtr<EventTarget> touchTarget;
         if (pointState == PlatformTouchPoint::TouchPressed) {
-            HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
+            HitTestResult result = hitTestResultAtPoint(pagePoint, hitType);
             Node* node = result.innerNode();
             ASSERT(node);
 
@@ -3575,7 +3567,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
             touchTarget = node;
         } else if (pointState == PlatformTouchPoint::TouchReleased || pointState == PlatformTouchPoint::TouchCancelled) {
             // We only perform a hittest on release or cancel to unset :active or :hover state.
-            hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
+            hitTestResultAtPoint(pagePoint, hitType);
             // The target should be the original target for this touch, so get it from the hashmap. As it's a release or cancel
             // we also remove it from the map.
             touchTarget = m_originatingTouchPointTargets.take(touchPointTargetKey);
index 6d8a0ab..97d0bd0 100644 (file)
@@ -88,8 +88,6 @@ extern const int TextDragHysteresis;
 extern const int GeneralDragHysteresis;
 #endif // ENABLE(DRAG_SUPPORT)
 
-enum HitTestScrollbars { ShouldHitTestScrollbars, DontHitTestScrollbars };
-
 class EventHandler {
     WTF_MAKE_NONCOPYABLE(EventHandler);
 public:
@@ -115,9 +113,7 @@ public:
     void dispatchFakeMouseMoveEventSoon();
     void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
 
-    HitTestResult hitTestResultAtPoint(const LayoutPoint&, bool allowShadowContent, bool ignoreClipping = false,
-                                       HitTestScrollbars scrollbars = DontHitTestScrollbars,
-                                       HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
+    HitTestResult hitTestResultAtPoint(const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
                                        const LayoutSize& padding = LayoutSize());
 
     bool mousePressed() const { return m_mousePressed; }
index 0b9418b..0705c0b 100644 (file)
@@ -745,7 +745,7 @@ static void updateFocusCandidateIfNeeded(FocusDirection direction, const FocusCa
         // If 2 nodes are intersecting, do hit test to find which node in on top.
         LayoutUnit x = intersectionRect.x() + intersectionRect.width() / 2;
         LayoutUnit y = intersectionRect.y() + intersectionRect.height() / 2;
-        HitTestResult result = candidate.visibleNode->document()->page()->mainFrame()->eventHandler()->hitTestResultAtPoint(IntPoint(x, y), false, true);
+        HitTestResult result = candidate.visibleNode->document()->page()->mainFrame()->eventHandler()->hitTestResultAtPoint(IntPoint(x, y), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
         if (candidate.visibleNode->contains(result.innerNode())) {
             closest = candidate;
             return;
index 85c2a33..4717267 100644 (file)
@@ -724,7 +724,7 @@ String Frame::displayStringModifiedByEncoding(const String& str) const
 
 VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint)
 {
-    HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, true);
+    HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     Node* node = result.innerNonSharedNode();
     if (!node)
         return VisiblePosition();
@@ -746,7 +746,7 @@ Document* Frame::documentAtPoint(const IntPoint& point)
     HitTestResult result = HitTestResult(pt);
 
     if (contentRenderer())
-        result = eventHandler()->hitTestResultAtPoint(pt, false);
+        result = eventHandler()->hitTestResultAtPoint(pt);
     return result.innerNode() ? result.innerNode()->document() : 0;
 }
 
index 5efe3db..dfeedb2 100644 (file)
@@ -96,7 +96,7 @@ void findGoodTouchTargets(const IntRect& touchBox, Frame* mainFrame, float pageS
     IntPoint touchPoint = touchBox.center();
     IntPoint contentsPoint = mainFrame->view()->windowToContents(touchPoint);
 
-    HitTestResult result = mainFrame->eventHandler()->hitTestResultAtPoint(contentsPoint, false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(padding, padding));
+    HitTestResult result = mainFrame->eventHandler()->hitTestResultAtPoint(contentsPoint, HitTestRequest::ReadOnly | HitTestRequest::Active, IntSize(padding, padding));
     const ListHashSet<RefPtr<Node> >& hitResults = result.rectBasedTestResult();
 
     HashMap<Node*, TouchTargetData> touchTargets;
index 3faf88a..1900900 100644 (file)
@@ -37,6 +37,7 @@ public:
         TouchEvent = 1 << 7,
         AllowShadowContent = 1 << 8,
         AllowChildFrameContent = 1 << 9,
+        // FIXME: Get rid of the two options below if possible.
         ChildFrameHitTest = 1 << 10,
         TestChildFrameScrollBars = 1 << 11
     };
index 3694814..04cfecd 100644 (file)
@@ -972,8 +972,15 @@ PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y,
         ec = INVALID_ACCESS_ERR;
         return 0;
     }
-
-    return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent, allowChildFrameContent);
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
+    if (ignoreClipping)
+        hitType |= HitTestRequest::IgnoreClipping;
+    if (allowShadowContent)
+        hitType |= HitTestRequest::AllowShadowContent;
+    if (allowChildFrameContent)
+        hitType |= HitTestRequest::AllowChildFrameContent;
+
+    return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, hitType);
 }
 
 void Internals::emitInspectorDidBeginFrame()
index 55770a6..a42b47b 100644 (file)
@@ -2753,7 +2753,7 @@ PassRefPtr<Node> WebPagePrivate::contextNode(TargetDetectionStrategy strategy)
         return result.node(FatFingersResult::ShadowContentNotAllowed);
     }
 
-    HitTestResult result = eventHandler->hitTestResultAtPoint(contentPos, false /*allowShadowContent*/);
+    HitTestResult result = eventHandler->hitTestResultAtPoint(contentPos);
     return result.innerNode();
 }
 
@@ -2825,7 +2825,7 @@ Node* WebPagePrivate::nodeForZoomUnderPoint(const IntPoint& point)
     if (!m_mainFrame)
         return 0;
 
-    HitTestResult result = m_mainFrame->eventHandler()->hitTestResultAtPoint(mapFromTransformed(point), false);
+    HitTestResult result = m_mainFrame->eventHandler()->hitTestResultAtPoint(mapFromTransformed(point));
 
     Node* node = result.innerNonSharedNode();
 
@@ -4035,7 +4035,7 @@ bool WebPagePrivate::handleMouseEvent(PlatformMouseEvent& mouseEvent)
     }
 
     if (!node) {
-        HitTestResult result = eventHandler->hitTestResultAtPoint(mapFromViewportToContents(mouseEvent.position()), false /*allowShadowContent*/);
+        HitTestResult result = eventHandler->hitTestResultAtPoint(mapFromViewportToContents(mouseEvent.position()));
         node = result.innerNode();
     }
 
@@ -5198,7 +5198,7 @@ WebDOMDocument WebPage::document() const
 
 WebDOMNode WebPage::nodeAtPoint(int x, int y)
 {
-    HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(d->mapFromTransformed(IntPoint(x, y)), false);
+    HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(d->mapFromTransformed(IntPoint(x, y)));
     Node* node = result.innerNonSharedNode();
     return WebDOMNode(node);
 }
index 8fc0fd0..aea12cf 100644 (file)
@@ -1,3 +1,23 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::contextNode):
+        (BlackBerry::WebKit::WebPagePrivate::nodeForZoomUnderPoint):
+        (BlackBerry::WebKit::WebPagePrivate::handleMouseEvent):
+        (BlackBerry::WebKit::WebPage::nodeAtPoint):
+        * WebKitSupport/FatFingers.cpp:
+        (BlackBerry::WebKit::FatFingers::getNodesFromRect):
+        (BlackBerry::WebKit::FatFingers::getRelevantInfoFromPoint):
+        * WebKitSupport/SelectionHandler.cpp:
+        (BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):
+
 2012-09-07  Robin Cao  <robin.cao@torchmobile.com.cn>
 
         [BlackBerry] Rendering issue after rotation
index c3442c8..f42f5ed 100644 (file)
@@ -491,11 +491,12 @@ void FatFingers::getNodesFromRect(Document* document, const IntPoint& contentPos
     unsigned topPadding, rightPadding, bottomPadding, leftPadding;
     getPaddings(topPadding, rightPadding, bottomPadding, leftPadding);
 
-    HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
     // The user functions checkForText() and findIntersectingRegions() uses the Node.wholeText() to checkFingerIntersection()
     // not the text in its shadow tree.
-    ShadowContentFilterPolicy allowShadow = m_targetType == Text ? DoNotAllowShadowContent : AllowShadowContent;
-    HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding, allowShadow);
+    HitTestRequest request = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
+    if (m_targetType != Text)
+        request |= HitTestRequest::AllowShadowContent;
+    HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding);
 
     document->renderView()->layer()->hitTest(request, result);
     intersectedNodes = result.rectBasedTestResult();
@@ -510,7 +511,7 @@ void FatFingers::getRelevantInfoFromPoint(Document* document, const IntPoint& co
     if (!document || !document->renderer() || !document->frame())
         return;
 
-    HitTestResult result  = document->frame()->eventHandler()->hitTestResultAtPoint(contentPos, true /*allowShadowContent*/);
+    HitTestResult result  = document->frame()->eventHandler()->hitTestResultAtPoint(contentPos, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     Node* node = result.innerNode();
     while (node && !node->isElementNode())
         node = node->parentNode();
index 3b04247..08c0f88 100644 (file)
@@ -159,7 +159,7 @@ static VisiblePosition visiblePositionForPointIgnoringClipping(const Frame& fram
     // outside the visible rect. To work around the bug, this is a copy of
     // visiblePositionAtPoint which which passes ignoreClipping=true.
     // See RIM Bug #4315.
-    HitTestResult result = frame.eventHandler()->hitTestResultAtPoint(framePoint, true /* allowShadowContent */, true /* ignoreClipping */);
+    HitTestResult result = frame.eventHandler()->hitTestResultAtPoint(framePoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent | HitTestRequest::IgnoreClipping);
 
     Node* node = result.innerNode();
     if (!node || node->document() != frame.document())
index 66c18a7..b269dd9 100644 (file)
@@ -1,3 +1,24 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * src/ContextMenuClientImpl.cpp:
+        (WebKit::selectMisspelledWord):
+        * src/FrameLoaderClientImpl.cpp:
+        (WebKit::FrameLoaderClientImpl::dispatchDecidePolicyForNavigationAction):
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::characterIndexForPoint):
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::isRectTopmost):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::handleMouseUp):
+        (WebKit::WebViewImpl::computeBlockBounds):
+
 2012-09-07  Ilya Tikhonovsky  <loislo@chromium.org>
 
         Web Inspector: NMI: move WebCore specific code to separate header
index 641a585..2fd6431 100644 (file)
@@ -122,7 +122,7 @@ static String selectMisspelledWord(const ContextMenu* defaultMenu, Frame* select
 
     // Selection is empty, so change the selection to the word under the cursor.
     HitTestResult hitTestResult = selectedFrame->eventHandler()->
-        hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().point(), true);
+        hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().point(), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     Node* innerNode = hitTestResult.innerNode();
     VisiblePosition pos(innerNode->renderer()->positionForPoint(
         hitTestResult.localPoint()));
index 5dd02b5..c99bd7c 100644 (file)
@@ -997,8 +997,7 @@ void FrameLoaderClientImpl::dispatchDecidePolicyForNavigationAction(
                 if (event->isMouseEvent()) {
                     const MouseEvent* mouseEvent =
                         static_cast<const MouseEvent*>(event);
-                    node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(
-                        mouseEvent->absoluteLocation(), false).innerNonSharedNode();
+                    node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation()).innerNonSharedNode();
                     break;
                 }
             }
index ae3b599..4395c6d 100644 (file)
@@ -1263,7 +1263,7 @@ size_t WebFrameImpl::characterIndexForPoint(const WebPoint& webPoint) const
         return notFound;
 
     IntPoint point = frame()->view()->windowToContents(webPoint);
-    HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point, false);
+    HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point);
     RefPtr<Range> range = frame()->rangeForPoint(result.roundedPoint());
     if (!range)
         return notFound;
index fe99ab8..97ba61f 100644 (file)
@@ -513,7 +513,7 @@ bool WebPluginContainerImpl::isRectTopmost(const WebRect& rect)
     LayoutPoint center = documentRect.center();
     // Make the rect we're checking (the point surrounded by padding rects) contained inside the requested rect. (Note that -1/2 is 0.)
     LayoutSize padding((documentRect.width() - 1) / 2, (documentRect.height() - 1) / 2);
-    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
+    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
     const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
     if (nodes.size() != 1)
         return false;
index f47f9dc..8d53e95 100644 (file)
@@ -637,7 +637,7 @@ void WebViewImpl::handleMouseUp(Frame& mainFrame, const WebMouseEvent& event)
         FrameView* view = m_page->mainFrame()->view();
         IntPoint clickPoint(m_lastMouseDownPoint.x, m_lastMouseDownPoint.y);
         IntPoint contentPoint = view->windowToContents(clickPoint);
-        HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, false, false, ShouldHitTestScrollbars);
+        HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TestChildFrameScrollBars);
         // We don't want to send a paste when middle clicking a scroll bar or a
         // link (which will navigate later in the code).  The main scrollbars
         // have to be handled separately.
@@ -1001,9 +1001,8 @@ WebRect WebViewImpl::computeBlockBounds(const WebRect& rect, AutoZoomType zoomTy
 
     // Use the rect-based hit test to find the node.
     IntPoint point = mainFrameImpl()->frameView()->windowToContents(IntPoint(rect.x, rect.y));
-    HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point,
-            false, zoomType == FindInPage, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly,
-            IntSize(rect.width, rect.height));
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | ((zoomType == FindInPage) ? HitTestRequest::IgnoreClipping : 0);
+    HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point, hitType, IntSize(rect.width, rect.height));
 
     Node* node = result.innerNonSharedNode();
     if (!node)
index 3178eda..0977eb8 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * ewk/ewk_frame.cpp:
+        (ewk_frame_hit_test_new):
+
 2012-09-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         Unreviewed, rolling out r127839.
index e2e5f75..5092ac7 100644 (file)
@@ -38,6 +38,7 @@
 #include "HTMLNames.h"
 #include "HTMLPlugInElement.h"
 #include "HistoryItem.h"
+#include "HitTestRequest.h"
 #include "HitTestResult.h"
 #include "IntSize.h"
 #include "KURL.h"
@@ -693,8 +694,8 @@ Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* ewkFrame, int x, int y)
     EINA_SAFETY_ON_NULL_RETURN_VAL(smartData->frame->contentRenderer(), 0);
 
     WebCore::HitTestResult result = smartData->frame->eventHandler()->hitTestResultAtPoint
-                                        (view->windowToContents(WebCore::IntPoint(x, y)),
-                                        /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+                                        (view->windowToContents(WebCore::IntPoint(x, y)), 
+                                        WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active | WebCore::HitTestRequest::IgnoreClipping);
 
     if (result.scrollbar())
         return 0;
index 42de786..e8a5727 100644 (file)
@@ -1,3 +1,17 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * WebCoreSupport/WebFrameLoaderClient.mm:
+        (WebFrameLoaderClient::actionDictionary):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView elementAtPoint:allowShadowContent:]):
+
 2012-09-05  Sam Weinig  <sam@webkit.org>
 
         Part 2 of removing PlatformString.h, remove PlatformString.h
index 64e44a4..5b68a1f 100644 (file)
@@ -1332,7 +1332,7 @@ NSDictionary *WebFrameLoaderClient::actionDictionary(const NavigationAction& act
 
     if (const MouseEvent* mouseEvent = findMouseEvent(event)) {
         WebElementDictionary *element = [[WebElementDictionary alloc]
-            initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false)];
+            initWithHitTestResult:core(m_webFrame.get())->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation())];
         [result setObject:element forKey:WebActionElementKey];
         [element release];
 
index bfede8d..964995f 100644 (file)
@@ -6206,7 +6206,8 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
     Frame* coreFrame = core([self _frame]);
     if (!coreFrame)
         return nil;
-    return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), allow)] autorelease];
+    HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | (allow ? HitTestRequest::AllowShadowContent : 0);
+    return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), hitType)] autorelease];
 }
 
 - (NSUInteger)countMatchesForText:(NSString *)string inDOMRange:(DOMRange *)range options:(WebFindOptions)options limit:(NSUInteger)limit markMatches:(BOOL)markMatches
index adbfa1c..8ac18f8 100644 (file)
@@ -1406,7 +1406,7 @@ QWebHitTestResult QWebFrame::hitTestContent(const QPoint &pos) const
     if (!d->frame->view() || !d->frame->contentRenderer())
         return QWebHitTestResult();
 
-    HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+    HitTestResult result = d->frame->eventHandler()->hitTestResultAtPoint(d->frame->view()->windowToContents(pos), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
 
     if (result.scrollbar())
         return QWebHitTestResult();
index ec594f4..8d4b573 100644 (file)
@@ -800,7 +800,7 @@ void QWebPagePrivate::handleSoftwareInputPanel(Qt::MouseButton button, const QPo
         QStyle::RequestSoftwareInputPanel behavior = QStyle::RequestSoftwareInputPanel(
             client->ownerWidget()->style()->styleHint(QStyle::SH_RequestSoftwareInputPanel));
         if (!clickCausedFocus || behavior == QStyle::RSIP_OnMouseClick) {
-            HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos), false);
+            HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos));
             if (result.isContentEditable()) {
                 QEvent event(QEvent::RequestSoftwareInputPanel);
                 QApplication::sendEvent(client->ownerWidget(), &event);
@@ -1557,7 +1557,7 @@ IntPoint QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch(const IntPoi
     int x = touchPoint.x();
     int y = touchPoint.y();
 
-    RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding, false /*ignoreClipping*/, false /*allowShadowContent*/);
+    RefPtr<NodeList> intersectedNodes = document->nodesFromRect(x, y, m_topPadding, m_rightPadding, m_bottomPadding, m_leftPadding);
     if (!intersectedNodes)
         return IntPoint();
 
@@ -3363,7 +3363,7 @@ void QWebPage::updatePositionDependentActions(const QPoint &pos)
     d->createMainFrame();
     WebCore::Frame* focusedFrame = d->page->focusController()->focusedOrMainFrame();
 
-    HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos), /*allowShadowContent*/ false);
+    HitTestResult result = focusedFrame->eventHandler()->hitTestResultAtPoint(focusedFrame->view()->windowToContents(pos));
     if (result.scrollbar())
         d->hitTestResult = QWebHitTestResult();
     else
index 995c09b..c8876b3 100644 (file)
@@ -1,5 +1,23 @@
 2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * Api/qwebframe.cpp:
+        (QWebFrame::hitTestContent):
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::handleSoftwareInputPanel):
+        (QWebPagePrivate::TouchAdjuster::findCandidatePointForTouch):
+        (QWebPage::updatePositionDependentActions):
+        * WebCoreSupport/FrameLoaderClientQt.cpp:
+        (WebCore::FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction):
+
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
         X11 Global Selection
         https://bugs.webkit.org/show_bug.cgi?id=88238
 
index bcf072d..72a5e00 100644 (file)
@@ -1272,7 +1272,7 @@ void FrameLoaderClientQt::dispatchDecidePolicyForNavigationAction(FramePolicyFun
             if (event->isMouseEvent()) {
                 const MouseEvent* mouseEvent =  static_cast<const MouseEvent*>(event);
                 node = QWebFramePrivate::core(m_webFrame)->eventHandler()->hitTestResultAtPoint(
-                    mouseEvent->absoluteLocation(), false).innerNonSharedNode();
+                    mouseEvent->absoluteLocation()).innerNonSharedNode();
                 break;
             }
         }
index fef391e..e22cb19 100644 (file)
@@ -1,3 +1,18 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * WebActionPropertyBag.cpp:
+        (WebActionPropertyBag::Read):
+        * WebView.cpp:
+        (WebView::handleContextMenuEvent):
+        (WebView::elementAtPoint):
+
 2012-09-05  Sam Weinig  <sam@webkit.org>
 
         Part 2 of removing PlatformString.h, remove PlatformString.h
index fca83be..d290509 100644 (file)
@@ -121,7 +121,7 @@ HRESULT STDMETHODCALLTYPE WebActionPropertyBag::Read(LPCOLESTR pszPropName, VARI
     if (isEqual(pszPropName, WebActionElementKey)) {
         if (const MouseEvent* mouseEvent = findMouseEvent(m_action.event())) {
             V_VT(pVar) = VT_UNKNOWN;
-            V_UNKNOWN(pVar) = WebElementPropertyBag::createInstance(m_frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false));
+            V_UNKNOWN(pVar) = WebElementPropertyBag::createInstance(m_frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation()));
             return S_OK;
         }
     }
index 3f38060..9ea9332 100644 (file)
@@ -1322,7 +1322,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam)
     m_page->contextMenuController()->clearContextMenu();
 
     IntPoint documentPoint(m_page->mainFrame()->view()->windowToContents(coords));
-    HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(documentPoint, false);
+    HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(documentPoint);
     Frame* targetFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
 
     targetFrame->view()->setCursor(pointerCursor());
@@ -3597,7 +3597,7 @@ HRESULT STDMETHODCALLTYPE WebView::elementAtPoint(
     IntPoint webCorePoint = IntPoint(point->x, point->y);
     HitTestResult result = HitTestResult(webCorePoint);
     if (frame->contentRenderer())
-        result = frame->eventHandler()->hitTestResultAtPoint(webCorePoint, false);
+        result = frame->eventHandler()->hitTestResultAtPoint(webCorePoint);
     *elementDictionary = WebElementPropertyBag::createInstance(result);
     return S_OK;
 }
index 4a26bb1..4f3bdab 100644 (file)
@@ -1,3 +1,15 @@
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API.
+
+        * WebFrame.cpp:
+        (WebKit::WebFrame::HitTest):
+
 2012-09-05  Sam Weinig  <sam@webkit.org>
 
         Part 2 of removing PlatformString.h, remove PlatformString.h
index b374113..470165d 100644 (file)
@@ -689,7 +689,7 @@ WebViewDOMElementInfo WebFrame::HitTest(const wxPoint& pos) const
     WebViewDOMElementInfo domInfo;
 
     if (m_impl->frame->view()) {
-        WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos), false);
+        WebCore::HitTestResult result = m_impl->frame->eventHandler()->hitTestResultAtPoint(m_impl->frame->view()->windowToContents(pos));
         if (result.innerNode()) {
             domInfo.SetLink(result.absoluteLinkURL().string());
             domInfo.SetText(result.textContent());
index ffa66bf..5ea7fa6 100644 (file)
@@ -1,5 +1,28 @@
 2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
 
+        Simplify hitTestResultAtPoint and nodesFromRect APIs
+        https://bugs.webkit.org/show_bug.cgi?id=95720
+
+        Reviewed by Antonio Gomes.
+
+        Update calls to new API and update exported symbols.
+
+        * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
+        (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::handleContextMenuEvent):
+        (WebKit::WebPage::highlightPotentialActivation): Corrects the misplaced arguments while converting them.
+        (WebKit::WebPage::findZoomableAreaForPoint):
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::characterIndexForPoint):
+        (WebKit::WebPage::performDictionaryLookupAtLocation):
+        (WebKit::WebPage::shouldDelayWindowOrderingEvent):
+        (WebKit::WebPage::acceptsFirstMouse):
+        * win/WebKit2.def:
+        * win/WebKit2CFLite.def:
+
+2012-09-07  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
+
         X11 Global Selection
         https://bugs.webkit.org/show_bug.cgi?id=88238
 
index 4281354..29c70df 100644 (file)
@@ -91,7 +91,7 @@ InjectedBundleNavigationAction::InjectedBundleNavigationAction(WebFrame* frame,
     , m_mouseButton(WebMouseEvent::NoButton)
 {
     if (const MouseEvent* mouseEvent = mouseEventForNavigationAction(navigationAction)) {
-        m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false));
+        m_hitTestResult = InjectedBundleHitTestResult::create(frame->coreFrame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation()));
         m_mouseButton   = mouseButtonForMouseEvent(mouseEvent);
     }
 
index dcc6a79..45a7eaf 100644 (file)
@@ -1310,7 +1310,7 @@ static bool isContextClick(const PlatformMouseEvent& event)
 static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, WebPage* page)
 {
     IntPoint point = page->corePage()->mainFrame()->view()->windowToContents(platformMouseEvent.position());
-    HitTestResult result = page->corePage()->mainFrame()->eventHandler()->hitTestResultAtPoint(point, false);
+    HitTestResult result = page->corePage()->mainFrame()->eventHandler()->hitTestResultAtPoint(point);
 
     Frame* frame = page->corePage()->mainFrame();
     if (result.innerNonSharedNode())
@@ -1559,7 +1559,7 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize&
             return;
 
 #else
-        HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+        HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
         adjustedNode = result.innerNode();
 #endif
         // Find the node to highlight. This is not the same as the node responding the tap gesture, because many
@@ -2728,7 +2728,7 @@ void WebPage::findZoomableAreaForPoint(const WebCore::IntPoint& point, const Web
 {
     UNUSED_PARAM(area);
     Frame* mainframe = m_mainFrame->coreFrame();
-    HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), /*allowShadowContent*/ false, /*ignoreClipping*/ true);
+    HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
 
     Node* node = result.innerNode();
 
index c2f0165..359f35a 100644 (file)
@@ -375,7 +375,7 @@ void WebPage::characterIndexForPoint(IntPoint point, uint64_t& index)
     if (!frame)
         return;
 
-    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point, false);
+    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(point);
     frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
     
     RefPtr<Range> range = frame->rangeForPoint(result.roundedPoint());
@@ -464,7 +464,7 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint)
 
     // Find the frame the point is over.
     IntPoint point = roundedIntPoint(floatPoint);
-    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point), false);
+    HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(point));
     frame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document()->frame() : m_page->focusController()->focusedOrMainFrame();
 
     IntPoint translatedPoint = frame->view()->windowToContents(point);
@@ -727,7 +727,7 @@ void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event,
         return;
 
 #if ENABLE(DRAG_SUPPORT)
-    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true);
+    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     if (hitResult.isSelected())
         result = frame->eventHandler()->eventMayStartDrag(platform(event));
 #endif
@@ -740,7 +740,7 @@ void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& ev
     if (!frame)
         return;
     
-    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), true);
+    HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
     frame->eventHandler()->setActivationEventNumber(eventNumber);
 #if ENABLE(DRAG_SUPPORT)
     if (hitResult.isSelected())
index 975a73d..8e56091 100644 (file)
@@ -259,7 +259,7 @@ EXPORTS
         ??1ContextDestructionObserver@WebCore@@MAE@XZ
         ?contextDestroyed@ContextDestructionObserver@WebCore@@UAEXXZ
         ??0ContextDestructionObserver@WebCore@@QAE@PAVScriptExecutionContext@1@@Z
-        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z
+        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIIII@Z
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?webkitWillEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
         ?webkitDidEnterFullScreenForElement@Document@WebCore@@QAEXPAVElement@2@@Z
index 33e8deb..09fb032 100644 (file)
@@ -253,7 +253,7 @@ EXPORTS
         ?userPreferredLanguages@WebCore@@YA?AV?$Vector@VString@WTF@@$0A@@WTF@@XZ
         ?utf8@String@WTF@@QBE?AVCString@2@_N@Z
         ?view@Document@WebCore@@QBEPAVFrameView@2@XZ
-        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIII_N00@Z
+        ?nodesFromRect@Document@WebCore@@QBE?AV?$PassRefPtr@VNodeList@WebCore@@@WTF@@HHIIIII@Z
         ?selectionStartHasMarkerFor@Editor@WebCore@@QBE_NW4MarkerType@DocumentMarker@2@HH@Z
         ?restrictScaleFactorToInitialScaleIfNotUserScalable@WebCore@@YAXAAUViewportAttributes@1@@Z
         ?restrictMinimumScaleFactorToViewportSize@WebCore@@YAXAAUViewportAttributes@1@VIntSize@1@@Z
index 1a21ef9..a918c8c 100644 (file)
@@ -162,7 +162,7 @@ _ZN7WebCore22RuntimeEnabledFeatures18isShadowDOMEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures22isCSSExclusionsEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures22isDialogElementEnabledE;
 _ZN7WebCore22RuntimeEnabledFeatures37isAuthorShadowDOMForAnyElementEnabledE;
-_ZNK7WebCore8Document13nodesFromRectEiijjjjbbb;
+_ZNK7WebCore8Document13nodesFromRectEiijjjjj;
 _ZN7WebCore4toJSEPN3JSC9ExecStateEPNS_17JSDOMGlobalObjectEPNS_8NodeListE;
 _ZNK7WebCore6Editor26selectionStartHasMarkerForENS_14DocumentMarker10MarkerTypeEii;
 _ZN7WebCore8Document33webkitDidExitFullScreenForElementEPNS_7ElementE;