Changeset 247027 in webkit
- Timestamp:
- Jul 1, 2019 3:10:44 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247026 r247027 1 2019-07-01 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] REGRESSION (r246757): Unable to select non-editable text in subframes 4 https://bugs.webkit.org/show_bug.cgi?id=199366 5 <rdar://problem/52460509> 6 7 Reviewed by Tim Horton. 8 9 r246757 removed logic in selectionPositionInformation responsible for setting the focused frame when handling a 10 position information request. As the FIXME formerly in InteractionInformationRequest.h alluded to, text 11 selection gestures on iOS were dependent on this behavior when selecting text in subframes, since text selection 12 helpers in WebPageIOS.mm assume that the focused frame already contains the selection being set. 13 14 Rather than calling setFocusedFrame when requesting position information, we can fix this by making 15 WebPage::selectWithGesture and WebPage::selectTextWithGranularityAtPoint both set the focused frame if needed 16 before extending or moving text selections. 17 18 Covered by layout tests that began to fail after r246757: 19 - editing/selection/ios/selection-handles-in-iframe.html 20 - editing/selection/ios/selection-handle-clamping-in-iframe.html 21 22 * WebProcess/WebPage/WebPage.h: 23 * WebProcess/WebPage/ios/WebPageIOS.mm: 24 (WebKit::WebPage::selectWithGesture): 25 26 Only call the new helper method, setFocusedFrameBeforeSelectingTextAtLocation, at the start of the gesture. 27 28 (WebKit::WebPage::setFocusedFrameBeforeSelectingTextAtLocation): 29 (WebKit::WebPage::selectTextWithGranularityAtPoint): 30 1 31 2019-07-01 Alex Christensen <achristensen@webkit.org> 2 32 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r246938 r247027 1246 1246 WebCore::VisiblePosition visiblePositionInFocusedNodeForPoint(const WebCore::Frame&, const WebCore::IntPoint&, bool isInteractingWithFocusedElement); 1247 1247 RefPtr<WebCore::Range> rangeForGranularityAtPoint(WebCore::Frame&, const WebCore::IntPoint&, uint32_t granularity, bool isInteractingWithFocusedElement); 1248 void setFocusedFrameBeforeSelectingTextAtLocation(const WebCore::IntPoint&); 1248 1249 void dispatchSyntheticMouseEventsForSelectionGesture(SelectionTouch, const WebCore::IntPoint&); 1249 1250 -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r247015 r247027 1309 1309 void WebPage::selectWithGesture(const IntPoint& point, uint32_t granularity, uint32_t gestureType, uint32_t gestureState, bool isInteractingWithFocusedElement, CallbackID callbackID) 1310 1310 { 1311 if (static_cast<GestureRecognizerState>(gestureState) == GestureRecognizerState::Began) 1312 setFocusedFrameBeforeSelectingTextAtLocation(point); 1313 1311 1314 auto& frame = m_page->focusController().focusedOrMainFrame(); 1312 1315 VisiblePosition position = visiblePositionInFocusedNodeForPoint(frame, point, isInteractingWithFocusedElement); … … 2028 2031 } 2029 2032 2033 void WebPage::setFocusedFrameBeforeSelectingTextAtLocation(const IntPoint& point) 2034 { 2035 auto result = m_page->mainFrame().eventHandler().hitTestResultAtPoint(point, HitTestRequest::ReadOnly | HitTestRequest::Active | HitTestRequest::DisallowUserAgentShadowContent | HitTestRequest::AllowChildFrameContent); 2036 auto* hitNode = result.innerNode(); 2037 if (hitNode && hitNode->renderer()) 2038 m_page->focusController().setFocusedFrame(result.innerNodeFrame()); 2039 } 2040 2030 2041 void WebPage::selectTextWithGranularityAtPoint(const WebCore::IntPoint& point, uint32_t granularity, bool isInteractingWithFocusedElement, CallbackID callbackID) 2031 2042 { 2043 setFocusedFrameBeforeSelectingTextAtLocation(point); 2044 2032 2045 auto& frame = m_page->focusController().focusedOrMainFrame(); 2033 2046 RefPtr<Range> range = rangeForGranularityAtPoint(frame, point, granularity, isInteractingWithFocusedElement);
Note: See TracChangeset
for help on using the changeset viewer.