Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1016)

Unified Diff: Source/web/WebViewImpl.cpp

Issue 470803002: WebViewImpl's hit tests should use setToShadowHostIfInUserAgentShadowRoot. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index acaf1977969b90cb103bac7740cf0ad20fccc685..fe75efa439e4122e361ec150254cbce64f7698ea 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -500,6 +500,7 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
if (event.button == WebMouseEvent::ButtonLeft && m_page->mainFrame()->isLocalFrame() && !m_page->deprecatedLocalMainFrame()->view()->scrollbarAtPoint(point)) {
point = m_page->deprecatedLocalMainFrame()->view()->windowToContents(point);
HitTestResult result(m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(point));
+ result.setToShadowHostIfInUserAgentShadowRoot();
Node* hitNode = result.innerNonSharedNode();
if (!result.scrollbar() && hitNode && hitNode->renderer() && hitNode->renderer()->isEmbeddedObject()) {
@@ -1050,12 +1051,14 @@ WebRect WebViewImpl::computeBlockBounds(const WebRect& rect, bool ignoreClipping
IntPoint point = mainFrameImpl()->frameView()->windowToContents(IntPoint(rect.x, rect.y));
HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | (ignoreClipping ? HitTestRequest::IgnoreClipping : 0);
HitTestResult result = mainFrameImpl()->frame()->eventHandler().hitTestResultAtPoint(point, hitType, IntSize(rect.width, rect.height));
+ result.setToShadowHostIfInUserAgentShadowRoot();
Node* node = result.innerNonSharedNode();
if (!node)
return WebRect();
// Find the block type node based on the hit node.
+ // FIXME: This wants to walk composed tree with NodeRenderingTraversal::parent().
while (node && (!node->renderer() || node->renderer()->isInline()))
node = NodeRenderingTraversal::parent(node);
@@ -1211,6 +1214,7 @@ Node* WebViewImpl::bestTapNode(const PlatformGestureEvent& tapEvent)
// We might hit something like an image map that has no renderer on it
// Walk up the tree until we have a node with an attached renderer
+ // FIXME: This wants to walk composed tree with NodeRenderingTraversal::parent().
while (bestTouchNode && !bestTouchNode->renderer())
bestTouchNode = NodeRenderingTraversal::parent(bestTouchNode);
@@ -3881,7 +3885,9 @@ HitTestResult WebViewImpl::hitTestResultForWindowPos(const IntPoint& pos)
if (!m_page->mainFrame()->isLocalFrame())
return HitTestResult();
IntPoint docPoint(m_page->deprecatedLocalMainFrame()->view()->windowToContents(pos));
- return m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
+ HitTestResult result = m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
+ result.setToShadowHostIfInUserAgentShadowRoot();
+ return result;
}
void WebViewImpl::setTabsToLinks(bool enable)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698