Unreviewed, rolling out r127876.

http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600

mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-09-12

.:

* Source/autotools/symbols.filter:

Source/WebCore:

* 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:
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):

Source/WebKit/blackberry:

* 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:

* 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:

* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_new):

Source/WebKit/mac:

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

Source/WebKit/qt:

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

Source/WebKit/win:

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

Source/WebKit/wx:

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

Source/WebKit2:

* WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
(WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::handleContextMenuEvent):
(WebKit::WebPage::highlightPotentialActivation):
(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: http://svn.webkit.org/repository/webkit/trunk@128403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 52725145
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r127876.
http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600
mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).
* Source/autotools/symbols.filter:
2012-09-12 KyungTae Kim <ktf.kim@samsung.com>
[EFL] Support download attribute feature
......
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r127876.
http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600
mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).
* 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:
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):
2012-09-09 Filip Pizlo <fpizlo@apple.com>
JSC should have property butterflies
......@@ -158,7 +158,7 @@ __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranu
__ZN7WebCore12EventHandler15handleAccessKeyERKNS_21PlatformKeyboardEventE
__ZN7WebCore12EventHandler16handleWheelEventERKNS_18PlatformWheelEventE
__ZN7WebCore12EventHandler17scrollRecursivelyENS_15ScrollDirectionENS_17ScrollGranularityEPNS_4NodeE
__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_21FractionalLayoutPointEjRKNS_20FractionalLayoutSizeE
__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_21FractionalLayoutPointEbbNS_17HitTestScrollbarsEjRKNS_20FractionalLayoutSizeE
__ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
__ZN7WebCore12EventHandler24logicalScrollRecursivelyENS_22ScrollLogicalDirectionENS_17ScrollGranularityEPNS_4NodeE
......@@ -1357,7 +1357,7 @@ __ZNK7WebCore7RunLoop9TimerBase8isActiveEv
__ZNK7WebCore8Document10renderViewEv
__ZNK7WebCore8Document11completeURLERKN3WTF6StringE
__ZNK7WebCore8Document13axObjectCacheEv
__ZNK7WebCore8Document13nodesFromRectEiijjjjj
__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
__ZNK7WebCore8Document14getElementByIdERKN3WTF12AtomicStringE
__ZNK7WebCore8Document31displayStringModifiedByEncodingERKN3WTF6StringE
__ZNK7WebCore8Document4bodyEv
......
......@@ -22785,7 +22785,7 @@ __ZNK7WebCore12NodeIterator20updateForNodeRemovalEPNS_4NodeERNS0_11NodePointerE
__ZN7WebCore27jsNodeIteratorReferenceNodeEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
__ZNK7WebCore4Node20traversePreviousNodeEPKS0_
__ZN7WebCore37jsNodeIteratorPrototypeFunctionDetachEPN3JSC9ExecStateE
__ZNK7WebCore8Document13nodesFromRectEiijjjjj
__ZNK7WebCore8Document13nodesFromRectEiijjjjbbb
__ZNK7WebCore8Document17handleZeroPaddingERKNS_14HitTestRequestERNS_13HitTestResultE
__ZN3WTF21ListHashSetTranslatorINS_6RefPtrIN7WebCore4NodeEEELm256ENS_7PtrHashIS4_EEE9translateERPNS_15ListHashSetNodeIS4_Lm256EEERKS4_PNS_24ListHashSetNodeAllocatorIS4_Lm256EEE
__ZN7WebCore21StaticHashSetNodeListC1ERN3WTF11ListHashSetINS1_6RefPtrINS_4NodeEEELm256ENS1_7PtrHashIS5_EEEE
......@@ -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, HitTestRequest::HitTestRequestType hitType) const
PassRefPtr<NodeList> Document::nodesFromRect(int centerX, int centerY, unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding, bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent) const
{
// FIXME: Share code between this, elementFromPoint and caretRangeFromPoint.
if (!renderer())
......@@ -1399,11 +1399,19 @@ 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()));
HitTestRequest request(hitType);
int type = HitTestRequest::ReadOnly | HitTestRequest::Active;
// When ignoreClipping is false, this method returns null for coordinates outside of the viewport.
if (!request.ignoreClipping() && !frameView->visibleContentRect().intersects(HitTestResult::rectForPoint(point, topPadding, rightPadding, bottomPadding, leftPadding)))
if (ignoreClipping)
type |= HitTestRequest::IgnoreClipping;
else if (!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.
......
......@@ -34,7 +34,6 @@
#include "DOMTimeStamp.h"
#include "DocumentEventQueue.h"
#include "DocumentTiming.h"
#include "HitTestRequest.h"
#include "IconURL.h"
#include "InspectorCounters.h"
#include "IntRect.h"
......@@ -377,10 +376,12 @@ 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,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active) const;
bool ignoreClipping, bool allowShadowContent, bool allowChildFrameContent = false) const;
Element* elementFromPoint(int x, int y) const;
PassRefPtr<Range> caretRangeFromPoint(int x, int y);
......
......@@ -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());
result = frame->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation(), false);
if (!result.innerNonSharedNode())
return nullptr;
......
......@@ -544,7 +544,7 @@ bool DragController::canProcessDrag(DragData* dragData)
if (!m_page->mainFrame()->contentRenderer())
return false;
result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(point, true);
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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult hitTestResult = src->eventHandler()->hitTestResultAtPoint(dragOrigin, true);
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
......
......@@ -1007,7 +1007,7 @@ void EventHandler::updateAutoscrollRenderer()
if (!m_autoscrollRenderer)
return;
HitTestResult hitTest = hitTestResultAtPoint(m_panScrollStartPos, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult hitTest = hitTestResultAtPoint(m_panScrollStartPos, true);
if (Node* nodeAtPoint = hitTest.innerNode())
m_autoscrollRenderer = nodeAtPoint->renderer();
......@@ -1039,17 +1039,22 @@ DragSourceAction EventHandler::updateDragSourceActionsAllowed() const
}
#endif // ENABLE(DRAG_SUPPORT)
HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTestRequest::HitTestRequestType hitType, const LayoutSize& padding)
HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, 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;
HitTestRequest request(hitType);
m_frame->contentRenderer()->hitTest(request, result);
m_frame->contentRenderer()->hitTest(HitTestRequest(hitType), 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.
......@@ -1061,12 +1066,12 @@ HitTestResult EventHandler::hitTestResultAtPoint(const LayoutPoint& point, HitTe
FrameView* mainView = mainFrame->view();
if (resultView && mainView) {
IntPoint mainFramePoint = mainView->rootViewToContents(resultView->contentsToRootView(roundedIntPoint(result.point())));
result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, hitType, padding);
result = mainFrame->eventHandler()->hitTestResultAtPoint(mainFramePoint, allowShadowContent, ignoreClipping, testScrollbars, hitType, padding);
}
}
}
if (!request.allowsShadowContent())
if (!allowShadowContent)
result.setToNonShadowAncestor();
return result;
......@@ -1476,7 +1481,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);
......@@ -2376,7 +2381,7 @@ bool EventHandler::handleGestureEvent(const PlatformGestureEvent& gestureEvent)
eventTarget = m_scrollGestureHandlingNode.get();
if (!eventTarget) {
HitTestResult result = hitTestResultAtPoint(gestureEvent.position());
HitTestResult result = hitTestResultAtPoint(gestureEvent.position(), false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active);
eventTarget = result.targetNode();
}
......@@ -2478,8 +2483,9 @@ 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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent, touchRadius);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
......@@ -2496,8 +2502,9 @@ 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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent, touchRadius);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ true, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
......@@ -2506,8 +2513,9 @@ 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, HitTestRequest::ReadOnly | HitTestRequest::Active, touchRadius);
HitTestResult result = hitTestResultAtPoint(hitTestPoint, /*allowShadowContent*/ false, /*ignoreClipping*/ false, DontHitTestScrollbars, hitType, touchRadius);
IntRect touchRect(touchCenter - touchRadius, touchRadius + touchRadius);
RefPtr<StaticHashSetNodeList> nodeList = StaticHashSetNodeList::adopt(result.rectBasedTestResult());
......@@ -3549,7 +3557,7 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
unsigned touchPointTargetKey = point.id() + 1;
RefPtr<EventTarget> touchTarget;
if (pointState == PlatformTouchPoint::TouchPressed) {
HitTestResult result = hitTestResultAtPoint(pagePoint, hitType);
HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
Node* node = result.innerNode();
ASSERT(node);
......@@ -3567,7 +3575,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, hitType);
hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, 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);
......
......@@ -88,6 +88,8 @@ extern const int TextDragHysteresis;
extern const int GeneralDragHysteresis;
#endif // ENABLE(DRAG_SUPPORT)
enum HitTestScrollbars { ShouldHitTestScrollbars, DontHitTestScrollbars };
class EventHandler {
WTF_MAKE_NONCOPYABLE(EventHandler);
public:
......@@ -113,7 +115,9 @@ public:
void dispatchFakeMouseMoveEventSoon();
void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
HitTestResult hitTestResultAtPoint(const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
HitTestResult hitTestResultAtPoint(const LayoutPoint&, bool allowShadowContent, bool ignoreClipping = false,
HitTestScrollbars scrollbars = DontHitTestScrollbars,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
const LayoutSize& padding = LayoutSize());
bool mousePressed() const { return m_mousePressed; }
......
......@@ -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), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
HitTestResult result = candidate.visibleNode->document()->page()->mainFrame()->eventHandler()->hitTestResultAtPoint(IntPoint(x, y), false, true);
if (candidate.visibleNode->contains(result.innerNode())) {
closest = candidate;
return;
......
......@@ -724,7 +724,7 @@ String Frame::displayStringModifiedByEncoding(const String& str) const
VisiblePosition Frame::visiblePositionForPoint(const IntPoint& framePoint)
{
HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult result = eventHandler()->hitTestResultAtPoint(framePoint, true);
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);
result = eventHandler()->hitTestResultAtPoint(pt, false);
return result.innerNode() ? result.innerNode()->document() : 0;
}
......
......@@ -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, HitTestRequest::ReadOnly | HitTestRequest::Active, IntSize(padding, padding));
HitTestResult result = mainFrame->eventHandler()->hitTestResultAtPoint(contentsPoint, false, false, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly, IntSize(padding, padding));
const ListHashSet<RefPtr<Node> >& hitResults = result.rectBasedTestResult();
HashMap<Node*, TouchTargetData> touchTargets;
......
......@@ -37,7 +37,6 @@ 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
};
......
......@@ -972,15 +972,8 @@ PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y,
ec = INVALID_ACCESS_ERR;
return 0;
}
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);
return document->nodesFromRect(x, y, topPadding, rightPadding, bottomPadding, leftPadding, ignoreClipping, allowShadowContent, allowChildFrameContent);
}
void Internals::emitInspectorDidBeginFrame()
......
......@@ -2766,7 +2766,7 @@ PassRefPtr<Node> WebPagePrivate::contextNode(TargetDetectionStrategy strategy)
return result.node(FatFingersResult::ShadowContentNotAllowed);
}
HitTestResult result = eventHandler->hitTestResultAtPoint(contentPos);
HitTestResult result = eventHandler->hitTestResultAtPoint(contentPos, false /*allowShadowContent*/);
return result.innerNode();
}
......@@ -2838,7 +2838,7 @@ Node* WebPagePrivate::nodeForZoomUnderPoint(const IntPoint& point)
if (!m_mainFrame)
return 0;
HitTestResult result = m_mainFrame->eventHandler()->hitTestResultAtPoint(mapFromTransformed(point));
HitTestResult result = m_mainFrame->eventHandler()->hitTestResultAtPoint(mapFromTransformed(point), false);
Node* node = result.innerNonSharedNode();
......@@ -4048,7 +4048,7 @@ bool WebPagePrivate::handleMouseEvent(PlatformMouseEvent& mouseEvent)
}
if (!node) {
HitTestResult result = eventHandler->hitTestResultAtPoint(mapFromViewportToContents(mouseEvent.position()));
HitTestResult result = eventHandler->hitTestResultAtPoint(mapFromViewportToContents(mouseEvent.position()), false /*allowShadowContent*/);
node = result.innerNode();
}
......@@ -5211,7 +5211,7 @@ WebDOMDocument WebPage::document() const
WebDOMNode WebPage::nodeAtPoint(int x, int y)
{
HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(d->mapFromTransformed(IntPoint(x, y)));
HitTestResult result = d->m_mainFrame->eventHandler()->hitTestResultAtPoint(d->mapFromTransformed(IntPoint(x, y)), false);
Node* node = result.innerNonSharedNode();
return WebDOMNode(node);
}
......
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r127876.
http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600
mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).
* 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-12 Sami Kyostila <skyostil@google.com>
Rename OVERFLOW_SCROLLING as ACCELERATED_OVERFLOW_SCROLLING
......
......@@ -491,12 +491,11 @@ 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.
HitTestRequest request = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
if (m_targetType != Text)
request |= HitTestRequest::AllowShadowContent;
HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding);
ShadowContentFilterPolicy allowShadow = m_targetType == Text ? DoNotAllowShadowContent : AllowShadowContent;
HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding, allowShadow);
document->renderView()->layer()->hitTest(request, result);
intersectedNodes = result.rectBasedTestResult();
......@@ -511,7 +510,7 @@ void FatFingers::getRelevantInfoFromPoint(Document* document, const IntPoint& co
if (!document || !document->renderer() || !document->frame())
return;
HitTestResult result = document->frame()->eventHandler()->hitTestResultAtPoint(contentPos, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult result = document->frame()->eventHandler()->hitTestResultAtPoint(contentPos, true /*allowShadowContent*/);
Node* node = result.innerNode();
while (node && !node->isElementNode())
node = node->parentNode();
......
......@@ -160,7 +160,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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent | HitTestRequest::IgnoreClipping);
HitTestResult result = frame.eventHandler()->hitTestResultAtPoint(framePoint, true /* allowShadowContent */, true /* ignoreClipping */);
Node* node = result.innerNode();
if (!node || node->document() != frame.document())
......
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r127876.
http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600
mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).
* 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-12 Rick Byers <rbyers@chromium.org>
[chromium] Remove unused WebGestureEvent fields
......
......@@ -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(), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().point(), true);
Node* innerNode = hitTestResult.innerNode();
VisiblePosition pos(innerNode->renderer()->positionForPoint(
hitTestResult.localPoint()));
......
......@@ -997,7 +997,8 @@ void FrameLoaderClientImpl::dispatchDecidePolicyForNavigationAction(
if (event->isMouseEvent()) {
const MouseEvent* mouseEvent =
static_cast<const MouseEvent*>(event);
node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(mouseEvent->absoluteLocation()).innerNonSharedNode();
node = m_webFrame->frame()->eventHandler()->hitTestResultAtPoint(
mouseEvent->absoluteLocation(), false).innerNonSharedNode();
break;
}
}
......
......@@ -1265,7 +1265,7 @@ size_t WebFrameImpl::characterIndexForPoint(const WebPoint& webPoint) const
return notFound;
IntPoint point = frame()->view()->windowToContents(webPoint);
HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point);
HitTestResult result = frame()->eventHandler()->hitTestResultAtPoint(point, false);
RefPtr<Range> range = frame()->rangeForPoint(result.roundedPoint());
if (!range)
return notFound;
......
......@@ -507,7 +507,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, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(center, false, false, DontHitTestScrollbars, HitTestRequest::ReadOnly | HitTestRequest::Active, padding);
const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
if (nodes.size() != 1)
return false;
......
......@@ -638,7 +638,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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::TestChildFrameScrollBars);
HitTestResult hitTestResult = focused->eventHandler()->hitTestResultAtPoint(contentPoint, false, false, ShouldHitTestScrollbars);
// 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.
......@@ -1007,8 +1007,9 @@ 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));
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));
HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point,
false, zoomType == FindInPage, DontHitTestScrollbars, HitTestRequest::Active | HitTestRequest::ReadOnly,
IntSize(rect.width, rect.height));
Node* node = result.innerNonSharedNode();
if (!node)
......
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r127876.
http://trac.webkit.org/changeset/127876
https://bugs.webkit.org/show_bug.cgi?id=96600
mouse click doesn't work for spin button if spin button in
iframe (Requested by yosin on #webkit).
* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_new):
2012-09-12 KyungTae Kim <ktf.kim@samsung.com>
[EFL] Support download attribute feature
......
......@@ -38,7 +38,6 @@
#include "HTMLNames.h"
#include "HTMLPlugInElement.h"
#include "HistoryItem.h"
#include "HitTestRequest.h"
#include "HitTestResult.h"
#include "IntSize.h"
#include "KURL.h"
......@@ -694,8 +693,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)),
WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active | WebCore::HitTestRequest::IgnoreClipping);
(view->windowToContents(WebCore::IntPoint(x, y)),
/*allowShadowContent*/ false, /*ignoreClipping*/ true);
if (result.scrollbar())
return 0;
......
2012-09-12 Sheriff Bot <webkit.review.bot@gmail.com>