Changeset 233311 in webkit
- Timestamp:
- Jun 28, 2018 10:12:05 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r233302 r233311 1 2018-06-28 Aditya Keerthi <akeerthi@apple.com> 2 3 REGRESSION (r232040): Cursor jumping in Safari text fields 4 https://bugs.webkit.org/show_bug.cgi?id=187142 5 <rdar://problem/41397577> 6 7 Reviewed by Tim Horton. 8 9 Added test to ensure that the 'selectionchange' event is only fired once per 10 click in an editable node. 11 12 * fast/events/ios/click-selectionchange-once-expected.txt: Added. 13 * fast/events/ios/click-selectionchange-once.html: Added. 14 1 15 2018-06-28 Dirk Schulze <krit@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r233309 r233311 1 2018-06-28 Aditya Keerthi <akeerthi@apple.com> 2 3 REGRESSION (r232040): Cursor jumping in Safari text fields 4 https://bugs.webkit.org/show_bug.cgi?id=187142 5 <rdar://problem/41397577> 6 7 Reviewed by Tim Horton. 8 9 r232040 enabled click events to fire on nodes that are already being edited in 10 iOS. This resulted FrameSelection::setSelection being called twice. One call 11 originated from the UIWKTextInteractionAssistant, which snaps the caret to word 12 boundaries. The other call originates from handleMousePressEvent in EventHandler, 13 and uses character boundaries. Consequently, we see the caret jumping around. 14 15 To fix this issue, an early return was added in the handleMousePressEvent 16 codepath, which prevents FrameSelection::setSelection from being called when 17 clicking on a node that is already being edited. This ensures that the 18 UIWKTextInteractionAssistant codepath is the only influence on the caret position. 19 20 Test: fast/events/ios/click-selectionchange-once.html 21 22 * page/EventHandler.cpp: 23 (WebCore::EventHandler::handleMousePressEventSingleClick): 24 1 25 2018-06-28 Chris Dumez <cdumez@apple.com> 2 26 -
trunk/Source/WebCore/page/EventHandler.cpp
r233122 r233311 682 682 TextGranularity granularity = CharacterGranularity; 683 683 684 #if PLATFORM(IOS) 685 // The text selection assistant will handle selection in the case where we are already editing the node 686 if (newSelection.rootEditableElement() == targetNode->rootEditableElement()) 687 return true; 688 #endif 689 684 690 if (extendSelection && newSelection.isCaretOrRange()) { 685 691 VisibleSelection selectionInUserSelectAll = expandSelectionToRespectSelectOnMouseDown(*targetNode, VisibleSelection(pos));
Note: See TracChangeset
for help on using the changeset viewer.