Commit af1544e8 authored by hayato@chromium.org's avatar hayato@chromium.org

Allow ShadowContents in HitTests by default.

https://bugs.webkit.org/show_bug.cgi?id=113171

Reviewed by Dimitri Glazkov.

Source/WebCore:

HitTestRequest is widely used in WebCore, but AllowShadowContents
flag is not turned on by default.  In most places, we can set the
flag on.

This change makes HitTests allow shadow contents by default.

To track all existing HitTests which do not allow shadow contents,
and discourage such a HitTest in the future, I've introduced
disallowShadowContenet flag so that callers must turn on this flag
explicitly if they want to disallow shadow contents in their HitTests.

This change should be refactoring and should not include any
behavior changes.  After this change, we'll investigate each place
where disallowShadowContents is used step by step and get rid of
the flag if it is okay to remove.

No new tests, no behavior change.

* dom/Document.h:
(Document):
* dom/TreeScope.cpp:
(WebCore::nodeFromPoint):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::updateDragAndDrop):
(WebCore::EventHandler::isInsideScrollbar):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureLongPress):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::bestClickableNodeForTouchPoint):
(WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
(WebCore::EventHandler::bestZoomableAreaForTouchPoint):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::hoverTimerFired):
(WebCore::EventHandler::dragSourceEndedAt):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::handleTouchEvent):
(WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
* page/EventHandler.h:
(EventHandler):
* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
* page/Frame.cpp:
(WebCore::Frame::visiblePositionForPoint):
* page/TouchDisambiguation.cpp:
(WebCore::findGoodTouchTargets):
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::disallowsShadowContent):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::addNodeToRectBasedTestResult):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):

Source/WebKit/blackberry:

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::hitTestResult):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect):
* WebKitSupport/ProximityDetector.cpp:
(BlackBerry::WebKit::ProximityDetector::findBestPoint):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):

Source/WebKit/chromium:

* src/ContextMenuClientImpl.cpp:
(WebKit::selectMisspelledWord):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::visiblePositionForWindowPoint):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::isRectTopmost):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::computeBlockBounds):
(WebKit::WebViewImpl::bestTapNode):

Source/WebKit/efl:

* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_new):

Source/WebKit/gtk:

* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_inspect_coordinates):
* webkit/webkitwebview.cpp:
(prepareMouseEventForFrame):
(webkit_web_view_get_hit_test_result):

Source/WebKit/mac:

* WebView/WebFrame.mm:
(-[WebFrame elementAtPoint:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView elementAtPoint:allowShadowContent:]):

Source/WebKit/qt:

* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameAdapter::hitTestContent):

Source/WebKit/win:

* WebView.cpp:
(WebView::gestureNotify):

Source/WebKit2:

* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::hitTest):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::highlightPotentialActivation):
(WebKit::WebPage::findZoomableAreaForPoint):
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::shouldDelayWindowOrderingEvent):
(WebKit::WebPage::acceptsFirstMouse):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@146961 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0a171184
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
HitTestRequest is widely used in WebCore, but AllowShadowContents
flag is not turned on by default. In most places, we can set the
flag on.
This change makes HitTests allow shadow contents by default.
To track all existing HitTests which do not allow shadow contents,
and discourage such a HitTest in the future, I've introduced
disallowShadowContenet flag so that callers must turn on this flag
explicitly if they want to disallow shadow contents in their HitTests.
This change should be refactoring and should not include any
behavior changes. After this change, we'll investigate each place
where disallowShadowContents is used step by step and get rid of
the flag if it is okay to remove.
No new tests, no behavior change.
* dom/Document.h:
(Document):
* dom/TreeScope.cpp:
(WebCore::nodeFromPoint):
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::contains):
* page/DragController.cpp:
(WebCore::elementUnderMouse):
(WebCore::DragController::canProcessDrag):
(WebCore::DragController::startDrag):
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseDraggedEvent):
(WebCore::EventHandler::eventMayStartDrag):
(WebCore::EventHandler::updateSelectionForMouseDrag):
(WebCore::EventHandler::hitTestResultAtPoint):
(WebCore::EventHandler::handleMousePressEvent):
(WebCore::EventHandler::handleMouseDoubleClickEvent):
(WebCore::EventHandler::handleMouseMoveEvent):
(WebCore::EventHandler::handleMouseReleaseEvent):
(WebCore::EventHandler::updateDragAndDrop):
(WebCore::EventHandler::isInsideScrollbar):
(WebCore::EventHandler::handleWheelEvent):
(WebCore::EventHandler::handleGestureEvent):
(WebCore::EventHandler::handleGestureLongPress):
(WebCore::EventHandler::handleGestureScrollBegin):
(WebCore::EventHandler::bestClickableNodeForTouchPoint):
(WebCore::EventHandler::bestContextMenuNodeForTouchPoint):
(WebCore::EventHandler::bestZoomableAreaForTouchPoint):
(WebCore::EventHandler::sendContextMenuEvent):
(WebCore::EventHandler::sendContextMenuEventForKey):
(WebCore::EventHandler::hoverTimerFired):
(WebCore::EventHandler::dragSourceEndedAt):
(WebCore::EventHandler::handleDrag):
(WebCore::EventHandler::handleTouchEvent):
(WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
* page/EventHandler.h:
(EventHandler):
* page/FocusController.cpp:
(WebCore::updateFocusCandidateIfNeeded):
* page/Frame.cpp:
(WebCore::Frame::visiblePositionForPoint):
* page/TouchDisambiguation.cpp:
(WebCore::findGoodTouchTargets):
* rendering/HitTestRequest.h:
(WebCore::HitTestRequest::disallowsShadowContent):
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::addNodeToRectBasedTestResult):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::hitTestFlowThreadPortionInRegion):
* rendering/svg/RenderSVGResourceClipper.cpp:
(WebCore::RenderSVGResourceClipper::hitTestClipContent):
* testing/Internals.cpp:
(WebCore::Internals::nodesFromRect):
2013-03-26 Tim Horton <timothy_horton@apple.com>
[ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
......@@ -371,8 +371,8 @@ public:
* @param leftPadding How much to expand the left of the rectangle
*/
PassRefPtr<NodeList> nodesFromRect(int centerX, int centerY,
unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active) const;
unsigned topPadding, unsigned rightPadding, unsigned bottomPadding, unsigned leftPadding,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent) const;
Element* elementFromPoint(int x, int y) const;
PassRefPtr<Range> caretRangeFromPoint(int x, int y);
......
......@@ -228,7 +228,7 @@ Node* nodeFromPoint(Document* document, int x, int y, LayoutPoint* localPoint)
if (!frameView->visibleContentRect().contains(point))
return 0;
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
HitTestResult result(point);
document->renderView()->hitTest(request, result);
......
......@@ -1542,8 +1542,7 @@ bool FrameSelection::contains(const LayoutPoint& point)
if (!document->renderer())
return false;
HitTestRequest request(HitTestRequest::ReadOnly |
HitTestRequest::Active);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
HitTestResult result(point);
document->renderView()->hitTest(request, result);
Node* innerNode = result.innerNode();
......
......@@ -297,7 +297,7 @@ static Element* elementUnderMouse(Document* documentUnderMouse, const IntPoint&
float zoomFactor = frame ? frame->pageZoomFactor() : 1;
LayoutPoint point = roundedLayoutPoint(FloatPoint(p.x() * zoomFactor, p.y() * zoomFactor));
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
HitTestResult result(point);
documentUnderMouse->renderView()->hitTest(request, result);
......@@ -563,7 +563,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, HitTestRequest::ReadOnly | HitTestRequest::Active);
if (!result.innerNonSharedNode())
return false;
......@@ -747,7 +747,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, HitTestRequest::ReadOnly | HitTestRequest::Active);
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
......
This diff is collapsed.
......@@ -131,8 +131,8 @@ public:
void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
HitTestResult hitTestResultAtPoint(const LayoutPoint&,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
const LayoutSize& padding = LayoutSize());
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent,
const LayoutSize& padding = LayoutSize());
bool mousePressed() const { return m_mousePressed; }
void setMousePressed(bool pressed) { m_mousePressed = pressed; }
......@@ -298,7 +298,7 @@ private:
#if ENABLE(TOUCH_EVENTS)
bool dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent&);
HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestResult hitTestResultInFrame(Frame*, const LayoutPoint&, HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
#endif
void invalidateClick();
......
......@@ -721,7 +721,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), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
if (candidate.visibleNode->contains(result.innerNode())) {
closest = candidate;
return;
......
......@@ -722,7 +722,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, HitTestRequest::ReadOnly | HitTestRequest::Active);
Node* node = result.innerNonSharedNode();
if (!node)
return VisiblePosition();
......
......@@ -98,7 +98,7 @@ void findGoodTouchTargets(const IntRect& touchBox, Frame* mainFrame, Vector<IntR
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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, IntSize(padding, padding));
const ListHashSet<RefPtr<Node> >& hitResults = result.rectBasedTestResult();
// Blacklist nodes that are container of disambiguated nodes.
......
......@@ -35,7 +35,7 @@ public:
IgnoreClipping = 1 << 5,
SVGClipContent = 1 << 6,
TouchEvent = 1 << 7,
AllowShadowContent = 1 << 8,
DisallowShadowContent = 1 << 8,
AllowFrameScrollbars = 1 << 9,
AllowChildFrameContent = 1 << 10,
ChildFrameHitTest = 1 << 11
......@@ -56,7 +56,7 @@ public:
bool svgClipContent() const { return m_requestType & SVGClipContent; }
bool touchEvent() const { return m_requestType & TouchEvent; }
bool mouseEvent() const { return !touchEvent(); }
bool allowsShadowContent() const { return m_requestType & AllowShadowContent; }
bool disallowsShadowContent() const { return m_requestType & DisallowShadowContent; }
bool allowsFrameScrollbars() const { return m_requestType & AllowFrameScrollbars; }
bool allowsChildFrameContent() const { return m_requestType & AllowChildFrameContent; }
bool isChildFrameHitTest() const { return m_requestType & ChildFrameHitTest; }
......
......@@ -556,7 +556,7 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
if (!node)
return true;
if (!request.allowsShadowContent())
if (request.disallowsShadowContent())
node = node->document()->ancestorInThisScope(node);
mutableRectBasedTestResult().add(node);
......@@ -576,7 +576,7 @@ bool HitTestResult::addNodeToRectBasedTestResult(Node* node, const HitTestReques
if (!node)
return true;
if (!request.allowsShadowContent())
if (request.disallowsShadowContent())
node = node->document()->ancestorInThisScope(node);
mutableRectBasedTestResult().add(node);
......
......@@ -312,7 +312,7 @@ bool RenderFlowThread::hitTestFlowThreadPortionInRegion(RenderRegion* region, La
renderFlowThreadOffset = accumulatedOffset - flowThreadPortionRect.location();
// Always ignore clipping, since the RenderFlowThread has nothing to do with the bounds of the FrameView.
HitTestRequest newRequest(request.type() | HitTestRequest::IgnoreClipping);
HitTestRequest newRequest(request.type() | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
HitTestResult tempResult(result);
// Make a new temporary HitTestLocation in the new region.
......
......@@ -312,7 +312,7 @@ bool RenderSVGResourceClipper::hitTestClipContent(const FloatRect& objectBoundin
continue;
IntPoint hitPoint;
HitTestResult result(hitPoint);
if (renderer->nodeAtFloatPoint(HitTestRequest(HitTestRequest::SVGClipContent), result, point, HitTestForeground))
if (renderer->nodeAtFloatPoint(HitTestRequest(HitTestRequest::SVGClipContent | HitTestRequest::DisallowShadowContent), result, point, HitTestForeground))
return true;
}
......
......@@ -1415,8 +1415,8 @@ PassRefPtr<NodeList> Internals::nodesFromRect(Document* document, int x, int y,
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
if (ignoreClipping)
hitType |= HitTestRequest::IgnoreClipping;
if (allowShadowContent)
hitType |= HitTestRequest::AllowShadowContent;
if (!allowShadowContent)
hitType |= HitTestRequest::DisallowShadowContent;
if (allowChildFrameContent)
hitType |= HitTestRequest::AllowChildFrameContent;
......
......@@ -6227,7 +6227,7 @@ const HitTestResult& WebPagePrivate::hitTestResult(const IntPoint& contentPos)
{
if (m_cachedHitTestContentPos != contentPos) {
m_cachedHitTestContentPos = contentPos;
m_cachedHitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(m_cachedHitTestContentPos, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
m_cachedHitTestResult = m_mainFrame->eventHandler()->hitTestResultAtPoint(m_cachedHitTestContentPos, HitTestRequest::ReadOnly | HitTestRequest::Active);
}
return m_cachedHitTestResult;
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::hitTestResult):
* WebKitSupport/FatFingers.cpp:
(BlackBerry::WebKit::FatFingers::getNodesFromRect):
* WebKitSupport/ProximityDetector.cpp:
(BlackBerry::WebKit::ProximityDetector::findBestPoint):
* WebKitSupport/SelectionHandler.cpp:
(BlackBerry::WebKit::visiblePositionForPointIgnoringClipping):
2013-03-26 Xiaobo Wang <xbwang@torchmobile.com.cn>
[BlackBerry] Memory leak in WebPagePrivate.cpp - NavigatorContentUtilsClientBlackBerry
......
......@@ -465,8 +465,8 @@ void FatFingers::getNodesFromRect(Document* document, const IntPoint& contentPos
// The user functions checkForText() and findIntersectingRegions() uses the Node.wholeText() to checkFingerIntersection()
// not the text in its shadow tree.
HitTestRequest::HitTestRequestType requestType = HitTestRequest::ReadOnly | HitTestRequest::Active;
if (m_targetType == Text)
requestType |= HitTestRequest::AllowShadowContent;
if (m_targetType != Text)
requestType |= HitTestRequest::DisallowShadowContent;
HitTestResult result(contentPos, topPadding, rightPadding, bottomPadding, leftPadding);
document->renderView()->layer()->hitTest(requestType, result);
......@@ -506,4 +506,3 @@ void FatFingers::setSuccessfulFatFingersResult(FatFingersResult& result, Node* b
}
}
......@@ -73,7 +73,7 @@ IntPoint ProximityDetector::findBestPoint(const IntPoint& documentPos, const Int
// Adjust hit point to frame
IntPoint frameContentPos(document->frame()->view()->windowToContents(m_webPage->m_mainFrame->view()->contentsToWindow(documentPos)));
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::IgnoreClipping);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
HitTestResult result(frameContentPos, top, right, bottom, left);
document->renderView()->layer()->hitTest(request, result);
......
......@@ -172,7 +172,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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
Node* node = result.innerNode();
if (!node || node->document() != frame.document())
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* src/ContextMenuClientImpl.cpp:
(WebKit::selectMisspelledWord):
* src/WebFrameImpl.cpp:
(WebKit::WebFrameImpl::visiblePositionForWindowPoint):
* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::isRectTopmost):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::computeBlockBounds):
(WebKit::WebViewImpl::bestTapNode):
2013-03-26 Dana Jansens <danakj@chromium.org>
[chromium] Remove the WebVideoFrame, WebVideoFrameProvider, WebStreamTextureClient, and WebVideoLayer classes.
......
......@@ -121,7 +121,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().pointInInnerNodeFrame(), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
hitTestResultAtPoint(selectedFrame->page()->contextMenuController()->hitTestResult().pointInInnerNodeFrame(), HitTestRequest::ReadOnly | HitTestRequest::Active);
Node* innerNode = hitTestResult.innerNode();
VisiblePosition pos(innerNode->renderer()->positionForPoint(
hitTestResult.localPoint()));
......
......@@ -1398,7 +1398,7 @@ void WebFrameImpl::moveCaretSelectionTowardsWindowPoint(const WebPoint& point)
VisiblePosition WebFrameImpl::visiblePositionForWindowPoint(const WebPoint& point)
{
HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping;
HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent;
HitTestResult result(frame()->view()->windowToContents(IntPoint(point)));
frame()->document()->renderView()->layer()->hitTest(request, result);
......
......@@ -467,7 +467,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, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent, padding);
const HitTestResult::NodeSet& nodes = result.rectBasedTestResult();
if (nodes.size() != 1)
return false;
......
......@@ -1123,7 +1123,7 @@ 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
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent
| ((zoomType == FindInPage) ? HitTestRequest::IgnoreClipping : 0);
HitTestResult result = mainFrameImpl()->frame()->eventHandler()->hitTestResultAtPoint(point, hitType, IntSize(rect.width, rect.height));
......@@ -1309,7 +1309,7 @@ Node* WebViewImpl::bestTapNode(const PlatformGestureEvent& tapEvent)
#endif
IntPoint hitTestPoint = m_page->mainFrame()->view()->windowToContents(touchEventLocation);
HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(hitTestPoint, HitTestRequest::TouchEvent);
HitTestResult result = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(hitTestPoint, HitTestRequest::TouchEvent | HitTestRequest::DisallowShadowContent);
bestTouchNode = result.targetNode();
// Make sure our highlight candidate uses a hand cursor as a heuristic to
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* ewk/ewk_frame.cpp:
(ewk_frame_hit_test_new):
2013-03-20 Jose Lejin PJ <jose.lejin@gmail.com>
ewk_settings_memory_cache_clear should clear JS garbage and release FastMalloc's free pages to OS
......
......@@ -694,7 +694,7 @@ Ewk_Hit_Test* ewk_frame_hit_test_new(const Evas_Object* ewkFrame, int x, int y)
WebCore::HitTestResult result = smartData->frame->eventHandler()->hitTestResultAtPoint
(view->windowToContents(WebCore::IntPoint(x, y)),
WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active | WebCore::HitTestRequest::IgnoreClipping);
WebCore::HitTestRequest::ReadOnly | WebCore::HitTestRequest::Active | WebCore::HitTestRequest::IgnoreClipping | WebCore::HitTestRequest::DisallowShadowContent);
if (result.scrollbar())
return 0;
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* webkit/webkitwebinspector.cpp:
(webkit_web_inspector_inspect_coordinates):
* webkit/webkitwebview.cpp:
(prepareMouseEventForFrame):
(webkit_web_view_get_hit_test_result):
2013-03-26 Tony Chang <tony@chromium.org>
Autogenerate the scrollAnimatorEnabled setting in Settings.in
......
......@@ -541,7 +541,7 @@ void webkit_web_inspector_inspect_coordinates(WebKitWebInspector* webInspector,
if (!view)
return;
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
IntPoint documentPoint = view->windowToContents(IntPoint(static_cast<int>(x), static_cast<int>(y)));
HitTestResult result(documentPoint);
......
......@@ -328,7 +328,7 @@ static void contextMenuConnectActivate(GtkMenuItem* item, ContextMenuController*
static MouseEventWithHitTestResults prepareMouseEventForFrame(Frame* frame, const PlatformMouseEvent& event)
{
HitTestRequest request(HitTestRequest::Active);
HitTestRequest request(HitTestRequest::Active| HitTestRequest::DisallowShadowContent);
IntPoint point = frame->view()->windowToContents(event.position());
return frame->document()->prepareMouseEvent(request, point, event);
}
......@@ -5313,7 +5313,7 @@ WebKitHitTestResult* webkit_web_view_get_hit_test_result(WebKitWebView* webView,
PlatformMouseEvent mouseEvent = PlatformMouseEvent(event);
Frame* frame = core(webView)->focusController()->focusedOrMainFrame();
HitTestRequest request(HitTestRequest::Active);
HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowShadowContent);
IntPoint documentPoint = documentPointForWindowPoint(frame, mouseEvent.position());
MouseEventWithHitTestResults mev = frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent);
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* WebView/WebFrame.mm:
(-[WebFrame elementAtPoint:]):
* WebView/WebHTMLView.mm:
(-[WebHTMLView elementAtPoint:allowShadowContent:]):
2013-03-26 Tim Horton <timothy_horton@apple.com>
[ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
......
......@@ -1227,7 +1227,7 @@ static inline WebDataSource *dataSource(DocumentLoader* loader)
Frame* coreFrame = _private->coreFrame;
if (!coreFrame)
return nil;
return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping)] autorelease];
return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent)] autorelease];
}
@end
......
......@@ -6205,7 +6205,7 @@ static void extractUnderlines(NSAttributedString *string, Vector<CompositionUnde
if (!coreFrame)
return nil;
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active
| (allow ? HitTestRequest::AllowShadowContent : 0);
| (allow ? 0 : HitTestRequest::DisallowShadowContent);
return [[[WebElementDictionary alloc] initWithHitTestResult:coreFrame->eventHandler()->hitTestResultAtPoint(IntPoint(point), hitType)] autorelease];
}
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* WebCoreSupport/QWebFrameAdapter.cpp:
(QWebFrameAdapter::hitTestContent):
2013-03-26 Tony Chang <tony@chromium.org>
Autogenerate the scrollAnimatorEnabled setting in Settings.in
......
......@@ -389,7 +389,7 @@ QWebHitTestResultPrivate* QWebFrameAdapter::hitTestContent(const QPoint& pos) co
if (!frame->view() || !frame->contentRenderer())
return 0;
HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
HitTestResult result = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(pos), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
if (result.scrollbar())
return 0;
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* WebView.cpp:
(WebView::gestureNotify):
2013-03-22 Ryosuke Niwa <rniwa@webkit.org>
The second part of the build fix for r146702. This should do it.
......
......@@ -1551,7 +1551,7 @@ bool WebView::gestureNotify(WPARAM wParam, LPARAM lParam)
bool hitScrollbar = false;
POINT gestureBeginPoint = {gn->ptsLocation.x, gn->ptsLocation.y};
HitTestRequest request(HitTestRequest::ReadOnly);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowShadowContent);
for (Frame* childFrame = m_page->mainFrame(); childFrame; childFrame = EventHandler::subframeForTargetNode(m_gestureTargetNode.get())) {
FrameView* frameView = childFrame->view();
if (!frameView)
......
2013-03-26 Hayato Ito <hayato@chromium.org>
Allow ShadowContents in HitTests by default.
https://bugs.webkit.org/show_bug.cgi?id=113171
Reviewed by Dimitri Glazkov.
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::hitTest):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::highlightPotentialActivation):
(WebKit::WebPage::findZoomableAreaForPoint):
(WebKit::WebPage::determinePrimarySnapshottedPlugIn):
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::shouldDelayWindowOrderingEvent):
(WebKit::WebPage::acceptsFirstMouse):
2013-03-26 Tim Horton <timothy_horton@apple.com>
[ca] Tell CA to clean up unused resources if a given WebProcess won't be drawing
......@@ -539,7 +539,7 @@ PassRefPtr<InjectedBundleHitTestResult> WebFrame::hitTest(const IntPoint point)
if (!m_coreFrame)
return 0;
return InjectedBundleHitTestResult::create(m_coreFrame->eventHandler()->hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping));
return InjectedBundleHitTestResult::create(m_coreFrame->eventHandler()->hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent));
}
bool WebFrame::getDocumentBackgroundColor(double* red, double* green, double* blue, double* alpha)
......
......@@ -1758,7 +1758,7 @@ void WebPage::highlightPotentialActivation(const IntPoint& point, const IntSize&
return;
#else
HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
adjustedNode = result.innerNode();
#endif
// Find the node to highlight. This is not the same as the node responding the tap gesture, because many
......@@ -3055,7 +3055,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), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping);
HitTestResult result = mainframe->eventHandler()->hitTestResultAtPoint(mainframe->view()->windowToContents(point), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
Node* node = result.innerNode();
......@@ -3909,7 +3909,7 @@ void WebPage::determinePrimarySnapshottedPlugIn()
IntRect searchRect = IntRect(IntPoint(), corePage()->mainFrame()->view()->contentsSize());
searchRect.intersect(IntRect(IntPoint(), IntSize(primarySnapshottedPlugInSearchLimit, primarySnapshottedPlugInSearchLimit)));
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping);
HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent | HitTestRequest::IgnoreClipping | HitTestRequest::DisallowShadowContent);
HashSet<RenderObject*> seenRenderers;
HTMLPlugInImageElement* candidatePlugIn = 0;
......
......@@ -751,7 +751,7 @@ void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event,
return;
#if ENABLE(DRAG_SUPPORT)
HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active);
if (hitResult.isSelected())
result = frame->eventHandler()->eventMayStartDrag(platform(event));
#endif
......@@ -764,7 +764,7 @@ void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& ev
if (!frame)
return;
HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowShadowContent);
HitTestResult hitResult = frame->eventHandler()->hitTestResultAtPoint(frame->view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active);
frame->eventHandler()->setActivationEventNumber(eventNumber);
#if ENABLE(DRAG_SUPPORT)
if (hitResult.isSelected())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment