WebKit Bugzilla
Attachment 340069 Details for
Bug 182785
: Start migration to a version of windowToContents() that may take scroll offset into account for delegated scrolling
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
0001-Bug-182785-Start-migration-to-a-version-of-windowToC.patch (text/plain), 41.02 KB, created by
Frédéric Wang (:fredw)
on 2018-05-09 23:31:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-05-09 23:31:44 PDT
Size:
41.02 KB
patch
obsolete
>From 7a6e37dc828bd9f1c9ea5c0a7323926f61d4e9ab Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Tue, 3 Apr 2018 08:25:12 +0200 >Subject: [PATCH xserver 1/4] Bug 182785 - Start migration to a version of > windowToContents() that takes scroll offset into account when scrolling is > delegated > >--- > Source/WebCore/ChangeLog | 65 +++++++++++++++++++ > .../WebKitAccessibleInterfaceComponent.cpp | 2 +- > Source/WebCore/dom/MouseRelatedEvent.cpp | 2 +- > Source/WebCore/editing/Editor.cpp | 2 +- > Source/WebCore/page/DragController.cpp | 10 +-- > Source/WebCore/page/EventHandler.cpp | 32 ++++----- > Source/WebCore/page/Frame.cpp | 2 +- > Source/WebCore/page/PageOverlay.cpp | 2 +- > Source/WebCore/page/ios/EventHandlerIOS.mm | 6 +- > Source/WebCore/page/ios/FrameIOS.mm | 2 +- > .../page/mac/ServicesOverlayController.mm | 6 +- > Source/WebCore/platform/ScrollView.cpp | 4 +- > Source/WebCore/platform/ScrollView.h | 2 +- > Source/WebCore/rendering/RenderLayer.cpp | 4 +- > Source/WebCore/rendering/RenderListBox.cpp | 2 +- > Source/WebKit/ChangeLog | 27 ++++++++ > .../WebProcess/Plugins/PDF/PDFPlugin.mm | 2 +- > .../WebCoreSupport/WebChromeClient.cpp | 2 +- > .../WebPage/ViewGestureGeometryCollector.cpp | 2 +- > Source/WebKit/WebProcess/WebPage/WebPage.cpp | 2 +- > .../WebProcess/WebPage/mac/WebPageMac.mm | 8 +-- > Source/WebKitLegacy/ios/ChangeLog | 17 +++++ > .../ios/WebCoreSupport/WebFrameIOS.mm | 2 +- > Source/WebKitLegacy/win/ChangeLog | 19 ++++++ > .../win/WebCoreSupport/WebDragClient.cpp | 2 +- > Source/WebKitLegacy/win/WebView.cpp | 2 +- > 26 files changed, 178 insertions(+), 50 deletions(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 980634c1a88..9b3867646cf 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,68 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >+ https://bugs.webkit.org/show_bug.cgi?id=182785 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ScrollView::windowToContents(const IntPoint&) currently does not take into account the scroll >+ position of the ScrollView when it delegatesScrolling(), which is not always correct. In >+ order to implement hit testing for iOS frame in bug 173833, this should be fixed. However, >+ that is a bit difficult because windowToContents and similar functions are used everywhere >+ in the code. This patch just renames the function to deprecateWindowToContents so that we can >+ smoothly transition existing code to newer versions in the future. >+ >+ No new tests, behavior unchanged. >+ >+ * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp: >+ (atkToContents): >+ * dom/MouseRelatedEvent.cpp: >+ (WebCore::MouseRelatedEvent::init): >+ * editing/Editor.cpp: >+ (WebCore::Editor::rangeForPoint): >+ * page/DragController.cpp: >+ (WebCore::DragController::tryDocumentDrag): >+ (WebCore::DragController::concludeEditDrag): >+ (WebCore::DragController::canProcessDrag): >+ (WebCore::DragController::startDrag): >+ (WebCore::DragController::placeDragCaret): >+ * page/EventHandler.cpp: >+ (WebCore::EventHandler::handleMousePressEventSingleClick): >+ (WebCore::EventHandler::handleMousePressEvent): >+ (WebCore::EventHandler::eventMayStartDrag const): >+ (WebCore::EventHandler::updateSelectionForMouseDrag): >+ (WebCore::EventHandler::updateCursor): >+ (WebCore::EventHandler::selectCursor): >+ (WebCore::documentPointForWindowPoint): >+ (WebCore::EventHandler::handleMouseMoveEvent): >+ (WebCore::EventHandler::handleMouseReleaseEvent): >+ (WebCore::EventHandler::handleWheelEvent): >+ (WebCore::EventHandler::sendContextMenuEvent): >+ (WebCore::EventHandler::dispatchFakeMouseMoveEventSoonInQuad): >+ (WebCore::EventHandler::hoverTimerFired): >+ (WebCore::EventHandler::mouseMovementExceedsThreshold const): >+ * page/Frame.cpp: >+ (WebCore::Frame::documentAtPoint): >+ * page/PageOverlay.cpp: >+ (WebCore::PageOverlay::mouseEvent): >+ * page/ios/EventHandlerIOS.mm: >+ (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): >+ * page/ios/FrameIOS.mm: >+ (WebCore::Frame::hitTestResultAtViewportLocation): >+ * page/mac/ServicesOverlayController.mm: >+ (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): >+ (WebCore::ServicesOverlayController::buildSelectionHighlight): >+ (WebCore::ServicesOverlayController::mouseEvent): >+ * platform/ScrollView.cpp: >+ (WebCore::ScrollView::deprecatedWindowToContents const): >+ (WebCore::ScrollView::paintPanScrollIcon): >+ * platform/ScrollView.h: >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::autoscroll): >+ (WebCore::RenderLayer::resize): >+ * rendering/RenderListBox.cpp: >+ (WebCore::RenderListBox::autoscroll): >+ > 2018-05-09 Yacine Bandou <yacine.bandou_ext@softathome.com> > > [EME][GStreamer] Crash when the mediaKeys are created before loading the media in debug conf >diff --git a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp >index e86f230984b..32d1732f62e 100644 >--- a/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp >+++ b/Source/WebCore/accessibility/atk/WebKitAccessibleInterfaceComponent.cpp >@@ -59,7 +59,7 @@ static IntPoint atkToContents(AccessibilityObject* coreObject, AtkCoordType coor > case ATK_XY_SCREEN: > return frameView->screenToContents(pos); > case ATK_XY_WINDOW: >- return frameView->windowToContents(pos); >+ return frameView->deprecatedWindowToContents(pos); > } > } > >diff --git a/Source/WebCore/dom/MouseRelatedEvent.cpp b/Source/WebCore/dom/MouseRelatedEvent.cpp >index 9d37bcafed0..79a85458113 100644 >--- a/Source/WebCore/dom/MouseRelatedEvent.cpp >+++ b/Source/WebCore/dom/MouseRelatedEvent.cpp >@@ -63,7 +63,7 @@ void MouseRelatedEvent::init(bool isSimulated, const IntPoint& windowLocation) > { > if (!isSimulated) { > if (auto* frameView = frameViewFromWindowProxy(view())) { >- FloatPoint absolutePoint = frameView->windowToContents(windowLocation); >+ FloatPoint absolutePoint = frameView->deprecatedWindowToContents(windowLocation); > FloatPoint documentPoint = frameView->absoluteToDocumentPoint(absolutePoint); > m_pageLocation = flooredLayoutPoint(documentPoint); > m_clientLocation = pagePointToClientPoint(m_pageLocation, frameView); >diff --git a/Source/WebCore/editing/Editor.cpp b/Source/WebCore/editing/Editor.cpp >index 6c66907808d..134f4ae0527 100644 >--- a/Source/WebCore/editing/Editor.cpp >+++ b/Source/WebCore/editing/Editor.cpp >@@ -2889,7 +2889,7 @@ RefPtr<Range> Editor::rangeForPoint(const IntPoint& windowPoint) > FrameView* frameView = frame->view(); > if (!frameView) > return nullptr; >- IntPoint framePoint = frameView->windowToContents(windowPoint); >+ IntPoint framePoint = frameView->deprecatedWindowToContents(windowPoint); > VisibleSelection selection(frame->visiblePositionForPoint(framePoint)); > > return selection.toNormalizedRange(); >diff --git a/Source/WebCore/page/DragController.cpp b/Source/WebCore/page/DragController.cpp >index 470555023ef..9fb9214bb83 100644 >--- a/Source/WebCore/page/DragController.cpp >+++ b/Source/WebCore/page/DragController.cpp >@@ -408,7 +408,7 @@ DragController::DragHandlingMethod DragController::tryDocumentDrag(const DragDat > return DragHandlingMethod::SetColor; > } > >- IntPoint point = frameView->windowToContents(dragData.clientPosition()); >+ IntPoint point = frameView->deprecatedWindowToContents(dragData.clientPosition()); > Element* element = elementUnderMouse(m_documentUnderMouse.get(), point); > if (!element) > return DragHandlingMethod::None; >@@ -525,7 +525,7 @@ bool DragController::concludeEditDrag(const DragData& dragData) > if (!m_documentUnderMouse) > return false; > >- IntPoint point = m_documentUnderMouse->view()->windowToContents(dragData.clientPosition()); >+ IntPoint point = m_documentUnderMouse->view()->deprecatedWindowToContents(dragData.clientPosition()); > Element* element = elementUnderMouse(m_documentUnderMouse.get(), point); > if (!element) > return false; >@@ -630,7 +630,7 @@ bool DragController::concludeEditDrag(const DragData& dragData) > > bool DragController::canProcessDrag(const DragData& dragData) > { >- IntPoint point = m_page.mainFrame().view()->windowToContents(dragData.clientPosition()); >+ IntPoint point = m_page.mainFrame().view()->deprecatedWindowToContents(dragData.clientPosition()); > HitTestResult result = HitTestResult(point); > if (!m_page.mainFrame().contentRenderer()) > return false; >@@ -891,7 +891,7 @@ bool DragController::startDrag(Frame& src, const DragState& state, DragOperation > URL linkURL = hitTestResult.absoluteLinkURL(); > URL imageURL = hitTestResult.absoluteImageURL(); > >- IntPoint mouseDraggedPoint = src.view()->windowToContents(dragEvent.position()); >+ IntPoint mouseDraggedPoint = src.view()->deprecatedWindowToContents(dragEvent.position()); > > m_draggingImageURL = URL(); > m_sourceDragOperation = srcOp; >@@ -1281,7 +1281,7 @@ void DragController::placeDragCaret(const IntPoint& windowPoint) > FrameView* frameView = frame->view(); > if (!frameView) > return; >- IntPoint framePoint = frameView->windowToContents(windowPoint); >+ IntPoint framePoint = frameView->deprecatedWindowToContents(windowPoint); > > m_page.dragCaretController().setCaretPosition(frame->visiblePositionForPoint(framePoint)); > } >diff --git a/Source/WebCore/page/EventHandler.cpp b/Source/WebCore/page/EventHandler.cpp >index 8b3c6d1af8f..4c498da4dd8 100644 >--- a/Source/WebCore/page/EventHandler.cpp >+++ b/Source/WebCore/page/EventHandler.cpp >@@ -666,7 +666,7 @@ bool EventHandler::handleMousePressEventSingleClick(const MouseEventWithHitTestR > // Don't restart the selection when the mouse is pressed on an > // existing selection so we can allow for text dragging. > if (FrameView* view = m_frame.view()) { >- LayoutPoint vPoint = view->windowToContents(event.event().position()); >+ LayoutPoint vPoint = view->deprecatedWindowToContents(event.event().position()); > if (!extendSelection && m_frame.selection().contains(vPoint)) { > m_mouseDownWasSingleClickInSelection = true; > return false; >@@ -777,7 +777,7 @@ bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults& eve > if (is<SVGDocument>(*m_frame.document()) && downcast<SVGDocument>(*m_frame.document()).zoomAndPanEnabled()) { > if (event.event().shiftKey() && singleClick) { > m_svgPan = true; >- downcast<SVGDocument>(*m_frame.document()).startPan(m_frame.view()->windowToContents(event.event().position())); >+ downcast<SVGDocument>(*m_frame.document()).startPan(m_frame.view()->deprecatedWindowToContents(event.event().position())); > return true; > } > } >@@ -882,7 +882,7 @@ bool EventHandler::eventMayStartDrag(const PlatformMouseEvent& event) const > > updateDragSourceActionsAllowed(); > HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowUserAgentShadowContent); >- HitTestResult result(view->windowToContents(event.position())); >+ HitTestResult result(view->deprecatedWindowToContents(event.position())); > renderView->hitTest(request, result); > DragState state; > Element* targetElement = result.targetElement(); >@@ -899,7 +899,7 @@ void EventHandler::updateSelectionForMouseDrag() > return; > > HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::Move | HitTestRequest::DisallowUserAgentShadowContent); >- HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); >+ HitTestResult result(view->deprecatedWindowToContents(m_lastKnownMousePosition)); > renderView->hitTest(request, result); > updateSelectionForMouseDrag(result); > } >@@ -1363,7 +1363,7 @@ void EventHandler::updateCursor() > PlatformKeyboardEvent::getCurrentModifierState(shiftKey, ctrlKey, altKey, metaKey); > > HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::AllowFrameScrollbars); >- HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); >+ HitTestResult result(view->deprecatedWindowToContents(m_lastKnownMousePosition)); > renderView->hitTest(request, result); > > updateCursor(*view, result, shiftKey); >@@ -1484,7 +1484,7 @@ std::optional<Cursor> EventHandler::selectCursor(const HitTestResult& result, bo > if (renderer) { > if (RenderLayer* layer = renderer->enclosingLayer()) { > if (FrameView* view = m_frame.view()) >- inResizer = layer->isPointInResizeControl(view->windowToContents(roundedIntPoint(result.localPoint()))); >+ inResizer = layer->isPointInResizeControl(view->deprecatedWindowToContents(roundedIntPoint(result.localPoint()))); > } > } > >@@ -1606,7 +1606,7 @@ static LayoutPoint documentPointForWindowPoint(Frame& frame, const IntPoint& win > FrameView* view = frame.view(); > // FIXME: Is it really OK to use the wrong coordinates here when view is 0? > // Historically the code would just crash; this is clearly no worse than that. >- return view ? view->windowToContents(windowPoint) : windowPoint; >+ return view ? view->deprecatedWindowToContents(windowPoint) : windowPoint; > } > > static Scrollbar* scrollbarForMouseEvent(const MouseEventWithHitTestResults& mouseEvent, FrameView* view) >@@ -1663,7 +1663,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& platformMouse > m_mouseDownMayStartSelect = false; > m_mouseDownMayStartAutoscroll = false; > if (FrameView* view = m_frame.view()) >- m_mouseDownPos = view->windowToContents(platformMouseEvent.position()); >+ m_mouseDownPos = view->deprecatedWindowToContents(platformMouseEvent.position()); > else { > invalidateClick(); > return false; >@@ -1726,7 +1726,7 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& platformMouse > > if (FrameView* view = m_frame.view()) { > RenderLayer* layer = m_clickNode->renderer() ? m_clickNode->renderer()->enclosingLayer() : 0; >- IntPoint p = view->windowToContents(platformMouseEvent.position()); >+ IntPoint p = view->deprecatedWindowToContents(platformMouseEvent.position()); > if (layer && layer->isPointInResizeControl(p)) { > layer->setInResizeMode(true); > m_resizeLayer = layer; >@@ -1901,7 +1901,7 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& platformMouseE > #endif > > if (m_svgPan) { >- downcast<SVGDocument>(*m_frame.document()).updatePan(m_frame.view()->windowToContents(m_lastKnownMousePosition)); >+ downcast<SVGDocument>(*m_frame.document()).updatePan(m_frame.view()->deprecatedWindowToContents(m_lastKnownMousePosition)); > return true; > } > >@@ -2055,7 +2055,7 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& platformMou > > if (m_svgPan) { > m_svgPan = false; >- downcast<SVGDocument>(*m_frame.document()).updatePan(m_frame.view()->windowToContents(m_lastKnownMousePosition)); >+ downcast<SVGDocument>(*m_frame.document()).updatePan(m_frame.view()->deprecatedWindowToContents(m_lastKnownMousePosition)); > return true; > } > >@@ -2770,7 +2770,7 @@ bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event) > setFrameWasScrolledByUser(); > > HitTestRequest request; >- HitTestResult result(view->windowToContents(event.position())); >+ HitTestResult result(view->deprecatedWindowToContents(event.position())); > renderView->hitTest(request, result); > > RefPtr<Element> element = result.targetElement(); >@@ -2879,7 +2879,7 @@ bool EventHandler::sendContextMenuEvent(const PlatformMouseEvent& event) > // Clear mouse press state to avoid initiating a drag while context menu is up. > m_mousePressed = false; > bool swallowEvent; >- LayoutPoint viewportPos = view->windowToContents(event.position()); >+ LayoutPoint viewportPos = view->deprecatedWindowToContents(event.position()); > HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent); > MouseEventWithHitTestResults mouseEvent = doc->prepareMouseEvent(request, viewportPos, event); > >@@ -3027,7 +3027,7 @@ void EventHandler::dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad& quad) > if (!view) > return; > >- if (!quad.containsPoint(view->windowToContents(m_lastKnownMousePosition))) >+ if (!quad.containsPoint(view->deprecatedWindowToContents(m_lastKnownMousePosition))) > return; > > dispatchFakeMouseMoveEventSoon(); >@@ -3083,7 +3083,7 @@ void EventHandler::hoverTimerFired() > if (RenderView* renderView = m_frame.contentRenderer()) { > if (FrameView* view = m_frame.view()) { > HitTestRequest request(HitTestRequest::Move | HitTestRequest::DisallowUserAgentShadowContent); >- HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); >+ HitTestResult result(view->deprecatedWindowToContents(m_lastKnownMousePosition)); > renderView->hitTest(request, result); > m_frame.document()->updateHoverActiveState(request, result.targetElement()); > } >@@ -3775,7 +3775,7 @@ bool EventHandler::mouseMovementExceedsThreshold(const FloatPoint& viewportLocat > FrameView* view = m_frame.view(); > if (!view) > return false; >- IntPoint location = view->windowToContents(flooredIntPoint(viewportLocation)); >+ IntPoint location = view->deprecatedWindowToContents(flooredIntPoint(viewportLocation)); > IntSize delta = location - m_mouseDownPos; > > return abs(delta.width()) >= pointsThreshold || abs(delta.height()) >= pointsThreshold; >diff --git a/Source/WebCore/page/Frame.cpp b/Source/WebCore/page/Frame.cpp >index fa5e2ab46d4..465ea7fc25b 100644 >--- a/Source/WebCore/page/Frame.cpp >+++ b/Source/WebCore/page/Frame.cpp >@@ -867,7 +867,7 @@ Document* Frame::documentAtPoint(const IntPoint& point) > if (!view()) > return nullptr; > >- IntPoint pt = view()->windowToContents(point); >+ IntPoint pt = view()->deprecatedWindowToContents(point); > HitTestResult result = HitTestResult(pt); > > if (contentRenderer()) >diff --git a/Source/WebCore/page/PageOverlay.cpp b/Source/WebCore/page/PageOverlay.cpp >index e2f97cc65f2..01029d3875b 100644 >--- a/Source/WebCore/page/PageOverlay.cpp >+++ b/Source/WebCore/page/PageOverlay.cpp >@@ -192,7 +192,7 @@ bool PageOverlay::mouseEvent(const PlatformMouseEvent& mouseEvent) > IntPoint mousePositionInOverlayCoordinates(mouseEvent.position()); > > if (m_overlayType == PageOverlay::OverlayType::Document) >- mousePositionInOverlayCoordinates = m_page->mainFrame().view()->windowToContents(mousePositionInOverlayCoordinates); >+ mousePositionInOverlayCoordinates = m_page->mainFrame().view()->deprecatedWindowToContents(mousePositionInOverlayCoordinates); > mousePositionInOverlayCoordinates.moveBy(-frame().location()); > > // Ignore events outside the bounds. >diff --git a/Source/WebCore/page/ios/EventHandlerIOS.mm b/Source/WebCore/page/ios/EventHandlerIOS.mm >index 2efa251ee4b..c324bfc9e45 100644 >--- a/Source/WebCore/page/ios/EventHandlerIOS.mm >+++ b/Source/WebCore/page/ios/EventHandlerIOS.mm >@@ -659,13 +659,13 @@ bool EventHandler::tryToBeginDataInteractionAtPoint(const IntPoint& clientPositi > FloatPoint adjustedClientPositionAsFloatPoint(clientPosition); > protectedFrame->nodeRespondingToClickEvents(clientPosition, adjustedClientPositionAsFloatPoint); > IntPoint adjustedClientPosition = roundedIntPoint(adjustedClientPositionAsFloatPoint); >- IntPoint adjustedGlobalPosition = protectedFrame->view()->windowToContents(adjustedClientPosition); >+ IntPoint adjustedGlobalPosition = protectedFrame->view()->deprecatedWindowToContents(adjustedClientPosition); > > PlatformMouseEvent syntheticMousePressEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), 0, NoTap); > PlatformMouseEvent syntheticMouseMoveEvent(adjustedClientPosition, adjustedGlobalPosition, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), 0, NoTap); > > HitTestRequest request(HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent); >- auto documentPoint = protectedFrame->view() ? protectedFrame->view()->windowToContents(syntheticMouseMoveEvent.position()) : syntheticMouseMoveEvent.position(); >+ auto documentPoint = protectedFrame->view() ? protectedFrame->view()->deprecatedWindowToContents(syntheticMouseMoveEvent.position()) : syntheticMouseMoveEvent.position(); > auto hitTestedMouseEvent = document->prepareMouseEvent(request, documentPoint, syntheticMouseMoveEvent); > > RefPtr<Frame> subframe = subframeForHitTestResult(hitTestedMouseEvent); >@@ -680,7 +680,7 @@ bool EventHandler::tryToBeginDataInteractionAtPoint(const IntPoint& clientPositi > > SetForScope<bool> mousePressed(m_mousePressed, true); > dragState().source = nullptr; >- m_mouseDownPos = protectedFrame->view()->windowToContents(syntheticMouseMoveEvent.position()); >+ m_mouseDownPos = protectedFrame->view()->deprecatedWindowToContents(syntheticMouseMoveEvent.position()); > > return handleMouseDraggedEvent(hitTestedMouseEvent, DontCheckDragHysteresis); > } >diff --git a/Source/WebCore/page/ios/FrameIOS.mm b/Source/WebCore/page/ios/FrameIOS.mm >index e1b01853f20..a4aa2085375 100644 >--- a/Source/WebCore/page/ios/FrameIOS.mm >+++ b/Source/WebCore/page/ios/FrameIOS.mm >@@ -260,7 +260,7 @@ bool Frame::hitTestResultAtViewportLocation(const FloatPoint& viewportLocation, > if (!view) > return false; > >- center = view->windowToContents(roundedIntPoint(viewportLocation)); >+ center = view->deprecatedWindowToContents(roundedIntPoint(viewportLocation)); > hitTestResult = eventHandler().hitTestResultAtPoint(center); > return true; > } >diff --git a/Source/WebCore/page/mac/ServicesOverlayController.mm b/Source/WebCore/page/mac/ServicesOverlayController.mm >index e09fdd67463..333ff2747ce 100644 >--- a/Source/WebCore/page/mac/ServicesOverlayController.mm >+++ b/Source/WebCore/page/mac/ServicesOverlayController.mm >@@ -511,7 +511,7 @@ void ServicesOverlayController::buildPhoneNumberHighlights() > FrameView* viewForRange = range->ownerDocument().view(); > if (!viewForRange) > continue; >- rect.setLocation(mainFrameView.windowToContents(viewForRange->contentsToWindow(rect.location()))); >+ rect.setLocation(mainFrameView.deprecatedWindowToContents(viewForRange->contentsToWindow(rect.location()))); > > CGRect cgRect = rect; > RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightStyleBubbleStandard | DDHighlightStyleStandardIconArrow, YES, NSWritingDirectionNatural, NO, YES)); >@@ -547,7 +547,7 @@ void ServicesOverlayController::buildSelectionHighlight() > > for (auto& rect : m_currentSelectionRects) { > IntRect currentRect = snappedIntRect(rect); >- currentRect.setLocation(mainFrameView->windowToContents(viewForRange->contentsToWindow(currentRect.location()))); >+ currentRect.setLocation(mainFrameView->deprecatedWindowToContents(viewForRange->contentsToWindow(currentRect.location()))); > cgRects.append((CGRect)currentRect); > } > >@@ -720,7 +720,7 @@ void ServicesOverlayController::determineActiveHighlight(bool& mouseIsOverActive > > bool ServicesOverlayController::mouseEvent(PageOverlay&, const PlatformMouseEvent& event) > { >- m_mousePosition = mainFrame().view()->windowToContents(event.position()); >+ m_mousePosition = mainFrame().view()->deprecatedWindowToContents(event.position()); > > bool mouseIsOverActiveHighlightButton = false; > determineActiveHighlight(mouseIsOverActiveHighlightButton); >diff --git a/Source/WebCore/platform/ScrollView.cpp b/Source/WebCore/platform/ScrollView.cpp >index 4f53ad7d827..90f9e2df93a 100644 >--- a/Source/WebCore/platform/ScrollView.cpp >+++ b/Source/WebCore/platform/ScrollView.cpp >@@ -897,7 +897,7 @@ IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const > return convertToRootView(contentsToView(contentsRect)); > } > >-IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const >+IntPoint ScrollView::deprecatedWindowToContents(const IntPoint& windowPoint) const > { > if (delegatesScrolling()) > return convertFromContainingWindow(windowPoint); >@@ -1153,7 +1153,7 @@ void ScrollView::paintPanScrollIcon(GraphicsContext& context) > static Image& panScrollIcon = Image::loadPlatformResource("panIcon").leakRef(); > IntPoint iconGCPoint = m_panScrollIconPoint; > if (parent()) >- iconGCPoint = parent()->windowToContents(iconGCPoint); >+ iconGCPoint = parent()->deprecatedWindowToContents(iconGCPoint); > context.drawImage(panScrollIcon, iconGCPoint); > } > >diff --git a/Source/WebCore/platform/ScrollView.h b/Source/WebCore/platform/ScrollView.h >index 7978102049d..75b2620d085 100644 >--- a/Source/WebCore/platform/ScrollView.h >+++ b/Source/WebCore/platform/ScrollView.h >@@ -296,7 +296,7 @@ public: > // Event coordinates are assumed to be in the coordinate space of a window that contains > // the entire widget hierarchy. It is up to the platform to decide what the precise definition > // of containing window is. (For example on Mac it is the containing NSWindow.) >- WEBCORE_EXPORT IntPoint windowToContents(const IntPoint&) const; >+ WEBCORE_EXPORT IntPoint deprecatedWindowToContents(const IntPoint&) const; > WEBCORE_EXPORT IntPoint contentsToWindow(const IntPoint&) const; > WEBCORE_EXPORT IntRect windowToContents(const IntRect&) const; > WEBCORE_EXPORT IntRect contentsToWindow(const IntRect&) const; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index fa0e57a1aab..250aca8dc7d 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -2714,7 +2714,7 @@ LayoutRect RenderLayer::getRectToExpose(const LayoutRect &visibleRect, const Lay > > void RenderLayer::autoscroll(const IntPoint& positionInWindow) > { >- IntPoint currentDocumentPosition = renderer().view().frameView().windowToContents(positionInWindow); >+ IntPoint currentDocumentPosition = renderer().view().frameView().deprecatedWindowToContents(positionInWindow); > scrollRectToVisible(SelectionRevealMode::Reveal, LayoutRect(currentDocumentPosition, LayoutSize(1, 1)), false, ScrollAlignment::alignToEdgeIfNeeded, ScrollAlignment::alignToEdgeIfNeeded); > } > >@@ -2743,7 +2743,7 @@ void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOff > > float zoomFactor = renderer->style().effectiveZoom(); > >- LayoutSize newOffset = offsetFromResizeCorner(document.view()->windowToContents(evt.position())); >+ LayoutSize newOffset = offsetFromResizeCorner(document.view()->deprecatedWindowToContents(evt.position())); > newOffset.setWidth(newOffset.width() / zoomFactor); > newOffset.setHeight(newOffset.height() / zoomFactor); > >diff --git a/Source/WebCore/rendering/RenderListBox.cpp b/Source/WebCore/rendering/RenderListBox.cpp >index fd1daf847c9..09fa1688557 100644 >--- a/Source/WebCore/rendering/RenderListBox.cpp >+++ b/Source/WebCore/rendering/RenderListBox.cpp >@@ -574,7 +574,7 @@ int RenderListBox::scrollToward(const IntPoint& destination) > > void RenderListBox::autoscroll(const IntPoint&) > { >- IntPoint pos = frame().view()->windowToContents(frame().eventHandler().lastKnownMousePosition()); >+ IntPoint pos = frame().view()->deprecatedWindowToContents(frame().eventHandler().lastKnownMousePosition()); > > int endIndex = scrollToward(pos); > if (selectElement().isDisabledFormControl()) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 013a18a36bd..87fce91bf2a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,30 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >+ https://bugs.webkit.org/show_bug.cgi?id=182785 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ScrollView::windowToContents(const IntPoint&) currently does not take into account the scroll >+ position of the ScrollView when it delegatesScrolling(), which is not always correct. In >+ order to implement hit testing for iOS frame in bug 173833, this should be fixed. However, >+ that is a bit difficult because windowToContents and similar functions are used everywhere >+ in the code. This patch just renames the function to deprecateWindowToContents so that we can >+ smoothly transition existing code to newer versions in the future. >+ >+ * WebProcess/Plugins/PDF/PDFPlugin.mm: >+ (WebKit::PDFPlugin::handleContextMenuEvent): >+ * WebProcess/WebCoreSupport/WebChromeClient.cpp: >+ (WebKit::WebChromeClient::showPlaybackTargetPicker): >+ * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: >+ (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture): >+ * WebProcess/WebPage/WebPage.cpp: >+ (WebKit::handleContextMenuEvent): >+ * WebProcess/WebPage/mac/WebPageMac.mm: >+ (WebKit::WebPage::performDictionaryLookupAtLocation): >+ (WebKit::WebPage::shouldDelayWindowOrderingEvent): >+ (WebKit::WebPage::acceptsFirstMouse): >+ > 2018-05-08 Sihui Liu <sihui_liu@apple.com> > > Adopt new async _savecookies SPI for keeping networking process active during flushing cookies >diff --git a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >index c1ac4d58e4f..e940b626c39 100644 >--- a/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >+++ b/Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm >@@ -1579,7 +1579,7 @@ bool PDFPlugin::showContextMenuAtPoint(const IntPoint& point) > bool PDFPlugin::handleContextMenuEvent(const WebMouseEvent& event) > { > FrameView* frameView = webFrame()->coreFrame()->view(); >- IntPoint point = frameView->contentsToScreen(IntRect(frameView->windowToContents(event.position()), IntSize())).location(); >+ IntPoint point = frameView->contentsToScreen(IntRect(frameView->deprecatedWindowToContents(event.position()), IntSize())).location(); > > if (NSMenu *nsMenu = [m_pdfLayerController menuForEvent:nsEventForWebMouseEvent(event)]) { > Vector<PDFContextMenuItem> items; >diff --git a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >index dfc2a37662d..70625abb3df 100644 >--- a/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >+++ b/Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp >@@ -1243,7 +1243,7 @@ void WebChromeClient::removePlaybackTargetPickerClient(uint64_t contextId) > void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const IntPoint& position, bool isVideo) > { > FrameView* frameView = m_page.mainFrame()->view(); >- FloatRect rect(frameView->contentsToRootView(frameView->windowToContents(position)), FloatSize()); >+ FloatRect rect(frameView->contentsToRootView(frameView->deprecatedWindowToContents(position)), FloatSize()); > m_page.send(Messages::WebPageProxy::ShowPlaybackTargetPicker(contextId, rect, isVideo)); > } > >diff --git a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >index 4e17a8f2bae..43823918a78 100644 >--- a/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >+++ b/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp >@@ -113,7 +113,7 @@ void ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture(F > } > #endif // PLATFORM(IOS) > >- IntPoint originInContentsSpace = m_webPage.mainFrameView()->windowToContents(roundedIntPoint(origin)); >+ IntPoint originInContentsSpace = m_webPage.mainFrameView()->deprecatedWindowToContents(roundedIntPoint(origin)); > HitTestResult hitTestResult = HitTestResult(originInContentsSpace); > > m_webPage.mainFrameView()->renderView()->hitTest(HitTestRequest(), hitTestResult); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index fdd2056c2db..1fdcde8b1e2 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -2294,7 +2294,7 @@ static bool isContextClick(const PlatformMouseEvent& event) > > static bool handleContextMenuEvent(const PlatformMouseEvent& platformMouseEvent, WebPage* page) > { >- IntPoint point = page->corePage()->mainFrame().view()->windowToContents(platformMouseEvent.position()); >+ IntPoint point = page->corePage()->mainFrame().view()->deprecatedWindowToContents(platformMouseEvent.position()); > HitTestResult result = page->corePage()->mainFrame().eventHandler().hitTestResultAtPoint(point); > > Frame* frame = &page->corePage()->mainFrame(); >diff --git a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >index 4aa316b6d6e..51333ceca20 100644 >--- a/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >+++ b/Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm >@@ -398,7 +398,7 @@ void WebPage::performDictionaryLookupAtLocation(const FloatPoint& floatPoint) > } > > // Find the frame the point is over. >- HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(roundedIntPoint(floatPoint))); >+ HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->deprecatedWindowToContents(roundedIntPoint(floatPoint))); > NSDictionary *options = nil; > auto range = DictionaryLookup::rangeAtHitTestResult(result, &options); > if (!range) >@@ -734,7 +734,7 @@ void WebPage::shouldDelayWindowOrderingEvent(const WebKit::WebMouseEvent& event, > Frame& frame = m_page->focusController().focusedOrMainFrame(); > > #if ENABLE(DRAG_SUPPORT) >- HitTestResult hitResult = frame.eventHandler().hitTestResultAtPoint(frame.view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active); >+ HitTestResult hitResult = frame.eventHandler().hitTestResultAtPoint(frame.view()->deprecatedWindowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active); > if (hitResult.isSelected()) > result = frame.eventHandler().eventMayStartDrag(platform(event)); > else >@@ -754,7 +754,7 @@ void WebPage::acceptsFirstMouse(int eventNumber, const WebKit::WebMouseEvent& ev > > Frame& frame = m_page->focusController().focusedOrMainFrame(); > >- HitTestResult hitResult = frame.eventHandler().hitTestResultAtPoint(frame.view()->windowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active); >+ HitTestResult hitResult = frame.eventHandler().hitTestResultAtPoint(frame.view()->deprecatedWindowToContents(event.position()), HitTestRequest::ReadOnly | HitTestRequest::Active); > frame.eventHandler().setActivationEventNumber(eventNumber); > #if ENABLE(DRAG_SUPPORT) > if (hitResult.isSelected()) >@@ -1093,7 +1093,7 @@ std::tuple<RefPtr<WebCore::Range>, NSDictionary *> WebPage::lookupTextAtLocation > return { nullptr, nil }; > > auto point = roundedIntPoint(locationInViewCoordinates); >- auto result = mainFrame.eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->windowToContents(point)); >+ auto result = mainFrame.eventHandler().hitTestResultAtPoint(m_page->mainFrame().view()->deprecatedWindowToContents(point)); > NSDictionary *options = nil; > auto range = DictionaryLookup::rangeAtHitTestResult(result, &options); > return { WTFMove(range), WTFMove(options) }; >diff --git a/Source/WebKitLegacy/ios/ChangeLog b/Source/WebKitLegacy/ios/ChangeLog >index 1200f221101..4b8605281eb 100644 >--- a/Source/WebKitLegacy/ios/ChangeLog >+++ b/Source/WebKitLegacy/ios/ChangeLog >@@ -1,3 +1,20 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >+ https://bugs.webkit.org/show_bug.cgi?id=182785 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ScrollView::windowToContents(const IntPoint&) currently does not take into account the scroll >+ position of the ScrollView when it delegatesScrolling(), which is not always correct. In >+ order to implement hit testing for iOS frame in bug 173833, this should be fixed. However, >+ that is a bit difficult because windowToContents and similar functions are used everywhere >+ in the code. This patch just renames the function to deprecateWindowToContents so that we can >+ smoothly transition existing code to newer versions in the future. >+ >+ * WebCoreSupport/WebFrameIOS.mm: >+ (-[WebFrame elementRectAtPoint:]): >+ > 2018-05-02 Eric Carlson <eric.carlson@apple.com> > > [iOS] Provide audio route information when invoking AirPlay picker >diff --git a/Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm b/Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm >index 960eda8194a..5acc2a1800e 100644 >--- a/Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm >+++ b/Source/WebKitLegacy/ios/WebCoreSupport/WebFrameIOS.mm >@@ -940,7 +940,7 @@ static VisiblePosition SimpleSmartExtendEnd(const VisiblePosition& start, const > - (CGRect)elementRectAtPoint:(CGPoint)point > { > Frame *frame = [self coreFrame]; >- IntPoint adjustedPoint = frame->view()->windowToContents(roundedIntPoint(point)); >+ IntPoint adjustedPoint = frame->view()->deprecatedWindowToContents(roundedIntPoint(point)); > HitTestResult result = frame->eventHandler().hitTestResultAtPoint(adjustedPoint, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AllowChildFrameContent); > Node* hitNode = result.innerNode(); > if (!hitNode || !hitNode->renderer()) >diff --git a/Source/WebKitLegacy/win/ChangeLog b/Source/WebKitLegacy/win/ChangeLog >index f2cce84875b..974adff63f0 100644 >--- a/Source/WebKitLegacy/win/ChangeLog >+++ b/Source/WebKitLegacy/win/ChangeLog >@@ -1,3 +1,22 @@ >+2018-02-16 Frederic Wang <fwang@igalia.com> >+ >+ Bug 182785 - Deprecate ScrollView::windowToContents(const IntPoint&) >+ https://bugs.webkit.org/show_bug.cgi?id=182785 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ ScrollView::windowToContents(const IntPoint&) currently does not take into account the scroll >+ position of the ScrollView when it delegatesScrolling(), which is not always correct. In >+ order to implement hit testing for iOS frame in bug 173833, this should be fixed. However, >+ that is a bit difficult because windowToContents and similar functions are used everywhere >+ in the code. This patch just renames the function to deprecateWindowToContents so that we can >+ smoothly transition existing code to newer versions in the future. >+ >+ * WebCoreSupport/WebDragClient.cpp: >+ (WebDragClient::dragSourceActionMaskForPoint): >+ * WebView.cpp: >+ (WebView::handleContextMenuEvent): >+ > 2018-05-07 Daniel Bates <dabates@apple.com> > > Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty() >diff --git a/Source/WebKitLegacy/win/WebCoreSupport/WebDragClient.cpp b/Source/WebKitLegacy/win/WebCoreSupport/WebDragClient.cpp >index f60091faa45..25951a97579 100644 >--- a/Source/WebKitLegacy/win/WebCoreSupport/WebDragClient.cpp >+++ b/Source/WebKitLegacy/win/WebCoreSupport/WebDragClient.cpp >@@ -78,7 +78,7 @@ DragSourceAction WebDragClient::dragSourceActionMaskForPoint(const IntPoint& win > { > COMPtr<IWebUIDelegate> delegateRef = 0; > WebDragSourceAction action = WebDragSourceActionAny; >- POINT localpt = core(m_webView)->mainFrame().view()->windowToContents(windowPoint); >+ POINT localpt = core(m_webView)->mainFrame().view()->deprecatedWindowToContents(windowPoint); > if (SUCCEEDED(m_webView->uiDelegate(&delegateRef))) > delegateRef->dragSourceActionMaskForPoint(m_webView, &localpt, &action); > return (DragSourceAction)action; >diff --git a/Source/WebKitLegacy/win/WebView.cpp b/Source/WebKitLegacy/win/WebView.cpp >index d81c831fe2e..3842515609a 100644 >--- a/Source/WebKitLegacy/win/WebView.cpp >+++ b/Source/WebKitLegacy/win/WebView.cpp >@@ -1657,7 +1657,7 @@ bool WebView::handleContextMenuEvent(WPARAM wParam, LPARAM lParam) > > m_page->contextMenuController().clearContextMenu(); > >- IntPoint documentPoint(m_page->mainFrame().view()->windowToContents(logicalCoords)); >+ IntPoint documentPoint(m_page->mainFrame().view()->deprecatedWindowToContents(logicalCoords)); > HitTestResult result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(documentPoint); > Frame* targetFrame = result.innerNonSharedNode() ? result.innerNonSharedNode()->document().frame() : &m_page->focusController().focusedOrMainFrame(); > >-- >2.17.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 182785
:
333781
|
333787
|
333890
|
333891
|
333896
|
333900
|
334024
|
340069
|
344764
|
348910