Changeset 240926 in webkit
- Timestamp:
- Feb 4, 2019 8:05:18 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240924 r240926 1 2019-02-04 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site 4 Followup to https://bugs.webkit.org/show_bug.cgi?id=193758 5 6 Reviewed by Daniel Bates. 7 8 Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in 9 behavior. 10 11 * editing/EditingBehavior.h: 12 (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const): 13 * html/HTMLInputElement.cpp: 14 (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus): 15 1 16 2019-02-04 Zalan Bujtas <zalan@apple.com> 2 17 -
trunk/Source/WebCore/editing/EditingBehavior.h
r222806 r240926 94 94 bool shouldAlwaysExtendSelectionFromExtentEndpoint() const { return m_type != EditingMacBehavior && m_type != EditingIOSBehavior; } 95 95 96 // On iOS, we don't want to select all the text when focusing a field. Instead, match platform behavior by going to the end of the line. 97 bool shouldMoveSelectionToEndWhenFocusingTextInput() const { return m_type == EditingIOSBehavior; } 98 96 99 private: 97 100 EditingBehaviorType m_type; -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r240452 r240926 470 470 { 471 471 ASSERT(isTextField()); 472 #if PLATFORM(IOS_FAMILY)473 // We don't want to select all the text on iOS when focusing a field. Instead, match platform behavior by going to the end of the line.474 int start = std::numeric_limits<int>::max();475 auto direction = SelectionHasForwardDirection;476 #else477 472 int start = 0; 478 473 auto direction = SelectionHasNoDirection; 479 #endif 474 auto* frame = document().frame(); 475 if (frame && frame->editor().behavior().shouldMoveSelectionToEndWhenFocusingTextInput()) { 476 start = std::numeric_limits<int>::max(); 477 direction = SelectionHasForwardDirection; 478 } 480 479 setSelectionRange(start, std::numeric_limits<int>::max(), direction, revealMode, Element::defaultFocusTextStateChangeIntent()); 481 480 }
Note: See TracChangeset
for help on using the changeset viewer.