Changeset 245716 in webkit
- Timestamp:
- May 23, 2019, 2:17:57 PM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 20 edited
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/accessibility/AccessibilityObject.cpp (modified) (1 diff)
-
WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (1 diff)
-
WebCore/dom/Document.cpp (modified) (5 diffs)
-
WebCore/dom/Document.h (modified) (3 diffs)
-
WebCore/dom/TreeScope.cpp (modified) (2 diffs)
-
WebCore/editing/FrameSelection.cpp (modified) (1 diff)
-
WebCore/html/HTMLPlugInElement.cpp (modified) (1 diff)
-
WebCore/html/MediaElementSession.cpp (modified) (2 diffs)
-
WebCore/page/DragController.cpp (modified) (1 diff)
-
WebCore/page/EventHandler.cpp (modified) (13 diffs)
-
WebCore/page/FrameViewLayoutContext.cpp (modified) (1 diff)
-
WebCore/rendering/RenderView.cpp (modified) (3 diffs)
-
WebCore/rendering/RenderView.h (modified) (3 diffs)
-
WebCore/rendering/RenderWidget.cpp (modified) (2 diffs)
-
WebCore/testing/Internals.cpp (modified) (1 diff)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp (modified) (1 diff)
-
WebKit/WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r245715 r245716 1 2019-05-23 Zalan Bujtas <zalan@apple.com> 2 3 [Hittest] Move hittesting from RenderView to Document 4 https://bugs.webkit.org/show_bug.cgi?id=198192 5 <rdar://problem/51077762> 6 7 Reviewed by Antti Koivisto. 8 9 RenderView is not refcounted and may be destroyed in updateLayout(), so enter hit-testing from Document. 10 11 * accessibility/AccessibilityObject.cpp: 12 (WebCore::AccessibilityObject::press): 13 * accessibility/AccessibilityRenderObject.cpp: 14 (WebCore::AccessibilityRenderObject::visiblePositionForPoint const): 15 * dom/Document.cpp: 16 (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): 17 (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): 18 (WebCore::Document::scheduleStyleRecalc): 19 (WebCore::Document::prepareMouseEvent): 20 (WebCore::Document::hitTest): 21 * dom/Document.h: 22 (WebCore::Document::inHitTesting const): 23 * dom/TreeScope.cpp: 24 (WebCore::TreeScope::nodeFromPoint): 25 (WebCore::TreeScope::elementsFromPoint): 26 * editing/FrameSelection.cpp: 27 (WebCore::FrameSelection::contains const): 28 * html/HTMLPlugInElement.cpp: 29 (WebCore::HTMLPlugInElement::isReplacementObscured): 30 * html/MediaElementSession.cpp: 31 (WebCore::isElementMainContentForPurposesOfAutoplay): 32 * page/DragController.cpp: 33 (WebCore::elementUnderMouse): 34 * page/EventHandler.cpp: 35 (WebCore::EventHandler::handleMouseDraggedEvent): 36 (WebCore::EventHandler::eventMayStartDrag const): 37 (WebCore::EventHandler::updateSelectionForMouseDrag): 38 (WebCore::EventHandler::hitTestResultAtPoint const): 39 (WebCore::EventHandler::updateCursor): 40 (WebCore::EventHandler::isInsideScrollbar const): 41 (WebCore::EventHandler::handleWheelEvent): 42 (WebCore::EventHandler::hoverTimerFired): 43 (WebCore::EventHandler::handleDrag): 44 (WebCore::hitTestResultInFrame): 45 * page/FrameViewLayoutContext.cpp: 46 (WebCore::FrameViewLayoutContext::setNeedsLayoutAfterViewConfigurationChange): 47 * rendering/RenderView.cpp: 48 (WebCore::FrameFlatteningLayoutDisallower::FrameFlatteningLayoutDisallower): Deleted. 49 (WebCore::FrameFlatteningLayoutDisallower::~FrameFlatteningLayoutDisallower): Deleted. 50 (): Deleted. 51 (WebCore::RenderView::hitTest): Deleted. 52 * rendering/RenderView.h: 53 * rendering/RenderWidget.cpp: 54 (WebCore::RenderWidget::nodeAtPoint): 55 * testing/Internals.cpp: 56 (WebCore::Internals::nodesFromRect const): 57 1 58 2019-05-23 Youenn Fablet <youenn@apple.com> 2 59 -
trunk/Source/WebCore/accessibility/AccessibilityObject.cpp
r245565 r245716 1072 1072 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::AccessibilityHitTest); 1073 1073 HitTestResult hitTestResult(clickPoint()); 1074 document-> renderView()->hitTest(request, hitTestResult);1074 document->hitTest(request, hitTestResult); 1075 1075 if (auto* innerNode = hitTestResult.innerNode()) { 1076 1076 if (auto* shadowHost = innerNode->shadowHost()) -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r245565 r245716 2212 2212 HitTestRequest::Active); 2213 2213 HitTestResult result(ourpoint); 2214 renderView-> hitTest(request, result);2214 renderView->document().hitTest(request, result); 2215 2215 innerNode = result.innerNode(); 2216 2216 if (!innerNode) -
trunk/Source/WebCore/dom/Document.cpp
r245712 r245716 184 184 #include "ScriptState.h" 185 185 #include "ScriptedAnimationController.h" 186 #include "ScrollbarTheme.h" 186 187 #include "ScrollingCoordinator.h" 187 188 #include "SecurityOrigin.h" … … 332 333 static const Seconds maxIntervalForUserGestureForwardingAfterMediaFinishesPlaying { 1_s }; 333 334 335 struct FrameFlatteningLayoutDisallower { 336 FrameFlatteningLayoutDisallower(FrameView& frameView) 337 : m_frameView(frameView) 338 , m_disallowLayout(frameView.effectiveFrameFlattening() != FrameFlattening::Disabled) 339 { 340 if (m_disallowLayout) 341 m_frameView.startDisallowingLayout(); 342 } 343 344 ~FrameFlatteningLayoutDisallower() 345 { 346 if (m_disallowLayout) 347 m_frameView.endDisallowingLayout(); 348 } 349 350 private: 351 FrameView& m_frameView; 352 bool m_disallowLayout { false }; 353 }; 354 334 355 // DOM Level 2 says (letters added): 335 356 // … … 1787 1808 void Document::scheduleStyleRecalc() 1788 1809 { 1789 ASSERT(!m_renderView || ! m_renderView->inHitTesting());1810 ASSERT(!m_renderView || !inHitTesting()); 1790 1811 1791 1812 if (m_styleRecalcTimer.isActive() || pageCacheState() != NotInPageCache) … … 3705 3726 3706 3727 HitTestResult result(documentPoint); 3707 renderView()->hitTest(request, result);3728 hitTest(request, result); 3708 3729 3709 3730 if (!request.readOnly()) … … 8015 8036 } 8016 8037 8038 bool Document::hitTest(const HitTestRequest& request, HitTestResult& result) 8039 { 8040 return hitTest(request, result.hitTestLocation(), result); 8041 } 8042 8043 bool Document::hitTest(const HitTestRequest& request, const HitTestLocation& location, HitTestResult& result) 8044 { 8045 Ref<Document> protectedThis(*this); 8046 updateLayout(); 8047 if (!renderView()) 8048 return false; 8049 8050 #if !ASSERT_DISABLED 8051 SetForScope<bool> hitTestRestorer { m_inHitTesting, true }; 8052 #endif 8053 8054 auto& frameView = renderView()->frameView(); 8055 Ref<FrameView> protector(frameView); 8056 8057 FrameFlatteningLayoutDisallower disallower(frameView); 8058 8059 bool resultLayer = renderView()->layer()->hitTest(request, location, result); 8060 8061 // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls, 8062 // so we need to test ScrollView scrollbars separately here. In case of using overlay scrollbars, the layer hit test 8063 // will always work so we need to check the ScrollView scrollbars in that case too. 8064 if (!resultLayer || ScrollbarTheme::theme().usesOverlayScrollbars()) { 8065 // FIXME: Consider if this test should be done unconditionally. 8066 if (request.allowsFrameScrollbars()) { 8067 IntPoint windowPoint = frameView.contentsToWindow(location.roundedPoint()); 8068 if (auto* frameScrollbar = frameView.scrollbarAtPoint(windowPoint)) { 8069 result.setScrollbar(frameScrollbar); 8070 return true; 8071 } 8072 } 8073 } 8074 return resultLayer; 8075 } 8076 8017 8077 ElementIdentifier Document::identifierForElement(Element& element) 8018 8078 { -
trunk/Source/WebCore/dom/Document.h
r245467 r245716 139 139 class HTMLPictureElement; 140 140 class HTMLScriptElement; 141 class HitTestLocation; 141 142 class HitTestRequest; 142 143 class HitTestResult; … … 1525 1526 void frameWasDisconnectedFromOwner(); 1526 1527 1528 WEBCORE_EXPORT bool hitTest(const HitTestRequest&, HitTestResult&); 1529 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&); 1530 #if !ASSERT_DISABLED 1531 bool inHitTesting() const { return m_inHitTesting; } 1532 #endif 1533 1527 1534 protected: 1528 1535 enum ConstructionFlags { Synthesized = 1, NonRenderedPlaceholder = 1 << 1 }; … … 2001 2008 bool m_areDeviceMotionAndOrientationUpdatesSuspended { false }; 2002 2009 bool m_userDidInteractWithPage { false }; 2010 #if !ASSERT_DISABLED 2011 bool m_inHitTesting { false }; 2012 #endif 2003 2013 2004 2014 #if ENABLE(TELEPHONE_NUMBER_DETECTION) -
trunk/Source/WebCore/dom/TreeScope.cpp
r245320 r245716 357 357 358 358 HitTestResult result(absolutePoint.value()); 359 documentScope().renderView()->hitTest(HitTestRequest(), result); 360 359 documentScope().hitTest(HitTestRequest(), result); 361 360 if (localPoint) 362 361 *localPoint = result.localPoint(); 363 364 362 return result.innerNode(); 365 363 } … … 404 402 | HitTestRequest::IncludeAllElementsUnderPoint); 405 403 HitTestResult result(absolutePoint.value()); 406 documentScope(). renderView()->hitTest(request, result);404 documentScope().hitTest(request, result); 407 405 408 406 Node* lastNode = nullptr; -
trunk/Source/WebCore/editing/FrameSelection.cpp
r239971 r245716 1880 1880 return false; 1881 1881 1882 RenderView* renderView = m_frame->contentRenderer();1883 if (! renderView)1882 auto* document = m_frame->document(); 1883 if (!document) 1884 1884 return false; 1885 1885 1886 1886 HitTestResult result(point); 1887 renderView->hitTest(HitTestRequest(), result);1887 document->hitTest(HitTestRequest(), result); 1888 1888 Node* innerNode = result.innerNode(); 1889 1889 if (!innerNode || !innerNode->renderer()) -
trunk/Source/WebCore/html/HTMLPlugInElement.cpp
r242920 r245716 474 474 ASSERT(!renderView->needsLayout()); 475 475 ASSERT(!renderView->document().needsStyleRecalc()); 476 bool hit = renderView->hitTest(request, location, result);476 bool hit = topDocument->hitTest(request, location, result); 477 477 if (!hit || result.innerNode() != &pluginRenderer.frameOwnerElement()) 478 478 return true; 479 479 480 480 location = LayoutPoint(x, y); 481 hit = renderView->hitTest(request, location, result);481 hit = topDocument->hitTest(request, location, result); 482 482 if (!hit || result.innerNode() != &pluginRenderer.frameOwnerElement()) 483 483 return true; 484 484 485 485 location = LayoutPoint(x + width, y); 486 hit = renderView->hitTest(request, location, result);486 hit = topDocument->hitTest(request, location, result); 487 487 if (!hit || result.innerNode() != &pluginRenderer.frameOwnerElement()) 488 488 return true; 489 489 490 490 location = LayoutPoint(x + width, y + height); 491 hit = renderView->hitTest(request, location, result);491 hit = topDocument->hitTest(request, location, result); 492 492 if (!hit || result.innerNode() != &pluginRenderer.frameOwnerElement()) 493 493 return true; 494 494 495 495 location = LayoutPoint(x, y + height); 496 hit = renderView->hitTest(request, location, result);496 hit = topDocument->hitTest(request, location, result); 497 497 if (!hit || result.innerNode() != &pluginRenderer.frameOwnerElement()) 498 498 return true; -
trunk/Source/WebCore/html/MediaElementSession.cpp
r245467 r245716 855 855 return true; 856 856 857 RenderView& mainRenderView = *mainFrame.view()->renderView();858 859 857 // Hit test the area of the main frame where the element appears, to determine if the element is being obscured. 860 858 IntRect rectRelativeToView = element.clientRect(); … … 865 863 866 864 // Elements which are obscured by other elements cannot be main content. 867 mainRenderView.hitTest(request, result); 865 if (!mainFrame.document()) 866 return false; 867 mainFrame.document()->hitTest(request, result); 868 868 result.setToNonUserAgentShadowAncestor(); 869 869 RefPtr<Element> hitElement = result.targetElement(); -
trunk/Source/WebCore/page/DragController.cpp
r244056 r245716 367 367 368 368 HitTestResult result(point); 369 documentUnderMouse-> renderView()->hitTest(HitTestRequest(), result);369 documentUnderMouse->hitTest(HitTestRequest(), result); 370 370 371 371 auto* node = result.innerNode(); -
trunk/Source/WebCore/page/EventHandler.cpp
r245062 r245716 901 901 if (m_selectionInitiationState != ExtendedSelection) { 902 902 HitTestResult result(m_mouseDownPos); 903 m_frame.document()-> renderView()->hitTest(HitTestRequest(), result);903 m_frame.document()->hitTest(HitTestRequest(), result); 904 904 905 905 updateSelectionForMouseDrag(result); … … 914 914 // that its logic needs to stay in sync with handleMouseMoveEvent() and the way we setMouseDownMayStartDrag 915 915 // in handleMousePressEvent 916 RenderView* renderView = m_frame.contentRenderer();917 if (! renderView)916 auto* document = m_frame.document(); 917 if (!document) 918 918 return false; 919 919 … … 934 934 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowUserAgentShadowContent); 935 935 HitTestResult result(view->windowToContents(event.position())); 936 renderView->hitTest(request, result);936 document->hitTest(request, result); 937 937 DragState state; 938 938 Element* targetElement = result.targetElement(); … … 948 948 if (!view) 949 949 return; 950 RenderView* renderView = m_frame.contentRenderer();951 if (! renderView)950 auto* document = m_frame.document(); 951 if (!document) 952 952 return; 953 953 954 954 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::Move | HitTestRequest::DisallowUserAgentShadowContent); 955 955 HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); 956 renderView->hitTest(request, result);956 document->hitTest(request, result); 957 957 updateSelectionForMouseDrag(result); 958 958 } … … 1199 1199 1200 1200 HitTestResult result(point, nonNegativePaddingHeight, nonNegativePaddingWidth, nonNegativePaddingHeight, nonNegativePaddingWidth); 1201 RenderView* renderView = m_frame.contentRenderer();1202 if (! renderView)1201 auto* document = m_frame.document(); 1202 if (!document) 1203 1203 return result; 1204 1204 1205 1205 // hitTestResultAtPoint is specifically used to hitTest into all frames, thus it always allows child frame content. 1206 1206 HitTestRequest request(hitType | HitTestRequest::AllowChildFrameContent); 1207 renderView->hitTest(request, result);1207 document->hitTest(request, result); 1208 1208 if (!request.readOnly()) 1209 1209 m_frame.document()->updateHoverActiveState(request, result.targetElement()); … … 1401 1401 return; 1402 1402 1403 RenderView* renderView = view->renderView();1404 if (! renderView)1403 auto* document = m_frame.document(); 1404 if (!document) 1405 1405 return; 1406 1406 … … 1416 1416 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::AllowFrameScrollbars); 1417 1417 HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); 1418 renderView->hitTest(request, result);1418 document->hitTest(request, result); 1419 1419 1420 1420 updateCursor(*view, result, shiftKey); … … 2665 2665 bool EventHandler::isInsideScrollbar(const IntPoint& windowPoint) const 2666 2666 { 2667 if ( RenderView* renderView = m_frame.contentRenderer()) {2667 if (auto* document = m_frame.document()) { 2668 2668 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowUserAgentShadowContent); 2669 2669 HitTestResult result(windowPoint); 2670 renderView->hitTest(request, result);2670 document->hitTest(request, result); 2671 2671 return result.scrollbar(); 2672 2672 } … … 2784 2784 bool EventHandler::handleWheelEvent(const PlatformWheelEvent& event) 2785 2785 { 2786 RenderView* renderView = m_frame.contentRenderer();2787 if (! renderView)2786 auto* document = m_frame.document(); 2787 if (!document) 2788 2788 return false; 2789 2789 … … 2807 2807 HitTestRequest request; 2808 2808 HitTestResult result(view->windowToContents(event.position())); 2809 renderView->hitTest(request, result);2809 document->hitTest(request, result); 2810 2810 2811 2811 RefPtr<Element> element = result.targetElement(); … … 3119 3119 Ref<Frame> protectedFrame(m_frame); 3120 3120 3121 if ( RenderView* renderView = m_frame.contentRenderer()) {3121 if (auto* document = m_frame.document()) { 3122 3122 if (FrameView* view = m_frame.view()) { 3123 3123 HitTestRequest request(HitTestRequest::Move | HitTestRequest::DisallowUserAgentShadowContent); 3124 3124 HitTestResult result(view->windowToContents(m_lastKnownMousePosition)); 3125 renderView->hitTest(request, result);3126 m_frame.document()->updateHoverActiveState(request, result.targetElement());3125 document->hitTest(request, result); 3126 document->updateHoverActiveState(request, result.targetElement()); 3127 3127 } 3128 3128 } … … 3683 3683 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::DisallowUserAgentShadowContent); 3684 3684 HitTestResult result(m_mouseDownPos); 3685 m_frame. contentRenderer()->hitTest(request, result);3685 m_frame.document()->hitTest(request, result); 3686 3686 if (m_frame.page()) 3687 3687 dragState().source = m_frame.page()->dragController().draggableElement(&m_frame, result.targetElement(), m_mouseDownPos, dragState()); … … 4058 4058 return result; 4059 4059 } 4060 frame-> contentRenderer()->hitTest(HitTestRequest(hitType), result);4060 frame->document()->hitTest(HitTestRequest(hitType), result); 4061 4061 return result; 4062 4062 } -
trunk/Source/WebCore/page/FrameViewLayoutContext.cpp
r244682 r245716 322 322 323 323 if (auto* renderView = this->renderView()) { 324 ASSERT(! renderView->inHitTesting());324 ASSERT(!frame().document()->inHitTesting()); 325 325 renderView->setNeedsLayout(); 326 326 scheduleLayout(); -
trunk/Source/WebCore/rendering/RenderView.cpp
r245543 r245716 50 50 #include "RenderTreeBuilder.h" 51 51 #include "RenderWidget.h" 52 #include "ScrollbarTheme.h"53 52 #include "Settings.h" 54 53 #include "StyleInheritedData.h" … … 62 61 WTF_MAKE_ISO_ALLOCATED_IMPL(RenderView); 63 62 64 struct FrameFlatteningLayoutDisallower {65 FrameFlatteningLayoutDisallower(FrameView& frameView)66 : m_frameView(frameView)67 , m_disallowLayout(frameView.effectiveFrameFlattening() != FrameFlattening::Disabled)68 {69 if (m_disallowLayout)70 m_frameView.startDisallowingLayout();71 }72 73 ~FrameFlatteningLayoutDisallower()74 {75 if (m_disallowLayout)76 m_frameView.endDisallowingLayout();77 }78 79 private:80 FrameView& m_frameView;81 bool m_disallowLayout { false };82 };83 84 63 RenderView::RenderView(Document& document, RenderStyle&& style) 85 64 : RenderBlockFlow(document, WTFMove(style)) … … 136 115 } 137 116 m_renderersNeedingLazyRepaint.clear(); 138 }139 140 bool RenderView::hitTest(const HitTestRequest& request, HitTestResult& result)141 {142 return hitTest(request, result.hitTestLocation(), result);143 }144 145 bool RenderView::hitTest(const HitTestRequest& request, const HitTestLocation& location, HitTestResult& result)146 {147 document().updateLayout();148 149 #if !ASSERT_DISABLED150 SetForScope<bool> hitTestRestorer { m_inHitTesting, true };151 #endif152 153 FrameFlatteningLayoutDisallower disallower(frameView());154 155 bool resultLayer = layer()->hitTest(request, location, result);156 157 // ScrollView scrollbars are not the same as RenderLayer scrollbars tested by RenderLayer::hitTestOverflowControls,158 // so we need to test ScrollView scrollbars separately here. In case of using overlay scrollbars, the layer hit test159 // will always work so we need to check the ScrollView scrollbars in that case too.160 if (!resultLayer || ScrollbarTheme::theme().usesOverlayScrollbars()) {161 // FIXME: Consider if this test should be done unconditionally.162 if (request.allowsFrameScrollbars()) {163 IntPoint windowPoint = frameView().contentsToWindow(location.roundedPoint());164 if (Scrollbar* frameScrollbar = frameView().scrollbarAtPoint(windowPoint)) {165 result.setScrollbar(frameScrollbar);166 return true;167 }168 }169 }170 171 return resultLayer;172 117 } 173 118 -
trunk/Source/WebCore/rendering/RenderView.h
r242936 r245716 43 43 RenderView(Document&, RenderStyle&&); 44 44 virtual ~RenderView(); 45 46 WEBCORE_EXPORT bool hitTest(const HitTestRequest&, HitTestResult&);47 bool hitTest(const HitTestRequest&, const HitTestLocation&, HitTestResult&);48 45 49 46 const char* renderName() const override { return "RenderView"; } … … 195 192 #endif 196 193 197 #if !ASSERT_DISABLED198 bool inHitTesting() const { return m_inHitTesting; }199 #endif200 201 194 protected: 202 195 void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; … … 254 247 bool m_usesFirstLineRules { false }; 255 248 bool m_usesFirstLetterRules { false }; 256 #if !ASSERT_DISABLED257 bool m_inHitTesting { false };258 #endif259 249 260 250 HashMap<RenderElement*, Vector<CachedImage*>> m_renderersWithPausedImageAnimation; -
trunk/Source/WebCore/rendering/RenderWidget.cpp
r237266 r245716 365 365 if (request.allowsChildFrameContent() && is<FrameView>(widget()) && downcast<FrameView>(*widget()).renderView()) { 366 366 FrameView& childFrameView = downcast<FrameView>(*widget()); 367 RenderView& childRoot = *childFrameView.renderView();368 367 369 368 LayoutPoint adjustedLocation = accumulatedOffset + location(); … … 373 372 HitTestResult childFrameResult(newHitTestLocation); 374 373 375 bool isInsideChildFrame = childRoot.hitTest(newHitTestRequest, newHitTestLocation, childFrameResult); 374 auto* document = childFrameView.frame().document(); 375 if (!document) 376 return false; 377 bool isInsideChildFrame = document->hitTest(newHitTestRequest, newHitTestLocation, childFrameResult); 376 378 377 379 if (request.resultIsElementList()) -
trunk/Source/WebCore/testing/Internals.cpp
r245508 r245716 2101 2101 2102 2102 HitTestResult result(point, topPadding, rightPadding, bottomPadding, leftPadding); 2103 renderView->hitTest(request, result);2103 document.hitTest(request, result); 2104 2104 const HitTestResult::NodeSet& nodeSet = result.listBasedTestResult(); 2105 2105 Vector<Ref<Node>> matches; -
trunk/Source/WebKit/ChangeLog
r245715 r245716 1 2019-05-23 Zalan Bujtas <zalan@apple.com> 2 3 [Hittest] Move hittesting from RenderView to Document 4 https://bugs.webkit.org/show_bug.cgi?id=198192 5 <rdar://problem/51077762> 6 7 Reviewed by Antti Koivisto. 8 9 * WebProcess/WebPage/ViewGestureGeometryCollector.cpp: 10 (WebKit::ViewGestureGeometryCollector::collectGeometryForSmartMagnificationGesture): 11 * WebProcess/WebPage/WebPage.cpp: 12 (WebKit::WebPage::determinePrimarySnapshottedPlugIn): 13 * WebProcess/WebPage/ios/WebPageIOS.mm: 14 (WebKit::WebPage::dynamicViewportSizeUpdate): 15 1 16 2019-05-23 Youenn Fablet <youenn@apple.com> 2 17 -
trunk/Source/WebKit/WebProcess/WebPage/ViewGestureGeometryCollector.cpp
r241224 r245716 116 116 HitTestResult hitTestResult = HitTestResult(originInContentsSpace); 117 117 118 m_webPage.mainFrame View()->renderView()->hitTest(HitTestRequest(), hitTestResult);118 m_webPage.mainFrame()->document()->hitTest(HitTestRequest(), hitTestResult); 119 119 Node* node = hitTestResult.innerNode(); 120 120 if (!node) { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r245679 r245716 5925 5925 HitTestResult hitTestResult(plugInRectRelativeToTopDocument.center()); 5926 5926 5927 if (!mainFrame View->renderView())5927 if (!mainFrame() || !mainFrame()->document()) 5928 5928 return; 5929 mainFrame View->renderView()->hitTest(request, hitTestResult);5929 mainFrame()->document()->hitTest(request, hitTestResult); 5930 5930 5931 5931 RefPtr<Element> element = hitTestResult.targetElement(); -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r245679 r245716 2986 2986 HitTestResult hitTestResult = HitTestResult(unobscuredContentRectCenter); 2987 2987 2988 if ( RenderView* mainFrameRenderView = frameView.renderView())2989 mainFrameRenderView->hitTest(HitTestRequest(), hitTestResult);2988 if (auto* document = frameView.frame().document()) 2989 document->hitTest(HitTestRequest(), hitTestResult); 2990 2990 2991 2991 if (Node* node = hitTestResult.innerNode()) {
Note:
See TracChangeset
for help on using the changeset viewer.