Changeset 240452 in webkit
- Timestamp:
- Jan 24, 2019 3:30:37 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 1 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r240444 r240452 1 2019-01-24 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 https://bugs.webkit.org/show_bug.cgi?id=193758 5 <rdar://problem/43614978> 6 7 Reviewed by Tim Horton. 8 9 Mark some existing layout tests as passing on iOS. Additionally, remove failing expectations for another 10 existing layout test on iOS. 11 12 * platform/ios/TestExpectations: 13 * platform/ios/editing/text-iterator/hidden-textarea-selection-quirk-expected.txt: Removed. 14 1 15 2019-01-24 John Wilander <wilander@apple.com> 2 16 -
trunk/LayoutTests/platform/ios/TestExpectations
r240324 r240452 1683 1683 fast/forms/input-live-pseudo-selectors.html [ Failure ] 1684 1684 fast/forms/input-no-renderer.html [ Failure ] 1685 fast/forms/input-select-webkit-user-select-none.html [ Failure ]1686 1685 fast/forms/input-set-composition-scroll.html [ Failure ] 1687 1686 fast/forms/input-textarea-padding-match.html [ ImageOnlyFailure ] … … 1708 1707 fast/forms/select-overflow-scroll.html [ Failure ] 1709 1708 fast/forms/select/option-selecting.html [ Failure ] 1710 fast/forms/shadow-tree-exposure.html [ Failure ]1711 1709 fast/forms/textarea-input-event.html [ Failure ] 1712 1710 fast/forms/textarea-live-pseudo-selectors.html [ Failure ] 1713 1711 fast/forms/textarea-metrics.html [ Failure ] 1714 1712 fast/forms/textarea-placeholder-wrapping.html [ ImageOnlyFailure ] 1715 fast/forms/textarea-set-defaultvalue-after-value.html [ Failure ]1716 1713 fast/forms/textfield-overflow-by-value-update.html [ Failure ] 1717 1714 fast/frames/calculate-fixed.html [ Failure ] … … 2118 2115 editing/pasteboard/copy-inside-h1-preserves-h1.html [ Failure ] 2119 2116 editing/pasteboard/copy-text-with-backgroundcolor.html [ Failure ] 2120 editing/pasteboard/copy-two-pasteboard-types-both-work.html [ Failure ]2121 2117 webkit.org/b/177961 editing/pasteboard/data-transfer-items.html [ Skip ] 2122 2118 editing/pasteboard/dataTransfer-setData-getData.html [ Failure ] … … 2138 2134 editing/pasteboard/paste-global-selection.html [ Failure ] 2139 2135 editing/pasteboard/paste-list-004.html [ Failure ] 2140 editing/pasteboard/paste-placeholder-input.html [ Failure ]2141 2136 editing/pasteboard/paste-plaintext-user-select-none.html [ Failure ] 2142 2137 editing/pasteboard/paste-sanitize-crash-1.html [ Failure ] -
trunk/Source/WebCore/ChangeLog
r240451 r240452 1 2019-01-24 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 https://bugs.webkit.org/show_bug.cgi?id=193758 5 <rdar://problem/43614978> 6 7 Reviewed by Tim Horton. 8 9 CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor 10 (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines 11 a helper method to select all the text inside of a text form control, called `selectInput`, which normally 12 invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by 13 setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting 14 the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround. 15 16 This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer 17 reproduces even without this quirk. To fix CodeMirror, we make two adjustments: 18 19 1. Roll out this ancient demo hack, in favor of standardized behavior. 20 2. Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we 21 want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To 22 achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default 23 selection of a text input after focus; on iOS, this helper method moves the selection to the end of the 24 input, but everywhere else, it selects all the text in the input element. 25 26 This causes 6 existing layout tests to begin passing on iOS. 27 28 * html/HTMLInputElement.cpp: 29 (WebCore::HTMLInputElement::updateFocusAppearance): 30 (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus): 31 * html/HTMLInputElement.h: 32 * html/HTMLTextFormControlElement.cpp: 33 (WebCore::HTMLTextFormControlElement::select): 34 1 35 2019-01-24 Jer Noble <jer.noble@apple.com> 2 36 -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r240237 r240452 460 460 if (isTextField()) { 461 461 if (restorationMode == SelectionRestorationMode::SetDefault || !hasCachedSelection()) 462 se lect(revealMode, Element::defaultFocusTextStateChangeIntent());462 setDefaultSelectionAfterFocus(revealMode); 463 463 else 464 464 restoreCachedSelection(revealMode); 465 465 } else 466 466 HTMLTextFormControlElement::updateFocusAppearance(restorationMode, revealMode); 467 } 468 469 void HTMLInputElement::setDefaultSelectionAfterFocus(SelectionRevealMode revealMode) 470 { 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 #else 477 int start = 0; 478 auto direction = SelectionHasNoDirection; 479 #endif 480 setSelectionRange(start, std::numeric_limits<int>::max(), direction, revealMode, Element::defaultFocusTextStateChangeIntent()); 467 481 } 468 482 -
trunk/Source/WebCore/html/HTMLInputElement.h
r239427 r240452 455 455 void removeFromRadioButtonGroup(); 456 456 457 void setDefaultSelectionAfterFocus(SelectionRevealMode); 458 457 459 AtomicString m_name; 458 460 String m_valueIfDirty; -
trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp
r237975 r240452 190 190 void HTMLTextFormControlElement::select(SelectionRevealMode revealMode, const AXTextStateChangeIntent& intent) 191 191 { 192 // FIXME: We should abstract the selection behavior into an EditingBehavior function instead193 // of hardcoding the behavior using a macro define.194 #if PLATFORM(IOS_FAMILY)195 // We don't want to select all the text on iOS. Instead use the standard textfield behavior of going to the end of the line.196 setSelectionRange(std::numeric_limits<int>::max(), std::numeric_limits<int>::max(), SelectionHasForwardDirection, revealMode, intent);197 #else198 192 setSelectionRange(0, std::numeric_limits<int>::max(), SelectionHasNoDirection, revealMode, intent); 199 #endif200 193 } 201 194
Note: See TracChangeset
for help on using the changeset viewer.