<?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>16812</bug_id>
          
          <creation_ts>2008-01-09 20:44:35 -0800</creation_ts>
          <short_desc>onFocus causes cursor to be in wrong location if MobileSafari resizes page</short_desc>
          <delta_ts>2008-01-09 20:53:58 -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>420+</version>
          <rep_platform>Other</rep_platform>
          <op_sys>Other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.whiterose.org/test/onfocusissue.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Michael Croft">mcroft</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ddkilzer</cc>
    
    <cc>mrowe</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66716</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Croft">mcroft</who>
    <bug_when>2008-01-09 20:44:35 -0800</bug_when>
    <thetext>[If you&apos;re not looking for/at MobileSafari bugs here, my apologies.  If you are, might be worthwhile to add platform/OS for it...]

OS iPhone 3B48b (1.1.2) 

This page uses onfocus to clear an example value in a text input field.  This works fine in Safari (and other browsers) but causes a focus problem in Mobile Safari (in portrait orientation).  The key code is 
input type=&quot;text&quot; name=&quot;IphoneNumber&quot; value=&quot;ex. 5125551212&quot; onfocus=&quot;this.value=&apos;&apos;&quot;

If I take out onfocus, this works fine.

We were unable to duplicate the problem with iPhone software 1.0.2

Steps to reproduce:
1: open the attached page in portrait mode on an iPhone
2: touch the text field
expected results: the field becomes blank and the cursor moves to the first character in the field.
actual results: the cursor and the focus are somewhere before the field.  Typing can happen, but it&apos;s not in the right field.

I&apos;ve tried this with different doctypes and with and without the viewport meta setting.  The page validates.  There is no problem if the form is the first item on the page or if the iPhone is in landscape mode (no scaling happens).  The H1 element is involved, if only because of the width of the page.  If the scaling has already occurred (such as if you re-open the page while it&apos;s already the right size for the form), the focus goes to the right place.

Reduction at the URL listed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66718</commentid>
    <comment_count>1</comment_count>
      <attachid>18360</attachid>
    <who name="Michael Croft">mcroft</who>
    <bug_when>2008-01-09 20:46:56 -0800</bug_when>
    <thetext>Created attachment 18360
reduced test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66720</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-01-09 20:48:24 -0800</bug_when>
    <thetext>Bugs in Safari on the iPhone should be reported in Radar at http://bugreport.apple.com/.  I&apos;m going to migrate this bug to Radar and close this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66723</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-01-09 20:49:37 -0800</bug_when>
    <thetext>&lt;rdar://problem/5680715&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>18360</attachid>
            <date>2008-01-09 20:46:56 -0800</date>
            <delta_ts>2008-01-09 20:46:56 -0800</delta_ts>
            <desc>reduced test case</desc>
            <filename>onFocusIssue.html</filename>
            <type>text/html</type>
            <size>674</size>
            <attacher name="Michael Croft">mcroft</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWwgUFVCTElDICItLy9XM0MvL0RURCBYSFRNTCAxLjAgVHJhbnNpdGlvbmFs
Ly9FTiIgImh0dHA6Ly93d3cudzMub3JnL1RSLzIwMDIvUkVDLXhodG1sMS0yMDAyMDgwMS9EVEQv
eGh0bWwxLXRyYW5zaXRpb25hbC5kdGQiPgo8aHRtbCB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MTk5OS94aHRtbCIgeG1sOmxhbmc9ImVuIiBsYW5nPSJlbiI+CiAgPGhlYWQ+CiAgICA8dGl0bGU+
b25Gb2N1cyByZXNpemUgY3Vyc29yIHBvc2l0aW9uIHRlc3Q8L3RpdGxlPgogICAgPG1ldGEgaHR0
cC1lcXVpdj0iY29udGVudC10eXBlIiBjb250ZW50PSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9VVRGLTgi
Lz4KICAgIDxtZXRhIG5hbWU9InZpZXdwb3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgi
Lz4KICA8L2hlYWQ+CiAgPGJvZHk+CiAgICAgICAgPGgxPlRFU1QgaVBob25lIEhvbWU8L2gxPgog
ICAgICAgICAgICAgIFdoZXJlIGRpZCBteSBmb2N1cyBnbz8KICAgIDxmb3JtIG5hbWU9IklBSSIg
aWQ9IklBSSIgbWV0aG9kPSJwb3N0IiBhY3Rpb249IiI+CiAgICAgIDxpbnB1dCB0eXBlPSJ0ZXh0
IiBuYW1lPSJJcGhvbmVOdW1iZXIiIHZhbHVlPSJleC4gNTEyNTU1MTIxMiIgb25mb2N1cz0idGhp
cy52YWx1ZT0nJyIvPgogICAgPC9mb3JtPiAKCiAgPC9ib2R5Pgo8L2h0bWw+Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>