<?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>46856</bug_id>
          
          <creation_ts>2010-09-29 16:49:24 -0700</creation_ts>
          <short_desc>[Chromium] Tabbing into page doesn&apos;t always select the first element</short_desc>
          <delta_ts>2010-10-02 21:02:44 -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>Platform</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Avi Drissman">avi</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>ctguil</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>287216</commentid>
    <comment_count>0</comment_count>
    <who name="Avi Drissman">avi</who>
    <bug_when>2010-09-29 16:49:24 -0700</bug_when>
    <thetext>Upstream of http://code.google.com/p/chromium/issues/detail?id=57344 :

What steps will reproduce the problem?
1. Load http://src.chromium.org/viewvc/chrome/trunk/src/chrome/test/data/focus/typical_page.html
2. Click in the omnibox
3. Press [tab] once

Result: search field has focus (correct).

4. Click in the omnibox
5. Press [tab] once

Result: the search button has focus (incorrect).

Every time you tab into a web view, the first element in that view should gain focus (or the last element, if you reverse-tab in).

The bug: in WebViewImpl::setInitialFocus (WebKit/WebKit/chromium/src/WebViewImpl.cpp), just a tab keystroke is fired off. That works the first time when the page is initially loaded since no page object has the focus, but in subsequent calls it just advances the focus (incorrectly).

Compare to WebKit/WebKit/win/WebView.cpp&apos;s version which explicitly calls setFocusedNode(0) to reset the focus before advancing using the focus controller.

Broken on all platforms but the Mac (in which this initial focus code is even _more_ broken; see http://code.google.com/p/chromium/issues/detail?id=49738).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>287221</commentid>
    <comment_count>1</comment_count>
      <attachid>69278</attachid>
    <who name="Avi Drissman">avi</who>
    <bug_when>2010-09-29 16:57:06 -0700</bug_when>
    <thetext>Created attachment 69278
Patch to fix; modeled after win/WebView.cpp and mac/WebHTMLView.mm</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>287227</commentid>
    <comment_count>2</comment_count>
      <attachid>69278</attachid>
    <who name="Kenneth Russell">kbr</who>
    <bug_when>2010-09-29 17:05:35 -0700</bug_when>
    <thetext>Comment on attachment 69278
Patch to fix; modeled after win/WebView.cpp and mac/WebHTMLView.mm

This looks OK to me based on comparison to mac/WebView/WebHTMLView.mm and win/WebView.cpp.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>287430</commentid>
    <comment_count>3</comment_count>
      <attachid>69278</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-09-30 01:51:10 -0700</bug_when>
    <thetext>Comment on attachment 69278
Patch to fix; modeled after win/WebView.cpp and mac/WebHTMLView.mm

Clearing flags on attachment: 69278

Committed r68765: &lt;http://trac.webkit.org/changeset/68765&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>287431</commentid>
    <comment_count>4</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2010-09-30 01:51:15 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>69278</attachid>
            <date>2010-09-29 16:57:06 -0700</date>
            <delta_ts>2010-09-30 01:51:10 -0700</delta_ts>
            <desc>Patch to fix; modeled after win/WebView.cpp and mac/WebHTMLView.mm</desc>
            <filename>tab</filename>
            <type>text/plain</type>
            <size>1375</size>
            <attacher name="Avi Drissman">avi</attacher>
            
              <data encoding="base64">SW5kZXg6IFdlYktpdC9jaHJvbWl1bS9DaGFuZ2VMb2cKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gV2ViS2l0L2No
cm9taXVtL0NoYW5nZUxvZwkocmV2aXNpb24gNjg3MTUpCisrKyBXZWJLaXQvY2hyb21pdW0vQ2hh
bmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMTAtMDktMjkgIEF2aSBE
cmlzc21hbiAgPGF2aUBnb29nbGUuY29tPgorCisgICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAo
T09QUyEpLgorCisgICAgICAgIFtDaHJvbWl1bV0gVGFiYmluZyBpbnRvIHBhZ2UgZG9lc24ndCBh
bHdheXMgc2VsZWN0IHRoZSBmaXJzdCBlbGVtZW50CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJr
aXQub3JnL3Nob3dfYnVnLmNnaT9pZD00Njg1NgorCisgICAgICAgICogc3JjL1dlYlZpZXdJbXBs
LmNwcDoKKyAgICAgICAgKFdlYktpdDo6V2ViVmlld0ltcGw6OnNldEluaXRpYWxGb2N1cyk6CisK
IDIwMTAtMDktMjkgIFRvbnkgQ2hhbmcgIDx0b255QGNocm9taXVtLm9yZz4KIAogICAgICAgICBS
ZXZpZXdlZCBieSBKYW1lcyBSb2JpbnNvbi4KSW5kZXg6IFdlYktpdC9jaHJvbWl1bS9zcmMvV2Vi
Vmlld0ltcGwuY3BwCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIFdlYktpdC9jaHJvbWl1bS9zcmMvV2ViVmlld0lt
cGwuY3BwCShyZXZpc2lvbiA2ODA4MCkKKysrIFdlYktpdC9jaHJvbWl1bS9zcmMvV2ViVmlld0lt
cGwuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xNDgxLDYgKzE0ODEsMTAgQEAgdm9pZCBXZWJWaWV3
SW1wbDo6c2V0SW5pdGlhbEZvY3VzKGJvb2wgcgogICAgIGtleWJvYXJkRXZlbnQud2luZG93c0tl
eUNvZGUgPSAweDA5OwogICAgIFBsYXRmb3JtS2V5Ym9hcmRFdmVudEJ1aWxkZXIgcGxhdGZvcm1F
dmVudChrZXlib2FyZEV2ZW50KTsKICAgICBSZWZQdHI8S2V5Ym9hcmRFdmVudD4gd2Via2l0RXZl
bnQgPSBLZXlib2FyZEV2ZW50OjpjcmVhdGUocGxhdGZvcm1FdmVudCwgMCk7CisKKyAgICBGcmFt
ZSogZnJhbWUgPSBwYWdlKCktPmZvY3VzQ29udHJvbGxlcigpLT5mb2N1c2VkT3JNYWluRnJhbWUo
KTsKKyAgICBpZiAoRG9jdW1lbnQqIGRvY3VtZW50ID0gZnJhbWUtPmRvY3VtZW50KCkpCisgICAg
ICAgIGRvY3VtZW50LT5zZXRGb2N1c2VkTm9kZSgwKTsKICAgICBwYWdlKCktPmZvY3VzQ29udHJv
bGxlcigpLT5zZXRJbml0aWFsRm9jdXMoCiAgICAgICAgIHJldmVyc2UgPyBGb2N1c0RpcmVjdGlv
bkJhY2t3YXJkIDogRm9jdXNEaXJlY3Rpb25Gb3J3YXJkLAogICAgICAgICB3ZWJraXRFdmVudC5n
ZXQoKSk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>