<?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>56809</bug_id>
          
          <creation_ts>2011-03-22 01:44:57 -0700</creation_ts>
          <short_desc>Expose Node::isFocusable() in the Chromium WebKit API</short_desc>
          <delta_ts>2011-03-24 13:06:46 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Other</rep_platform>
          <op_sys>OS X 10.5</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>1</everconfirmed>
          <reporter name="Ilya Sherman">isherman</reporter>
          <assigned_to name="Ilya Sherman">isherman</assigned_to>
          <cc>abarth</cc>
    
    <cc>commit-queue</cc>
    
    <cc>dglazkov</cc>
    
    <cc>eric</cc>
    
    <cc>fishd</cc>
    
    <cc>isherman</cc>
    
    <cc>jamesr</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>371278</commentid>
    <comment_count>0</comment_count>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-22 01:44:57 -0700</bug_when>
    <thetext>Expose Node::isFocusable() in the Chromium WebKit API</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371279</commentid>
    <comment_count>1</comment_count>
      <attachid>86439</attachid>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-22 01:45:30 -0700</bug_when>
    <thetext>Created attachment 86439
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371424</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-03-22 09:36:58 -0700</bug_when>
    <thetext>Can you explain how you&apos;re going to use this? I am not sure isFocusable is what you really need here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371705</commentid>
    <comment_count>3</comment_count>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-22 15:17:44 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Can you explain how you&apos;re going to use this? I am not sure isFocusable is what you really need here.

We want to be able to identify input elements that should not be autofilled.  In particular, we are currently failing to identify elements with style display:none or visibility:hidden.  I thought at first that Node::hasNonEmptyBoundingBox() would the right method, but it does not identify elements with visibility:hidden.

My next instinct was to add an &quot;isVisible()&quot; method, but Darin recommended against that when the aforementioned method was originally added: https://bugs.webkit.org/show_bug.cgi?id=37625

Do you know if there&apos;s a more appropriate method/approach to use here?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371715</commentid>
    <comment_count>4</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-03-22 15:28:32 -0700</bug_when>
    <thetext>Can you define formally what &quot;should not be autofilled&quot; means?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371723</commentid>
    <comment_count>5</comment_count>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-22 15:31:53 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; Can you define formally what &quot;should not be autofilled&quot; means?

The relevant sub-clause is: A field should not be autofilled if it is not currently displayed, i.e. if it is not currently user-visible.

The two common cases for this are fields styled with display:none and visibility:hidden</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371729</commentid>
    <comment_count>6</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-03-22 15:37:08 -0700</bug_when>
    <thetext>Hmm.  That&apos;s not what isFocusable() means.

My question is which side of the API is supposed to be figuring out if a node is a candidate for autofilling - is that supposed to happen on the WebKit side, or on the chrome side using data exposed through the API?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371755</commentid>
    <comment_count>7</comment_count>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-22 15:56:48 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Hmm.  That&apos;s not what isFocusable() means.

