WebKit Bugzilla
Attachment 361054 Details for
Bug 193758
: [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-193758-20190204073352.patch (text/plain), 3.01 KB, created by
Wenson Hsieh
on 2019-02-04 07:33:53 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-02-04 07:33:53 PST
Size:
3.01 KB
patch
obsolete
>Subversion Revision: 240906 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 98128cdcd1a884195fe29eddb4c521d5870aee26..44153665f17132fc1b256f204cf66dc798bf166a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,18 @@ >+2019-02-04 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site >+ Followup to https://bugs.webkit.org/show_bug.cgi?id=193758 >+ >+ Reviewed by Daniel Bates. >+ >+ Put the iOS-specific behavior behind an EditingBehavior check, rather than a compile-time guard. No change in >+ behavior. >+ >+ * editing/EditingBehavior.h: >+ (WebCore::EditingBehavior::shouldMoveSelectionToEndWhenFocusingTextInput const): >+ * html/HTMLInputElement.cpp: >+ (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus): >+ > 2019-02-03 Antti Koivisto <antti@apple.com> > > Don't include ScrollCoordinator.h from Element.h >diff --git a/Source/WebCore/editing/EditingBehavior.h b/Source/WebCore/editing/EditingBehavior.h >index 27fb1f0769db06138ba359379edbf09d782dc8b3..655c4edaa6c2c436e49981825f3f0226a70093e5 100644 >--- a/Source/WebCore/editing/EditingBehavior.h >+++ b/Source/WebCore/editing/EditingBehavior.h >@@ -93,6 +93,9 @@ public: > // Linux and Windows always extend selections from the extent endpoint. > bool shouldAlwaysExtendSelectionFromExtentEndpoint() const { return m_type != EditingMacBehavior && m_type != EditingIOSBehavior; } > >+ // 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. >+ bool shouldMoveSelectionToEndWhenFocusingTextInput() const { return m_type == EditingIOSBehavior; } >+ > private: > EditingBehaviorType m_type; > }; >diff --git a/Source/WebCore/html/HTMLInputElement.cpp b/Source/WebCore/html/HTMLInputElement.cpp >index 43ae3b4668a1161d5199b8e4eb7ae5df3f0f42c0..cafd2dd269e313b466f0a8b878d3fa4e2c3af0f9 100644 >--- a/Source/WebCore/html/HTMLInputElement.cpp >+++ b/Source/WebCore/html/HTMLInputElement.cpp >@@ -469,14 +469,13 @@ void HTMLInputElement::updateFocusAppearance(SelectionRestorationMode restoratio > void HTMLInputElement::setDefaultSelectionAfterFocus(SelectionRevealMode revealMode) > { > ASSERT(isTextField()); >-#if PLATFORM(IOS_FAMILY) >- // 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. >- int start = std::numeric_limits<int>::max(); >- auto direction = SelectionHasForwardDirection; >-#else > int start = 0; > auto direction = SelectionHasNoDirection; >-#endif >+ auto* frame = document().frame(); >+ if (frame && frame->editor().behavior().shouldMoveSelectionToEndWhenFocusingTextInput()) { >+ start = std::numeric_limits<int>::max(); >+ direction = SelectionHasForwardDirection; >+ } > setSelectionRange(start, std::numeric_limits<int>::max(), direction, revealMode, Element::defaultFocusTextStateChangeIntent()); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 193758
:
359995
|
360037
|
361025
|
361054
|
361112
|
361117