Changeset 248974 in webkit
- Timestamp:
- Aug 21, 2019 4:05:26 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r248966 r248974 1 2019-08-21 Tim Horton <timothy_horton@apple.com> 2 3 [Mail] Tapping top of message scrolls back to copied text instead of top of the message 4 https://bugs.webkit.org/show_bug.cgi?id=200999 5 <rdar://problem/54564878> 6 7 Reviewed by Wenson Hsieh. 8 9 * editing/selection/ios/change-selection-by-tapping-with-existing-selection-expected.txt: Added. 10 * editing/selection/ios/change-selection-by-tapping-with-existing-selection.html: Added. 11 1 12 2019-08-21 Alex Christensen <achristensen@webkit.org> 2 13 -
trunk/Source/WebCore/ChangeLog
r248971 r248974 1 2019-08-21 Tim Horton <timothy_horton@apple.com> 2 3 [Mail] Tapping top of message scrolls back to copied text instead of top of the message 4 https://bugs.webkit.org/show_bug.cgi?id=200999 5 <rdar://problem/54564878> 6 7 Reviewed by Wenson Hsieh. 8 9 Test: editing/selection/ios/change-selection-by-tapping-with-existing-selection.html 10 11 * page/EditorClient.h: 12 (WebCore::EditorClient::shouldAllowSingleClickToChangeSelection const): 13 * page/EventHandler.cpp: 14 (WebCore::EventHandler::handleMousePressEventSingleClick): 15 Instead of encoding platform behaviors in EventHandler, defer to EditorClient. 16 1 17 2019-08-21 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebCore/page/EditorClient.h
r247722 r248974 187 187 188 188 virtual bool canShowFontPanel() const = 0; 189 190 virtual bool shouldAllowSingleClickToChangeSelection(Node&, const VisibleSelection&) const { return true; } 189 191 }; 190 192 -
trunk/Source/WebCore/page/EventHandler.cpp
r248846 r248974 699 699 TextGranularity granularity = CharacterGranularity; 700 700 701 #if PLATFORM(IOS_FAMILY) 702 // The text selection assistant will handle selection in the case where we are already editing the node 703 auto* editableRoot = newSelection.rootEditableElement(); 704 if (editableRoot && editableRoot == targetNode->rootEditableElement()) 701 if (!m_frame.editor().client()->shouldAllowSingleClickToChangeSelection(*targetNode, newSelection)) 705 702 return true; 706 #endif707 703 708 704 if (extendSelection && newSelection.isCaretOrRange()) { -
trunk/Source/WebKit/ChangeLog
r248973 r248974 1 2019-08-21 Tim Horton <timothy_horton@apple.com> 2 3 [Mail] Tapping top of message scrolls back to copied text instead of top of the message 4 https://bugs.webkit.org/show_bug.cgi?id=200999 5 <rdar://problem/54564878> 6 7 Reviewed by Wenson Hsieh. 8 9 In the case where you have a WebCore selection but are not first responder, 10 when you tap the WKWebView to become first responder, EventHandler would 11 bail from setting the selection, assuming UIKit was going to do it. This 12 behavior was introduced in r233311. 13 14 However, since we are not first responder, UIKit does not change the 15 selection, since it considers the view to not be editable. 16 17 Fix this by letting WebCore set the selection in this case, as it used to. 18 19 * WebProcess/WebCoreSupport/WebEditorClient.h: 20 * WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm: 21 (WebKit::WebEditorClient::shouldAllowSingleClickToChangeSelection const): 22 * WebProcess/WebPage/WebPage.h: 23 (WebKit::WebPage::isShowingInputViewForFocusedElement const): 24 Copy the logic from EventHandler, with the added caveat (which fixes the 25 aforementioned behavior) that we will allow EventHandler to change the 26 selection if we don't have a focused node in the UIKit sense, because 27 we know that the platform text interaction code will *not* change the 28 selection if that is the case, so it's up to us. 29 1 30 2019-08-21 Chris Dumez <cdumez@apple.com> 2 31 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h
r248762 r248974 182 182 bool performsTwoStepPaste(WebCore::DocumentFragment*) final; 183 183 void updateStringForFind(const String&) final; 184 bool shouldAllowSingleClickToChangeSelection(WebCore::Node&, const WebCore::VisibleSelection&) const final; 184 185 #endif 185 186 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/ios/WebEditorClientIOS.mm
r244982 r248974 103 103 } 104 104 105 bool WebEditorClient::shouldAllowSingleClickToChangeSelection(WebCore::Node& targetNode, const WebCore::VisibleSelection& newSelection) const 106 { 107 // The text selection assistant will handle selection in the case where we are already editing the node 108 auto* editableRoot = newSelection.rootEditableElement(); 109 return !editableRoot || editableRoot != targetNode.rootEditableElement() || !m_page->isShowingInputViewForFocusedElement(); 110 } 111 105 112 } // namespace WebKit 106 113 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r248901 r248974 679 679 void setFocusedElementSelectedIndex(uint32_t index, bool allowMultipleSelection); 680 680 void setIsShowingInputViewForFocusedElement(bool); 681 bool isShowingInputViewForFocusedElement() const { return m_isShowingInputViewForFocusedElement; } 681 682 void updateSelectionAppearance(); 682 683 void getSelectionContext(CallbackID); -
trunk/Source/WebKitLegacy/mac/ChangeLog
r248960 r248974 1 2019-08-21 Tim Horton <timothy_horton@apple.com> 2 3 [Mail] Tapping top of message scrolls back to copied text instead of top of the message 4 https://bugs.webkit.org/show_bug.cgi?id=200999 5 <rdar://problem/54564878> 6 7 Reviewed by Wenson Hsieh. 8 9 * WebCoreSupport/WebEditorClient.h: 10 * WebCoreSupport/WebEditorClient.mm: 11 (WebEditorClient::shouldAllowSingleClickToChangeSelection const): 12 Copy the existing behavior from EventHandler. 13 We do not fix the bug in WebKitLegacy for a multitude of reasons, primarily 14 because we do not know of any user impact. 15 1 16 2019-08-21 Ryosuke Niwa <rniwa@webkit.org> 2 17 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h
r248762 r248974 177 177 void registerUndoOrRedoStep(WebCore::UndoStep&, bool isRedo); 178 178 179 #if PLATFORM(IOS_FAMILY) 180 bool shouldAllowSingleClickToChangeSelection(WebCore::Node& targetNode, const WebCore::VisibleSelection& newSelection) const; 181 #endif 182 179 183 bool canShowFontPanel() const final 180 184 { -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
r248697 r248974 1259 1259 #endif 1260 1260 } 1261 1262 #if PLATFORM(IOS_FAMILY) 1263 bool WebEditorClient::shouldAllowSingleClickToChangeSelection(WebCore::Node& targetNode, const WebCore::VisibleSelection& newSelection) const 1264 { 1265 // The text selection assistant will handle selection in the case where we are already editing the node 1266 auto* editableRoot = newSelection.rootEditableElement(); 1267 return !editableRoot || editableRoot != targetNode.rootEditableElement(); 1268 } 1269 #endif
Note: See TracChangeset
for help on using the changeset viewer.