Changeset 245062 in webkit
- Timestamp:
- May 8, 2019 12:36:33 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r245059 r245062 1 2019-05-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Add a quirk to synthesize mouse events when modifying the selection 4 https://bugs.webkit.org/show_bug.cgi?id=197683 5 <rdar://problem/48003980> 6 7 Reviewed by Tim Horton. 8 9 Adds a new layout test to enable the site-specific quirk and verify that mouse events are dispatched when 10 changing selection, both via the callout menu and by moving the selection grabber using gestures. 11 12 * editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk-expected.txt: Added. 13 * editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html: Added. 14 * resources/ui-helper.js: 15 (window.UIHelper.waitForMenuToHide.return.new.Promise): 16 (window.UIHelper.waitForMenuToHide): 17 18 Introduce a new helper method to wait for the menu to hide (on iOS, this refers to the callout menu). 19 1 20 2019-05-07 Ryan Haddad <ryanhaddad@apple.com> 2 21 -
trunk/LayoutTests/resources/ui-helper.js
r244370 r245062 828 828 } 829 829 830 static waitForMenuToHide() 831 { 832 return new Promise(resolve => { 833 testRunner.runUIScript(` 834 (function() { 835 if (uiController.isShowingMenu) 836 uiController.didHideMenuCallback = () => uiController.uiScriptComplete(); 837 else 838 uiController.uiScriptComplete(); 839 })()`, resolve); 840 }); 841 } 842 830 843 static isShowingMenu() 831 844 { -
trunk/Source/WebCore/ChangeLog
r245058 r245062 1 2019-05-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Add a quirk to synthesize mouse events when modifying the selection 4 https://bugs.webkit.org/show_bug.cgi?id=197683 5 <rdar://problem/48003980> 6 7 Reviewed by Tim Horton. 8 9 See WebKit ChangeLog for more details. 10 11 Test: editing/selection/ios/dispatch-mouse-events-when-modifying-selection-quirk.html 12 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::handleMousePressEvent): 15 (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const): 16 17 Add some platform hooks to prevent mousemove events from updating the selection on iOS. 18 19 (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const): 20 21 Add some platform hooks to prevent drag and drop from kicking in when sending synthetic mousemove events to the 22 page on iOS (drag and drop is instead triggered by EventHandler::tryToBeginDragAtPoint). 23 24 (WebCore::EventHandler::updateSelectionForMouseDrag): 25 * page/EventHandler.h: 26 * page/Quirks.cpp: 27 (WebCore::Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const): 28 * page/Quirks.h: 29 30 Add the new site-specific quirk. 31 32 * page/Settings.yaml: 33 * page/ios/EventHandlerIOS.mm: 34 (WebCore::EventHandler::tryToBeginDragAtPoint): 35 (WebCore::EventHandler::supportsSelectionUpdatesOnMouseDrag const): 36 (WebCore::EventHandler::shouldAllowMouseDownToStartDrag const): 37 * testing/InternalSettings.cpp: 38 (WebCore::InternalSettings::Backup::Backup): 39 (WebCore::InternalSettings::Backup::restoreTo): 40 (WebCore::InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection): 41 * testing/InternalSettings.h: 42 * testing/InternalSettings.idl: 43 44 Add an internal settings hook to opt into this quirk, for use in layout tests. 45 1 46 2019-05-08 Simon Fraser <simon.fraser@apple.com> 2 47 -
trunk/Source/WebCore/page/EventHandler.cpp
r244440 r245062 777 777 // Single mouse down on links or images can always trigger drag-n-drop. 778 778 bool isMouseDownOnLinkOrImage = event.isOverLink() || event.hitTestResult().image(); 779 m_mouseDownMayStartDrag = singleClick && (!event.event().shiftKey() || isMouseDownOnLinkOrImage) ;779 m_mouseDownMayStartDrag = singleClick && (!event.event().shiftKey() || isMouseDownOnLinkOrImage) && shouldAllowMouseDownToStartDrag(); 780 780 #endif 781 781 … … 848 848 849 849 #if ENABLE(DRAG_SUPPORT) 850 851 #if !PLATFORM(IOS_FAMILY) 852 853 bool EventHandler::supportsSelectionUpdatesOnMouseDrag() const 854 { 855 return true; 856 } 857 858 bool EventHandler::shouldAllowMouseDownToStartDrag() const 859 { 860 return true; 861 } 862 863 #endif 864 850 865 bool EventHandler::handleMouseDraggedEvent(const MouseEventWithHitTestResults& event, CheckDragHysteresis checkDragHysteresis) 851 866 { … … 927 942 void EventHandler::updateSelectionForMouseDrag() 928 943 { 944 if (!supportsSelectionUpdatesOnMouseDrag()) 945 return; 946 929 947 FrameView* view = m_frame.view(); 930 948 if (!view) … … 942 960 void EventHandler::updateSelectionForMouseDrag(const HitTestResult& hitTestResult) 943 961 { 962 if (!supportsSelectionUpdatesOnMouseDrag()) 963 return; 964 944 965 if (!m_mouseDownMayStartSelect) 945 966 return; -
trunk/Source/WebCore/page/EventHandler.h
r243043 r245062 366 366 #if ENABLE(DRAG_SUPPORT) 367 367 bool handleMouseDraggedEvent(const MouseEventWithHitTestResults&, CheckDragHysteresis = ShouldCheckDragHysteresis); 368 bool shouldAllowMouseDownToStartDrag() const; 368 369 #endif 369 370 … … 458 459 #if ENABLE(DRAG_SUPPORT) 459 460 DragSourceAction updateDragSourceActionsAllowed() const; 461 bool supportsSelectionUpdatesOnMouseDrag() const; 460 462 #endif 461 463 … … 617 619 bool m_isHandlingWheelEvent { false }; 618 620 621 #if PLATFORM(IOS_FAMILY) 622 bool m_shouldAllowMouseDownToStartDrag { false }; 623 #endif 624 619 625 #if ENABLE(CURSOR_VISIBILITY) 620 626 Timer m_autoHideCursorTimer; -
trunk/Source/WebCore/page/Quirks.cpp
r245005 r245062 238 238 #endif 239 239 240 bool Quirks::shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const 241 { 242 if (m_document->settings().shouldDispatchSyntheticMouseEventsWhenModifyingSelection()) 243 return true; 244 245 if (!needsQuirks()) 246 return false; 247 248 auto host = m_document->topDocument().url().host(); 249 if (equalLettersIgnoringASCIICase(host, "medium.com") || host.endsWithIgnoringASCIICase(".medium.com")) 250 return true; 251 252 if (equalLettersIgnoringASCIICase(host, "weebly.com") || host.endsWithIgnoringASCIICase(".weebly.com")) 253 return true; 254 255 return false; 256 } 257 240 258 bool Quirks::shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const 241 259 { -
trunk/Source/WebCore/page/Quirks.h
r244944 r245062 53 53 bool needsInputModeNoneImplicitly(const HTMLElement&) const; 54 54 55 WEBCORE_EXPORT bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const; 55 56 WEBCORE_EXPORT bool shouldSuppressAutocorrectionAndAutocaptializationInHiddenEditableAreas() const; 56 57 WEBCORE_EXPORT bool isTouchBarUpdateSupressedForHiddenContentEditable() const; -
trunk/Source/WebCore/page/Settings.yaml
r244869 r245062 835 835 initial: false 836 836 837 shouldDispatchSyntheticMouseEventsWhenModifyingSelection: 838 initial: false 839 837 840 # Deprecated 838 841 -
trunk/Source/WebCore/page/ios/EventHandlerIOS.mm
r244588 r245062 672 672 return false; 673 673 674 SetForScope<bool> shouldAllowMouseDownToStartDrag { m_shouldAllowMouseDownToStartDrag, true }; 675 674 676 document->updateLayoutIgnorePendingStylesheets(); 675 677 … … 700 702 } 701 703 702 #endif 704 bool EventHandler::supportsSelectionUpdatesOnMouseDrag() const 705 { 706 return false; 707 } 708 709 bool EventHandler::shouldAllowMouseDownToStartDrag() const 710 { 711 return m_shouldAllowMouseDownToStartDrag; 712 } 713 714 #endif // ENABLE(DRAG_SUPPORT) 703 715 704 716 } -
trunk/Source/WebCore/testing/InternalSettings.cpp
r244766 r245062 101 101 , m_inputEventsEnabled(settings.inputEventsEnabled()) 102 102 , m_incompleteImageBorderEnabled(settings.incompleteImageBorderEnabled()) 103 , m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection(settings.shouldDispatchSyntheticMouseEventsWhenModifyingSelection()) 103 104 , m_shouldDeactivateAudioSession(PlatformMediaSessionManager::shouldDeactivateAudioSession()) 104 105 , m_userInterfaceDirectionPolicy(settings.userInterfaceDirectionPolicy()) … … 208 209 settings.setFrameFlattening(m_frameFlattening); 209 210 settings.setIncompleteImageBorderEnabled(m_incompleteImageBorderEnabled); 211 settings.setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection); 210 212 PlatformMediaSessionManager::setShouldDeactivateAudioSession(m_shouldDeactivateAudioSession); 211 213 … … 927 929 } 928 930 931 ExceptionOr<void> InternalSettings::setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(bool shouldDispatch) 932 { 933 if (!m_page) 934 return Exception { InvalidAccessError }; 935 settings().setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(shouldDispatch); 936 return { }; 937 } 938 929 939 static InternalSettings::ForcedAccessibilityValue settingsToInternalSettingsValue(Settings::ForcedAccessibilityValue value) 930 940 { -
trunk/Source/WebCore/testing/InternalSettings.h
r244766 r245062 104 104 ExceptionOr<void> setCustomPasteboardDataEnabled(bool); 105 105 ExceptionOr<void> setIncompleteImageBorderEnabled(bool); 106 ExceptionOr<void> setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(bool); 106 107 107 108 using FrameFlatteningValue = FrameFlattening; … … 199 200 bool m_inputEventsEnabled; 200 201 bool m_incompleteImageBorderEnabled; 202 bool m_shouldDispatchSyntheticMouseEventsWhenModifyingSelection; 201 203 bool m_shouldDeactivateAudioSession; 202 204 UserInterfaceDirectionPolicy m_userInterfaceDirectionPolicy; -
trunk/Source/WebCore/testing/InternalSettings.idl
r244682 r245062 89 89 [MayThrowException] void setFrameFlattening(FrameFlatteningValue frameFlattening); 90 90 [MayThrowException] void setIncompleteImageBorderEnabled(boolean enabled); 91 [MayThrowException] void setShouldDispatchSyntheticMouseEventsWhenModifyingSelection(boolean shouldDispatch); 91 92 92 93 // RuntimeEnabledFeatures. -
trunk/Source/WebKit/ChangeLog
r245055 r245062 1 2019-05-08 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Add a quirk to synthesize mouse events when modifying the selection 4 https://bugs.webkit.org/show_bug.cgi?id=197683 5 <rdar://problem/48003980> 6 7 Reviewed by Tim Horton. 8 9 Introduces support for dispatching synthetic mouse events when modifying the selection on some websites. See 10 below for more details. 11 12 * UIProcess/WebPageProxy.cpp: 13 (WebKit::WebPageProxy::selectAll): 14 * UIProcess/WebPageProxy.h: 15 16 Instead of executing a "SelectAll" editing command using the generic WebPage::executeEditCommand method, 17 introduce a separate method for selectAll that executes the "SelectAll" edit command and then does some 18 platform-specific work. See platformDidSelectAll. 19 20 * UIProcess/ios/WKContentViewInteraction.mm: 21 (-[WKContentView selectAllForWebView:]): 22 * WebProcess/WebPage/WebPage.cpp: 23 (WebKit::WebPage::selectAll): 24 (WebKit::WebPage::shouldDispatchSyntheticMouseEventsWhenModifyingSelection const): 25 26 Add a helper method to determine whether the quirk should be enabled. 27 28 (WebKit::WebPage::platformDidSelectAll): 29 * WebProcess/WebPage/WebPage.h: 30 * WebProcess/WebPage/WebPage.messages.in: 31 * WebProcess/WebPage/ios/WebPageIOS.mm: 32 (WebKit::elementRectInRootViewCoordinates): 33 34 Move this function closer to the top of the file so that it can be used in 35 dispatchSyntheticMouseEventsForSelectionGesture. 36 37 (WebKit::WebPage::clearSelection): 38 (WebKit::WebPage::dispatchSyntheticMouseEventsForSelectionGesture): 39 40 Add a helper method to dispatch a synthetic mouse event for a given selection gesture type. Used in several 41 places in WebPageIOS to synthesize and dispatch mouse events during selection. 42 43 (WebKit::WebPage::updateSelectionWithTouches): 44 45 When changing the selection with selection handles, fake mousedown when the user first touches down on the 46 selection handle; mousemove as the user is moving the handle around; and finally, mouseup when the user lets go. 47 48 (WebKit::WebPage::extendSelection): 49 (WebKit::WebPage::platformDidSelectAll): 50 51 When tapping "Select All" and/or "Select" in the callout menu, fake a mousedown at the selection start, then a 52 mousemove at selection end, and finally, a mouseup at selection end. 53 54 (WebKit::WebPage::getFocusedElementInformation): 55 1 56 2019-05-08 Alexander Mikhaylenko <exalm7659@gmail.com> 2 57 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r244970 r245062 2015 2015 } 2016 2016 2017 void WebPageProxy::selectAll() 2018 { 2019 if (!hasRunningProcess()) 2020 return; 2021 2022 m_process->send(Messages::WebPage::SelectAll(), m_pageID); 2023 } 2024 2017 2025 void WebPageProxy::executeEditCommand(const String& commandName, const String& argument, WTF::Function<void(CallbackBase::Error)>&& callbackFunction) 2018 2026 { -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r244897 r245062 596 596 void addMIMETypeWithCustomContentProvider(const String& mimeType); 597 597 598 void selectAll(); 598 599 void executeEditCommand(const String& commandName, const String& argument = String()); 599 600 void validateCommand(const String& commandName, WTF::Function<void (const String&, bool, int32_t, CallbackBase::Error)>&&); -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r245022 r245062 3080 3080 { 3081 3081 [_textSelectionAssistant selectAll:sender]; 3082 _page-> executeEditCommand("selectAll"_s);3082 _page->selectAll(); 3083 3083 } 3084 3084 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r245048 r245062 1102 1102 } 1103 1103 1104 void WebPage::selectAll() 1105 { 1106 executeEditingCommand("SelectAll"_s, { }); 1107 platformDidSelectAll(); 1108 } 1109 1110 bool WebPage::shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const 1111 { 1112 auto* document = m_page->mainFrame().document(); 1113 return document && document->quirks().shouldDispatchSyntheticMouseEventsWhenModifyingSelection(); 1114 } 1115 1116 #if !PLATFORM(IOS_FAMILY) 1117 1118 void WebPage::platformDidSelectAll() 1119 { 1120 } 1121 1122 #endif // !PLATFORM(IOS_FAMILY) 1123 1104 1124 void WebPage::updateEditorStateAfterLayoutIfEditabilityChanged() 1105 1125 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r245048 r245062 600 600 void viewportPropertiesDidChange(const WebCore::ViewportArguments&); 601 601 void executeEditCommandWithCallback(const String&, const String& argument, CallbackID); 602 void selectAll(); 602 603 603 604 void textInputContextsInRect(WebCore::FloatRect, CompletionHandler<void(const Vector<WebKit::TextInputContext>&)>&&); … … 1229 1230 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement); 1230 1231 RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement); 1232 void dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch, const WebCore::IntPoint&); 1231 1233 1232 1234 void sendPositionInformation(InteractionInformationAtPosition&&); … … 1467 1469 #endif 1468 1470 1471 bool shouldDispatchSyntheticMouseEventsWhenModifyingSelection() const; 1472 void platformDidSelectAll(); 1473 1469 1474 #if ENABLE(CONTEXT_MENUS) 1470 1475 void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&); -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r244897 r245062 203 203 ForceRepaint(WebKit::CallbackID callbackID) 204 204 205 SelectAll() 205 206 ScheduleFullEditorStateUpdate() 206 207 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r244998 r245062 1480 1480 } 1481 1481 1482 void WebPage::clearSelection(){ 1482 static IntRect elementRectInRootViewCoordinates(const Element& element) 1483 { 1484 auto* frame = element.document().frame(); 1485 if (!frame) 1486 return { }; 1487 1488 auto* view = frame->view(); 1489 if (!view) 1490 return { }; 1491 1492 auto* renderer = element.renderer(); 1493 if (!renderer) 1494 return { }; 1495 1496 return view->contentsToRootView(renderer->absoluteBoundingBoxRect()); 1497 } 1498 1499 void WebPage::clearSelection() 1500 { 1483 1501 m_startingGestureRange = nullptr; 1484 1502 m_currentBlockSelection = nullptr; 1485 1503 m_page->focusController().focusedOrMainFrame().selection().clear(); 1504 } 1505 1506 void WebPage::dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch touch, const IntPoint& point) 1507 { 1508 auto frame = makeRef(m_page->focusController().focusedOrMainFrame()); 1509 if (!frame->selection().selection().isContentEditable()) 1510 return; 1511 1512 IntRect focusedElementRect; 1513 if (m_focusedElement) 1514 focusedElementRect = elementRectInRootViewCoordinates(*m_focusedElement); 1515 1516 if (focusedElementRect.isEmpty()) 1517 return; 1518 1519 auto adjustedPoint = point.constrainedBetween(focusedElementRect.minXMinYCorner(), focusedElementRect.maxXMaxYCorner()); 1520 auto& eventHandler = m_page->mainFrame().eventHandler(); 1521 switch (touch) { 1522 case SelectionTouch::Started: 1523 eventHandler.handleMousePressEvent({ adjustedPoint, adjustedPoint, LeftButton, PlatformEvent::MousePressed, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, NoTap }); 1524 break; 1525 case SelectionTouch::Moved: 1526 eventHandler.dispatchSyntheticMouseMove({ adjustedPoint, adjustedPoint, LeftButton, PlatformEvent::MouseMoved, 0, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, NoTap }); 1527 break; 1528 case SelectionTouch::Ended: 1529 case SelectionTouch::EndedMovingForward: 1530 case SelectionTouch::EndedMovingBackward: 1531 case SelectionTouch::EndedNotMoving: 1532 eventHandler.handleMouseReleaseEvent({ adjustedPoint, adjustedPoint, LeftButton, PlatformEvent::MouseReleased, 1, false, false, false, false, WallTime::now(), WebCore::ForceAtClick, NoTap }); 1533 break; 1534 } 1486 1535 } 1487 1536 … … 1500 1549 SelectionFlags flags = None; 1501 1550 1502 switch (static_cast<SelectionTouch>(touches)) { 1551 auto selectionTouch = static_cast<SelectionTouch>(touches); 1552 if (shouldDispatchSyntheticMouseEventsWhenModifyingSelection()) 1553 dispatchSyntheticMouseEventsForSelectionGesture(selectionTouch, point); 1554 1555 switch (selectionTouch) { 1503 1556 case SelectionTouch::Started: 1504 1557 case SelectionTouch::EndedNotMoving: … … 1558 1611 1559 1612 VisiblePosition position = frame.selection().selection().start(); 1560 frame.selection().setSelectedRange(wordRangeFromPosition(position).get(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered); 1613 auto wordRange = wordRangeFromPosition(position); 1614 if (!wordRange) 1615 return; 1616 1617 IntPoint endLocationForSyntheticMouseEvents; 1618 bool shouldDispatchMouseEvents = shouldDispatchSyntheticMouseEventsWhenModifyingSelection(); 1619 if (shouldDispatchMouseEvents) { 1620 auto startLocationForSyntheticMouseEvents = frame.view()->contentsToRootView(VisiblePosition(wordRange->startPosition()).absoluteCaretBounds()).center(); 1621 endLocationForSyntheticMouseEvents = frame.view()->contentsToRootView(VisiblePosition(wordRange->endPosition()).absoluteCaretBounds()).center(); 1622 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Started, startLocationForSyntheticMouseEvents); 1623 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Moved, endLocationForSyntheticMouseEvents); 1624 } 1625 1626 frame.selection().setSelectedRange(wordRange.get(), position.affinity(), WebCore::FrameSelection::ShouldCloseTyping::Yes, UserTriggered); 1627 1628 if (shouldDispatchMouseEvents) 1629 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Ended, endLocationForSyntheticMouseEvents); 1630 } 1631 1632 void WebPage::platformDidSelectAll() 1633 { 1634 if (!shouldDispatchSyntheticMouseEventsWhenModifyingSelection()) 1635 return; 1636 1637 auto frame = makeRef(m_page->focusController().focusedOrMainFrame()); 1638 auto startCaretRect = frame->view()->contentsToRootView(VisiblePosition(frame->selection().selection().start()).absoluteCaretBounds()); 1639 auto endCaretRect = frame->view()->contentsToRootView(VisiblePosition(frame->selection().selection().end()).absoluteCaretBounds()); 1640 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Started, startCaretRect.center()); 1641 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Moved, endCaretRect.center()); 1642 dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch::Ended, endCaretRect.center()); 1561 1643 } 1562 1644 … … 2585 2667 } 2586 2668 2587 static IntRect elementRectInRootViewCoordinates(const Node& node, const Frame& frame)2588 {2589 auto* view = frame.view();2590 if (!view)2591 return { };2592 2593 auto* renderer = node.renderer();2594 if (!renderer)2595 return { };2596 2597 return view->contentsToRootView(renderer->absoluteBoundingBoxRect());2598 }2599 2600 2669 void WebPage::getFocusedElementInformation(FocusedElementInformation& information) 2601 2670 { … … 2605 2674 2606 2675 if (auto* renderer = m_focusedElement->renderer()) { 2607 auto& elementFrame = m_page->focusController().focusedOrMainFrame(); 2608 information.elementRect = elementRectInRootViewCoordinates(*m_focusedElement, elementFrame); 2676 information.elementRect = elementRectInRootViewCoordinates(*m_focusedElement); 2609 2677 information.nodeFontSize = renderer->style().fontDescription().computedSize(); 2610 2678 … … 2622 2690 information.allowsUserScalingIgnoringAlwaysScalable = m_viewportConfiguration.allowsUserScalingIgnoringAlwaysScalable(); 2623 2691 if (auto* nextElement = nextAssistableElement(m_focusedElement.get(), *m_page, true)) { 2624 if (auto* frame = nextElement->document().frame()) 2625 information.nextNodeRect = elementRectInRootViewCoordinates(*nextElement, *frame); 2692 information.nextNodeRect = elementRectInRootViewCoordinates(*nextElement); 2626 2693 information.hasNextNode = true; 2627 2694 } 2628 2695 if (auto* previousElement = nextAssistableElement(m_focusedElement.get(), *m_page, false)) { 2629 if (auto* frame = previousElement->document().frame()) 2630 information.previousNodeRect = elementRectInRootViewCoordinates(*previousElement, *frame); 2696 information.previousNodeRect = elementRectInRootViewCoordinates(*previousElement); 2631 2697 information.hasPreviousNode = true; 2632 2698 }
Note: See TracChangeset
for help on using the changeset viewer.