| Index: Source/web/WebViewImpl.cpp
|
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
|
| index fa25acf911ad7e2a605dd87e22e10a55c6ba68ef..b978dad43764420cfef2060bdfd28170aa405b89 100644
|
| --- a/Source/web/WebViewImpl.cpp
|
| +++ b/Source/web/WebViewImpl.cpp
|
| @@ -530,7 +530,7 @@ void WebViewImpl::handleMouseDown(LocalFrame& mainFrame, const WebMouseEvent& ev
|
| // capture because it will interfere with the scrollbar receiving events.
|
| IntPoint point(event.x, event.y);
|
| if (event.button == WebMouseEvent::ButtonLeft && m_page->mainFrame()->isLocalFrame()) {
|
| - point = m_page->deprecatedLocalMainFrame()->view()->windowToContents(point);
|
| + point = m_page->deprecatedLocalMainFrame()->view()->rootFrameToContents(point);
|
| HitTestResult result(m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(point));
|
| result.setToShadowHostIfInClosedShadowRoot();
|
| Node* hitNode = result.innerNonSharedNode();
|
| @@ -592,7 +592,7 @@ void WebViewImpl::mouseContextMenu(const WebMouseEvent& event)
|
| PlatformMouseEventBuilder pme(mainFrameImpl()->frameView(), event);
|
|
|
| // Find the right target frame. See issue 1186900.
|
| - HitTestResult result = hitTestResultForWindowPos(pme.position());
|
| + HitTestResult result = hitTestResultForRootFramePos(pme.position());
|
| Frame* targetFrame;
|
| if (result.innerNonSharedNode())
|
| targetFrame = result.innerNonSharedNode()->document().frame();
|
| @@ -783,22 +783,14 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
|
| // Don't trigger a disambiguation popup when screencasting, since it's implemented outside of
|
| // compositor pipeline and is not being screencasted itself. This leads to bad user experience.
|
| if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !page()->inspectorController().screencastEnabled()) {
|
| - WebGestureEvent scaledEvent = event;
|
| - scaledEvent.x = event.x / pageScaleFactor();
|
| - scaledEvent.y = event.y / pageScaleFactor();
|
| - scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor();
|
| - scaledEvent.data.tap.height = event.data.tap.height / pageScaleFactor();
|
| - IntRect boundingBox(
|
| - scaledEvent.x - scaledEvent.data.tap.width / 2,
|
| - scaledEvent.y - scaledEvent.data.tap.height / 2,
|
| - scaledEvent.data.tap.width,
|
| - scaledEvent.data.tap.height);
|
| -
|
| - WebSize pinchViewportOffset = pinchVirtualViewportEnabled() ?
|
| - flooredIntSize(page()->frameHost().pinchViewport().location()) : IntSize();
|
| -
|
| - // Keep bounding box relative to the main frame.
|
| - boundingBox.move(pinchViewportOffset);
|
| + IntRect boundingBox(page()->frameHost().pinchViewport().viewportToRootFrame(IntRect(
|
| + event.x - event.data.tap.width / 2,
|
| + event.y - event.data.tap.height / 2,
|
| + event.data.tap.width,
|
| + event.data.tap.height)));
|
| +
|
| + // FIXME: We shouldn't pass details of the PinchViewport offset to render_view_impl.
|
| + WebSize pinchViewportOffset = flooredIntSize(page()->frameHost().pinchViewport().location());
|
|
|
| Vector<IntRect> goodTargets;
|
| WillBeHeapVector<RawPtrWillBeMember<Node>> highlightNodes;
|
| @@ -1126,13 +1118,13 @@ bool WebViewImpl::handleCharEvent(const WebKeyboardEvent& event)
|
| return true;
|
| }
|
|
|
| -WebRect WebViewImpl::computeBlockBound(const WebPoint& webPoint, bool ignoreClipping)
|
| +WebRect WebViewImpl::computeBlockBound(const WebPoint& pointInRootFrame, bool ignoreClipping)
|
| {
|
| if (!mainFrameImpl())
|
| return WebRect();
|
|
|
| // Use the point-based hit test to find the node.
|
| - IntPoint point = mainFrameImpl()->frameView()->windowToContents(IntPoint(webPoint.x, webPoint.y));
|
| + IntPoint point = mainFrameImpl()->frameView()->rootFrameToContents(IntPoint(pointInRootFrame.x, pointInRootFrame.y));
|
| HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active | (ignoreClipping ? HitTestRequest::IgnoreClipping : 0);
|
| HitTestResult result = mainFrameImpl()->frame()->eventHandler().hitTestResultAtPoint(point, hitType);
|
| result.setToShadowHostIfInClosedShadowRoot();
|
| @@ -1146,11 +1138,11 @@ WebRect WebViewImpl::computeBlockBound(const WebPoint& webPoint, bool ignoreClip
|
| while (node && (!node->renderer() || node->renderer()->isInline()))
|
| node = NodeRenderingTraversal::parent(*node);
|
|
|
| - // Return the bounding box in the window coordinate system.
|
| + // Return the bounding box in the root frame's coordinate space.
|
| if (node) {
|
| - IntRect rect = node->Node::pixelSnappedBoundingBox();
|
| + IntRect pointInRootFrame = node->Node::pixelSnappedBoundingBox();
|
| LocalFrame* frame = node->document().frame();
|
| - return frame->view()->contentsToWindow(rect);
|
| + return frame->view()->contentsToRootFrame(pointInRootFrame);
|
| }
|
| return WebRect();
|
| }
|
| @@ -1198,12 +1190,12 @@ float WebViewImpl::maximumLegiblePageScale() const
|
| return m_maximumLegibleScale;
|
| }
|
|
|
| -void WebViewImpl::computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRect& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale, WebPoint& scroll)
|
| +void WebViewImpl::computeScaleAndScrollForBlockRect(const WebPoint& hitPointInRootFrame, const WebRect& blockRectInRootFrame, float padding, float defaultScaleWhenAlreadyLegible, float& scale, WebPoint& scroll)
|
| {
|
| scale = pageScaleFactor();
|
| scroll.x = scroll.y = 0;
|
|
|
| - WebRect rect = blockRect;
|
| + WebRect rect = blockRectInRootFrame;
|
|
|
| if (!rect.isEmpty()) {
|
| float defaultMargin = doubleTapZoomContentDefaultMargin;
|
| @@ -1242,19 +1234,19 @@ void WebViewImpl::computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, co
|
| } else {
|
| // Ensure position we're zooming to (+ padding) isn't off the bottom of
|
| // the screen.
|
| - rect.y = std::max<float>(rect.y, hitPoint.y + padding - screenHeight);
|
| + rect.y = std::max<float>(rect.y, hitPointInRootFrame.y + padding - screenHeight);
|
| } // Otherwise top align the block.
|
|
|
| // Do the same thing for horizontal alignment.
|
| if (rect.width < screenWidth)
|
| rect.x -= 0.5 * (screenWidth - rect.width);
|
| else
|
| - rect.x = std::max<float>(rect.x, hitPoint.x + padding - screenWidth);
|
| + rect.x = std::max<float>(rect.x, hitPointInRootFrame.x + padding - screenWidth);
|
| scroll.x = rect.x;
|
| scroll.y = rect.y;
|
|
|
| scale = clampPageScaleFactorToLimits(scale);
|
| - scroll = mainFrameImpl()->frameView()->windowToContents(scroll);
|
| + scroll = mainFrameImpl()->frameView()->rootFrameToContents(scroll);
|
| scroll = clampOffsetAtScale(scroll, scale);
|
| }
|
|
|
| @@ -1365,16 +1357,16 @@ void WebViewImpl::enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<Node>>
|
| }
|
| }
|
|
|
| -void WebViewImpl::animateDoubleTapZoom(const IntPoint& point)
|
| +void WebViewImpl::animateDoubleTapZoom(const IntPoint& pointInRootFrame)
|
| {
|
| if (!mainFrameImpl())
|
| return;
|
|
|
| - WebRect blockBounds = computeBlockBound(point, false);
|
| + WebRect blockBounds = computeBlockBound(pointInRootFrame, false);
|
| float scale;
|
| WebPoint scroll;
|
|
|
| - computeScaleAndScrollForBlockRect(point, blockBounds, touchPointPadding, minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio, scale, scroll);
|
| + computeScaleAndScrollForBlockRect(pointInRootFrame, blockBounds, touchPointPadding, minimumPageScaleFactor() * doubleTapZoomAlreadyLegibleRatio, scale, scroll);
|
|
|
| bool stillAtPreviousDoubleTapScale = (pageScaleFactor() == m_doubleTapZoomPageScaleFactor
|
| && m_doubleTapZoomPageScaleFactor != minimumPageScaleFactor())
|
| @@ -1387,7 +1379,7 @@ void WebViewImpl::animateDoubleTapZoom(const IntPoint& point)
|
|
|
| if (shouldZoomOut) {
|
| scale = minimumPageScaleFactor();
|
| - isAnimating = startPageScaleAnimation(mainFrameImpl()->frameView()->windowToContents(point), true, scale, doubleTapZoomAnimationDurationInSeconds);
|
| + isAnimating = startPageScaleAnimation(mainFrameImpl()->frameView()->rootFrameToContents(pointInRootFrame), true, scale, doubleTapZoomAnimationDurationInSeconds);
|
| } else {
|
| isAnimating = startPageScaleAnimation(scroll, false, scale, doubleTapZoomAnimationDurationInSeconds);
|
| }
|
| @@ -1398,12 +1390,12 @@ void WebViewImpl::animateDoubleTapZoom(const IntPoint& point)
|
| }
|
| }
|
|
|
| -void WebViewImpl::zoomToFindInPageRect(const WebRect& rect)
|
| +void WebViewImpl::zoomToFindInPageRect(const WebRect& rectInRootFrame)
|
| {
|
| if (!mainFrameImpl())
|
| return;
|
|
|
| - WebRect blockBounds = computeBlockBound(WebPoint(rect.x + rect.width / 2, rect.y + rect.height / 2), true);
|
| + WebRect blockBounds = computeBlockBound(WebPoint(rectInRootFrame.x + rectInRootFrame.width / 2, rectInRootFrame.y + rectInRootFrame.height / 2), true);
|
|
|
| if (blockBounds.isEmpty()) {
|
| // Keep current scale (no need to scroll as x,y will normally already
|
| @@ -1414,12 +1406,12 @@ void WebViewImpl::zoomToFindInPageRect(const WebRect& rect)
|
| float scale;
|
| WebPoint scroll;
|
|
|
| - computeScaleAndScrollForBlockRect(WebPoint(rect.x, rect.y), blockBounds, nonUserInitiatedPointPadding, minimumPageScaleFactor(), scale, scroll);
|
| + computeScaleAndScrollForBlockRect(WebPoint(rectInRootFrame.x, rectInRootFrame.y), blockBounds, nonUserInitiatedPointPadding, minimumPageScaleFactor(), scale, scroll);
|
|
|
| startPageScaleAnimation(scroll, false, scale, findInPageAnimationDurationInSeconds);
|
| }
|
|
|
| -bool WebViewImpl::zoomToMultipleTargetsRect(const WebRect& rect)
|
| +bool WebViewImpl::zoomToMultipleTargetsRect(const WebRect& rectInRootFrame)
|
| {
|
| if (!mainFrameImpl())
|
| return false;
|
| @@ -1427,7 +1419,7 @@ bool WebViewImpl::zoomToMultipleTargetsRect(const WebRect& rect)
|
| float scale;
|
| WebPoint scroll;
|
|
|
| - computeScaleAndScrollForBlockRect(WebPoint(rect.x, rect.y), rect, nonUserInitiatedPointPadding, minimumPageScaleFactor(), scale, scroll);
|
| + computeScaleAndScrollForBlockRect(WebPoint(rectInRootFrame.x, rectInRootFrame.y), rectInRootFrame, nonUserInitiatedPointPadding, minimumPageScaleFactor(), scale, scroll);
|
|
|
| if (scale <= pageScaleFactor())
|
| return false;
|
| @@ -2579,23 +2571,8 @@ bool WebViewImpl::selectionBounds(WebRect& anchor, WebRect& focus) const
|
| focus = localFrame->editor().firstRectForRange(range.get());
|
| }
|
|
|
| - IntRect scaledAnchor(localFrame->view()->contentsToWindow(anchor));
|
| - IntRect scaledFocus(localFrame->view()->contentsToWindow(focus));
|
| -
|
| - if (pinchVirtualViewportEnabled()) {
|
| - // FIXME(http://crbug.com/371902) - We shouldn't have to do this
|
| - // manually, the contentsToWindow methods above should be fixed to do
|
| - // this.
|
| - IntPoint pinchViewportOffset =
|
| - roundedIntPoint(page()->frameHost().pinchViewport().visibleRect().location());
|
| - scaledAnchor.moveBy(-pinchViewportOffset);
|
| - scaledFocus.moveBy(-pinchViewportOffset);
|
| - }
|
| -
|
| - scaledAnchor.scale(pageScaleFactor());
|
| - scaledFocus.scale(pageScaleFactor());
|
| - anchor = scaledAnchor;
|
| - focus = scaledFocus;
|
| + anchor = localFrame->view()->contentsToViewport(anchor);
|
| + focus = localFrame->view()->contentsToViewport(focus);
|
|
|
| if (!selection.selection().isBaseFirst())
|
| std::swap(anchor, focus);
|
| @@ -2921,15 +2898,7 @@ bool WebViewImpl::scrollFocusedNodeIntoRect(const WebRect& rectInViewport)
|
| ceiledIntPoint(pinchViewport.location()),
|
| expandedIntSize(pinchViewport.visibleSize()));
|
|
|
| - // FIXME: Use viewportToRootFrame when coordinate refactoring CL lands.
|
| - FloatRect targetRectInRootFrame(
|
| - rectInViewport.x,
|
| - rectInViewport.y,
|
| - rectInViewport.width,
|
| - rectInViewport.height);
|
| - targetRectInRootFrame.scale(1 / pinchViewport.scale());
|
| - targetRectInRootFrame.moveBy(viewportRectInRootFrame.location());
|
| -
|
| + FloatRect targetRectInRootFrame = pinchViewport.viewportToRootFrame(rectInViewport);
|
| DoubleSize remainder = frame->view()->scrollElementToRect(element, IntRect(targetRectInRootFrame));
|
|
|
| // Scroll the remainder in the pinch viewport.
|
| @@ -2952,7 +2921,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
|
| focusedNode->document().updateLayoutIgnorePendingStylesheets();
|
|
|
| // 'caret' is rect encompassing the blinking cursor.
|
| - IntRect textboxRect = focusedNode->document().view()->contentsToWindow(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
|
| + IntRect textboxRectInRootFrame = focusedNode->document().view()->contentsToRootFrame(pixelSnappedIntRect(focusedNode->Node::boundingBox()));
|
| WebRect caret, unusedEnd;
|
| selectionBounds(caret, unusedEnd);
|
| IntRect unscaledCaret = caret;
|
| @@ -2965,7 +2934,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
|
| // Pick a scale which is reasonably readable. This is the scale at which
|
| // the caret height will become minReadableCaretHeightForNode (adjusted
|
| // for dpi and font scale factor).
|
| - const int minReadableCaretHeightForNode = textboxRect.height() >= 2 * caret.height ? minReadableCaretHeightForTextArea : minReadableCaretHeight;
|
| + const int minReadableCaretHeightForNode = textboxRectInRootFrame.height() >= 2 * caret.height ? minReadableCaretHeightForTextArea : minReadableCaretHeight;
|
| newScale = clampPageScaleFactorToLimits(maximumLegiblePageScale() * minReadableCaretHeightForNode / caret.height);
|
| newScale = std::max(newScale, pageScaleFactor());
|
| }
|
| @@ -2979,8 +2948,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
|
| newScale = pageScaleFactor();
|
|
|
| // Convert the rects to absolute space in the new scale.
|
| - IntRect textboxRectInDocumentCoordinates = textboxRect;
|
| - textboxRectInDocumentCoordinates.move(mainFrame()->scrollOffset());
|
| + IntRect textboxRectInDocumentCoordinates = mainFrameImpl()->frameView()->frameToContents(textboxRectInRootFrame);
|
| IntRect caretInDocumentCoordinates = caret;
|
| caretInDocumentCoordinates.move(mainFrame()->scrollOffset());
|
|
|
| @@ -2995,7 +2963,7 @@ void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, float&
|
|
|
| // If the box is partially offscreen and it's possible to bring it fully
|
| // onscreen, then animate.
|
| - if (sizeRect.contains(textboxRectInDocumentCoordinates.width(), textboxRectInDocumentCoordinates.height()) && !sizeRect.contains(textboxRect))
|
| + if (sizeRect.contains(textboxRectInDocumentCoordinates.width(), textboxRectInDocumentCoordinates.height()) && !sizeRect.contains(textboxRectInRootFrame))
|
| needAnimation = true;
|
|
|
| if (!needAnimation)
|
| @@ -3532,7 +3500,8 @@ void WebViewImpl::resetScrollAndScaleState()
|
| void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
|
| const WebPoint& location)
|
| {
|
| - HitTestResult result = hitTestResultForWindowPos(location);
|
| + // FIXME: location is probably in viewport coordinates.
|
| + HitTestResult result = hitTestResultForRootFramePos(location);
|
| RefPtrWillBeRawPtr<Node> node = result.innerNonSharedNode();
|
| if (!isHTMLVideoElement(*node) && !isHTMLAudioElement(*node))
|
| return;
|
| @@ -3562,7 +3531,8 @@ void WebViewImpl::performMediaPlayerAction(const WebMediaPlayerAction& action,
|
| void WebViewImpl::performPluginAction(const WebPluginAction& action,
|
| const WebPoint& location)
|
| {
|
| - HitTestResult result = hitTestResultForWindowPos(location);
|
| + // FIXME: Location is probably in viewport coordinates
|
| + HitTestResult result = hitTestResultForRootFramePos(location);
|
| RefPtrWillBeRawPtr<Node> node = result.innerNonSharedNode();
|
| if (!isHTMLObjectElement(*node) && !isHTMLEmbedElement(*node))
|
| return;
|
| @@ -3591,12 +3561,11 @@ WebHitTestResult WebViewImpl::hitTestResultAt(const WebPoint& point)
|
| return coreHitTestResultAt(point);
|
| }
|
|
|
| -HitTestResult WebViewImpl::coreHitTestResultAt(const WebPoint& point)
|
| +HitTestResult WebViewImpl::coreHitTestResultAt(const WebPoint& pointInViewport)
|
| {
|
| - FloatPoint scaledPoint(point.x, point.y);
|
| - scaledPoint.scale(1 / pageScaleFactor(), 1 / pageScaleFactor());
|
| - scaledPoint.moveBy(pinchViewportOffset());
|
| - return hitTestResultForWindowPos(flooredIntPoint(scaledPoint));
|
| + FrameView* view = mainFrameImpl()->frameView();
|
| + IntPoint pointInRootFrame = view->contentsToFrame(view->viewportToContents(pointInViewport));
|
| + return hitTestResultForRootFramePos(pointInRootFrame);
|
| }
|
|
|
| void WebViewImpl::copyImageAt(const WebPoint& point)
|
| @@ -3604,7 +3573,8 @@ void WebViewImpl::copyImageAt(const WebPoint& point)
|
| if (!m_page)
|
| return;
|
|
|
| - HitTestResult result = hitTestResultForWindowPos(point);
|
| + // FIXME: point is probably in viewport coordinates.
|
| + HitTestResult result = hitTestResultForRootFramePos(point);
|
| if (!isHTMLCanvasElement(result.innerNonSharedNode()) && result.absoluteImageURL().isEmpty()) {
|
| // There isn't actually an image at these coordinates. Might be because
|
| // the window scrolled while the context menu was open or because the page
|
| @@ -3624,7 +3594,8 @@ void WebViewImpl::saveImageAt(const WebPoint& point)
|
| if (!m_client)
|
| return;
|
|
|
| - Node* node = hitTestResultForWindowPos(point).innerNonSharedNode();
|
| + // FIXME: point is probably in viewport coordinates.
|
| + Node* node = hitTestResultForRootFramePos(point).innerNonSharedNode();
|
| if (!node || !(isHTMLCanvasElement(*node) || isHTMLImageElement(*node)))
|
| return;
|
|
|
| @@ -3825,12 +3796,12 @@ unsigned long WebViewImpl::createUniqueIdentifierForRequest()
|
| return createUniqueIdentifier();
|
| }
|
|
|
| -void WebViewImpl::inspectElementAt(const WebPoint& point)
|
| +void WebViewImpl::inspectElementAt(const WebPoint& pointInRootFrame)
|
| {
|
| if (!m_page)
|
| return;
|
|
|
| - if (point.x == -1 || point.y == -1) {
|
| + if (pointInRootFrame.x == -1 || pointInRootFrame.y == -1) {
|
| m_page->inspectorController().inspect(0);
|
| } else {
|
| HitTestRequest::HitTestRequestType hitType = HitTestRequest::Move | HitTestRequest::ReadOnly | HitTestRequest::AllowChildFrameContent;
|
| @@ -3838,10 +3809,10 @@ void WebViewImpl::inspectElementAt(const WebPoint& point)
|
|
|
| WebMouseEvent dummyEvent;
|
| dummyEvent.type = WebInputEvent::MouseDown;
|
| - dummyEvent.x = point.x;
|
| - dummyEvent.y = point.y;
|
| + dummyEvent.x = pointInRootFrame.x;
|
| + dummyEvent.y = pointInRootFrame.y;
|
| IntPoint transformedPoint = PlatformMouseEventBuilder(m_page->deprecatedLocalMainFrame()->view(), dummyEvent).position();
|
| - HitTestResult result(m_page->deprecatedLocalMainFrame()->view()->windowToContents(transformedPoint));
|
| + HitTestResult result(m_page->deprecatedLocalMainFrame()->view()->rootFrameToContents(transformedPoint));
|
| m_page->deprecatedLocalMainFrame()->contentRenderer()->hitTest(request, result);
|
| Node* node = result.innerNode();
|
| if (!node && m_page->deprecatedLocalMainFrame()->document())
|
| @@ -3909,22 +3880,22 @@ void WebViewImpl::showContextMenu()
|
| m_contextMenuAllowed = false;
|
| }
|
|
|
| -void WebViewImpl::extractSmartClipData(WebRect rect, WebString& clipText, WebString& clipHtml, WebRect& clipRect)
|
| +void WebViewImpl::extractSmartClipData(WebRect rectInViewport, WebString& clipText, WebString& clipHtml, WebRect& clipRectInViewport)
|
| {
|
| LocalFrame* localFrame = toLocalFrame(focusedCoreFrame());
|
| if (!localFrame)
|
| return;
|
| - SmartClipData clipData = SmartClip(localFrame).dataForRect(rect);
|
| + SmartClipData clipData = SmartClip(localFrame).dataForRect(rectInViewport);
|
| clipText = clipData.clipData();
|
| - clipRect = clipData.rect();
|
| + clipRectInViewport = clipData.rectInViewport();
|
|
|
| WebLocalFrameImpl* frame = mainFrameImpl();
|
| if (!frame)
|
| return;
|
| - WebPoint startPoint(rect.x, rect.y);
|
| - WebPoint endPoint(rect.x + rect.width, rect.y + rect.height);
|
| - VisiblePosition startVisiblePosition = frame->visiblePositionForWindowPoint(startPoint);
|
| - VisiblePosition endVisiblePosition = frame->visiblePositionForWindowPoint(endPoint);
|
| + WebPoint startPoint(rectInViewport.x, rectInViewport.y);
|
| + WebPoint endPoint(rectInViewport.x + rectInViewport.width, rectInViewport.y + rectInViewport.height);
|
| + VisiblePosition startVisiblePosition = frame->visiblePositionForViewportPoint(startPoint);
|
| + VisiblePosition endVisiblePosition = frame->visiblePositionForViewportPoint(endPoint);
|
|
|
| Position startPosition = startVisiblePosition.deepEquivalent();
|
| Position endPosition = endVisiblePosition.deepEquivalent();
|
| @@ -4231,11 +4202,11 @@ Element* WebViewImpl::focusedElement() const
|
| return document->focusedElement();
|
| }
|
|
|
| -HitTestResult WebViewImpl::hitTestResultForWindowPos(const IntPoint& pos)
|
| +HitTestResult WebViewImpl::hitTestResultForRootFramePos(const IntPoint& pos)
|
| {
|
| if (!m_page->mainFrame()->isLocalFrame())
|
| return HitTestResult();
|
| - IntPoint docPoint(m_page->deprecatedLocalMainFrame()->view()->windowToContents(pos));
|
| + IntPoint docPoint(m_page->deprecatedLocalMainFrame()->view()->rootFrameToContents(pos));
|
| HitTestResult result = m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultAtPoint(docPoint, HitTestRequest::ReadOnly | HitTestRequest::Active);
|
| result.setToShadowHostIfInClosedShadowRoot();
|
| return result;
|
|
|