<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>193040</bug_id>
          
          <creation_ts>2018-12-26 17:31:50 -0800</creation_ts>
          <short_desc>HTMLInputElement.select() doesn&apos;t work in iOS Safari</short_desc>
          <delta_ts>2019-02-02 18:34:11 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>Safari 12</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 12</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>193758</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="shrpne">corsar89</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>cdumez</cc>
    
    <cc>corsar89</cc>
    
    <cc>dbates</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1490853</commentid>
    <comment_count>0</comment_count>
    <who name="shrpne">corsar89</who>
    <bug_when>2018-12-26 17:31:50 -0800</bug_when>
    <thetext>HTMLInputElement.select() doesn&apos;t work in iOS Safari. While in desktop Safari it works fine.
For now, it&apos;s only modern browser without the support of `.select()` method.
`.setSelectionRange()` or `selectionStart` with `selectionEnd` should be used as workaround.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1490907</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-12-27 11:28:59 -0800</bug_when>
    <thetext>&lt;rdar://problem/46962874&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1491262</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Dumez">cdumez</who>
    <bug_when>2019-01-02 14:29:09 -0800</bug_when>
    <thetext>I can see there is not IOS specific code in our select implementation:
void HTMLTextFormControlElement::select(SelectionRevealMode revealMode, const AXTextStateChangeIntent&amp; intent)
{
    // FIXME: We should abstract the selection behavior into an EditingBehavior function instead
    // of hardcoding the behavior using a macro define.
#if PLATFORM(IOS_FAMILY)
    // We don&apos;t want to select all the text on iOS. Instead use the standard textfield behavior of going to the end of the line.
    setSelectionRange(std::numeric_limits&lt;int&gt;::max(), std::numeric_limits&lt;int&gt;::max(), SelectionHasForwardDirection, revealMode, intent);
#else
    setSelectionRange(0, std::numeric_limits&lt;int&gt;::max(), SelectionHasNoDirection, revealMode, intent);
#endif
}

Clearly, we have an implementation of HTMLInputElement.select() on all platforms. However, the iOS implementation is a bit different for some reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1501561</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2019-02-02 18:30:55 -0800</bug_when>
    <thetext>Wenson, didn&apos;t we just fix this behavior recently?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1501562</commentid>
    <comment_count>4</comment_count>
    <who name="Wenson Hsieh">wenson_hsieh</who>
    <bug_when>2019-02-02 18:34:11 -0800</bug_when>
    <thetext>(In reply to Ryosuke Niwa from comment #3)
&gt; Wenson, didn&apos;t we just fix this behavior recently?

Yep, in https://bugs.webkit.org/show_bug.cgi?id=193758!

(Sorry for the forward dupe — I probably should&apos;ve found this existing bug before filing a new one).

*** This bug has been marked as a duplicate of bug 193758 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>