That&apos;s true.  I would have thought that&apos;s what hasNonEmptyBoundingBox() means, but apparently not :(  I don&apos;t think there is a method that means exactly what I want; but isFocusable() happens to be implemented exactly how I want.

I think it&apos;s also fully reasonable to never autofill an element that is not focusable...  I guess the phrasing I would use to motivate that is: A field should not be autofilled if the user cannot manually fill it.

&gt; My question is which side of the API is supposed to be figuring out if a node is a candidate for autofilling - is that supposed to happen on the WebKit side, or on the chrome side using data exposed through the API?

Since Chrome is really the only client, the going theory has been that it should happen on the Chrome side.  We&apos;ve been gradually moving more and more of the autofill logic out of WebCore; and wherever possible, out of the WebKit API as well.  In principle some of this logic could be shared with Safari, but I have no insight into that codebase, and it seems like a bad idea to make blind guesses.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>371757</commentid>
    <comment_count>8</comment_count>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-03-22 16:01:32 -0700</bug_when>
    <thetext>So here&apos;s some thought for food:  according to the accessibility folks, content in the fallback section of a &lt;canvas&gt; should be focusable even though the user can&apos;t &quot;see&quot; the content. See bug 50126 for instance.  What should the desired behavior be in this case?

I&apos;m not sure what bits of information you really need in the autofill code so it&apos;s hard to decide what the best level of API is - can you point me to the code that uses the WebKit API to decide if a node is an autofill candidate?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372012</commentid>
    <comment_count>9</comment_count>
    <who name="Ilya Sherman">isherman</who>
    <bug_when>2011-03-23 00:51:43 -0700</bug_when>
    <thetext>(In reply to comment #8)
&gt; So here&apos;s some thought for food:  according to the accessibility folks, content in the fallback section of a &lt;canvas&gt; should be focusable even though the user can&apos;t &quot;see&quot; the content. See bug 50126 for instance.  What should the desired behavior be in this case?

I don&apos;t really understand this example in bug 50126.  Is the expectation that if I tab through the enclosing form, that focus would eventually arrive at the fallback &lt;input&gt; element and I could type into it?  Would the canvas then update to display what I am typing?  If that&apos;s the use-case, then it probably does make sense to autofill that element.  On the other hand, if the element is focusable but the user cannot edit its value, then we probably shouldn&apos;t autofill it.

&gt; I&apos;m not sure what bits of information you really need in the autofill code so it&apos;s hard to decide what the best level of API is - can you point me to the code that uses the WebKit API to decide if a node is an autofill candidate?

Roughly, that code lives here: http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/chrome/renderer/autofill/form_manager.cc&amp;q=form_manager.cc&amp;exact_package=chromium&amp;l=847

In particular, the rough notion of &quot;the element is visible&quot; would probably be added to this if-stmt: http://codesearch.google.com/codesearch/p?hl=en#OAMlx_jo-ck/src/chrome/renderer/autofill/form_manager.cc&amp;q=form_manager.cc&amp;exact_package=chromium&amp;l=862</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372565</commentid>
    <comment_count>10</comment_count>
      <attachid>86439</attachid>
    <who name="James Robinson">jamesr</who>
    <bug_when>2011-03-23 17:40:32 -0700</bug_when>
    <thetext>Comment on attachment 86439
Patch

We talked in person and I think this looks OK.  My main concern is that this function assumes layout is up to date, but it doesn&apos;t force update if layout is not.  Some WebKit APIs force layout if it&apos;s out of date, some return incorrect results if layout is out of date, and some are incorrect if layout is up to date but do not make any effort to ensure that it is.  I wish we were a little more consistent here.

That being said, I&apos;m inclined to R+ - Dimitri or Darin, do you think this looks all right?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372849</commentid>
    <comment_count>11</comment_count>
      <attachid>86439</attachid>
    <who name="Dimitri Glazkov (Google)">dglazkov</who>
    <bug_when>2011-03-24 09:36:35 -0700</bug_when>
    <thetext>Comment on attachment 86439
Patch

ok.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372867</commentid>
    <comment_count>12</comment_count>
      <attachid>86439</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-03-24 10:03:48 -0700</bug_when>
    <thetext>Comment on attachment 86439
Patch

Clearing flags on attachment: 86439

Committed r81873: &lt;http://trac.webkit.org/changeset/81873&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>372869</commentid>
    <comment_count>13</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2011-03-24 10:03:54 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>373018</commentid>
    <comment_count>14</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2011-03-24 13:06:46 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/81873 might have broken GTK Linux 32-bit Debug
The following tests are not passing:
svg/W3C-SVG-1.1/animate-elem-46-t.svg
svg/W3C-SVG-1.1/animate-elem-82-t.svg</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>86439</attachid>
            <date>2011-03-22 01:45:30 -0700</date>
            <delta_ts>2011-03-24 10:03:48 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-56809-20110322014529.patch</filename>
            <type>text/plain</type>
            <size>2024</size>
            <attacher name="Ilya Sherman">isherman</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogODE2MTIKZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJLaXQvY2hy
b21pdW0vQ2hhbmdlTG9nIGIvU291cmNlL1dlYktpdC9jaHJvbWl1bS9DaGFuZ2VMb2cKaW5kZXgg
YmM0NGFiODQ2MDQ4ODYwNDkxODJlNDE3M2UzNjBjOGM1ZWQzZWM3YS4uYmEyMmJjZjZiNzQxNTIx
MWJmNTRiMzY4YWQxMmZhZGI0ODFiNGIxZiAxMDA2NDQKLS0tIGEvU291cmNlL1dlYktpdC9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