<?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>8743</bug_id>
          
          <creation_ts>2006-05-04 15:19:56 -0700</creation_ts>
          <short_desc>REGRESSION: focus() on input field selects all text within it (was: cannot select cities on British Rail reservation site)</short_desc>
          <delta_ts>2006-05-11 10:42:35 -0700</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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.britishrail.com/timetable_tickets.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>EasyFix, Regression</keywords>
          <priority>P1</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hanspeter Schaub">Hanspeterschaub</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>adele</cc>
    
    <cc>darin</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41278</commentid>
    <comment_count>0</comment_count>
    <who name="Hanspeter Schaub">Hanspeterschaub</who>
    <bug_when>2006-05-04 15:19:56 -0700</bug_when>
    <thetext>REGRESSION

On the British Rail reservation system I can no longer select cities in the departure/arrival text fields.  As you start typing a city name there, the web page provides you with all possible cities that match your letters types.  However, with the latest safari build (5/4/06) the latest letter typed is always used as the first letter?  

In the regular version of Safari that comes with 10.4.6 this does not occur.  Here if you start typing a city, after each letter your possible selections are reduced until you select a specific city.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41346</commentid>
    <comment_count>1</comment_count>
      <attachid>8126</attachid>
    <who name="">jonathanjohnsson</who>
    <bug_when>2006-05-05 11:33:57 -0700</bug_when>
    <thetext>Created attachment 8126
Test case

When the Javascript function focus() is run on an input field, it not only focuses the field, but selects all the text. This regression happened between nightlies r13568 and r13574.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41401</commentid>
    <comment_count>2</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-06 12:00:29 -0700</bug_when>
    <thetext>What is focus() supposed to do, selection-wise? What does it do in other browsers? Is the selection supposed to go at the end of the field?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41613</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-09 09:15:14 -0700</bug_when>
    <thetext>I think the issue is only when focus() is called on a field that&apos;s already focused. I&apos;m guessing the behavior of selecting all is fine when the field doesn&apos;t already have focus.

The problem is in HTMLInputElement::focus, which calls select() unconditionally and instead should call it only if the focus node is not already set.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41817</commentid>
    <comment_count>4</comment_count>
      <attachid>8198</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-09 22:54:30 -0700</bug_when>
    <thetext>Created attachment 8198
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41836</commentid>
    <comment_count>5</comment_count>
      <attachid>8198</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2006-05-10 00:41:41 -0700</bug_when>
    <thetext>Comment on attachment 8198
patch

I think the AppKit controls maintain some state for their selection.  In the future, we want to restore some of that state when we focus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>42012</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2006-05-11 10:42:35 -0700</bug_when>
    <thetext>Committed revision 14301.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>8126</attachid>
            <date>2006-05-05 11:33:57 -0700</date>
            <delta_ts>2006-05-05 11:33:57 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>bug8743.html</filename>
            <type>text/html</type>
            <size>602</size>
            <attacher>jonathanjohnsson</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSL3hodG1sMS9EVEQveGh0bWwxLXRyYW5zaXRpb25h
bC5kdGQiPgo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94aHRtbCI+Cgk8aGVh
ZD4KCQk8bWV0YSBodHRwLWVxdWl2PSJDb250ZW50LVR5cGUiIGNvbnRlbnQ9InRleHQvaHRtbDsg
Y2hhcnNldD1pc28tODg1OS0xIj4KCQk8dGl0bGU+CgkJCUZhcmVzIGFuZCBTY2hlZHVsZXMgU2Vh
cmNoCgkJPC90aXRsZT4KCQk8c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+Cg0KbWFpbkxv
b3A9ZnVuY3Rpb24oKXsKICBpbnB1dEZpZWxkPWRvY3VtZW50LmZvcm0xLkYwOw0KICBpbnB1dEZp
ZWxkLmZvY3VzKCkKICBzZXRUaW1lb3V0KCJtYWluTG9vcCgpIiwyMDAwKTsNCiAgcmV0dXJuIHRy
dWUKfQo7Cg0Kc2V0VGltZW91dCgibWFpbkxvb3AoKSIsMTApOwoNCiAgICAgICAgPC9zY3JpcHQ+
Cgk8L2hlYWQ+Cgk8Ym9keT4KCQk8Zm9ybSBuYW1lPSJmb3JtMSIgPgoJCQk8aW5wdXQgbmFtZT0i
RjAiPgoJCTwvZm9ybT4KCTwvYm9keT4KPC9odG1sPgo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>8198</attachid>
            <date>2006-05-09 22:54:30 -0700</date>
            <delta_ts>2006-05-10 00:41:41 -0700</delta_ts>
            <desc>patch</desc>
            <filename>InputFocusPatch.txt</filename>
            <type>text/plain</type>
            <size>937</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">SW5kZXg6IGh0bWwvSFRNTElucHV0RWxlbWVudC5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaHRtbC9IVE1M
SW5wdXRFbGVtZW50LmNwcAkocmV2aXNpb24gMTQyNzMpCisrKyBodG1sL0hUTUxJbnB1dEVsZW1l
bnQuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xNjgsMTYgKzE2OCwxOSBAQAogdm9pZCBIVE1MSW5w
dXRFbGVtZW50Ojpmb2N1cygpCiB7CiAgICAgaWYgKGlzTm9uV2lkZ2V0VGV4dEZpZWxkKCkpIHsK
KyAgICAgICAgaWYgKCFpc0ZvY3VzYWJsZSgpKQorICAgICAgICAgICAgcmV0dXJuOwogICAgICAg
ICBEb2N1bWVudCogZG9jID0gZG9jdW1lbnQoKTsKKyAgICAgICAgaWYgKGRvYy0+Zm9jdXNOb2Rl
KCkgPT0gdGhpcykKKyAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgZG9jLT51cGRhdGVMYXlv
dXQoKTsKLSAgICAgICAgaWYgKGlzRm9jdXNhYmxlKCkpIHsKLSAgICAgICAgICAgIGRvYy0+c2V0
Rm9jdXNOb2RlKHRoaXMpOwotICAgICAgICAgICAgc2VsZWN0KCk7Ci0gICAgICAgICAgICBpZiAo
ZG9jLT5mcmFtZSgpKQotICAgICAgICAgICAgICAgIGRvYy0+ZnJhbWUoKS0+cmV2ZWFsU2VsZWN0
aW9uKCk7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UKLSAgICAgICAgSFRNTEdlbmVyaWNGb3JtRWxl
bWVudDo6Zm9jdXMoKTsKKyAgICAgICAgZG9jLT5zZXRGb2N1c05vZGUodGhpcyk7CisgICAgICAg
IHNlbGVjdCgpOworICAgICAgICBpZiAoZG9jLT5mcmFtZSgpKQorICAgICAgICAgICAgZG9jLT5m
cmFtZSgpLT5yZXZlYWxTZWxlY3Rpb24oKTsKKyAgICAgICAgcmV0dXJuOworICAgIH0KKyAgICBI
VE1MR2VuZXJpY0Zvcm1FbGVtZW50Ojpmb2N1cygpOwogfQogCiB2b2lkIEhUTUxJbnB1dEVsZW1l
bnQ6OmRpc3BhdGNoRm9jdXNFdmVudCgpCg==
</data>
<flag name="review"
          id="2289"
          type_id="1"
          status="+"
          setter="adele"
    />
          </attachment>
      

    </bug>

</bugzilla>