<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Need ability to specify alternate image for AutoFill button in input fields"
   href="https://bugs.webkit.org/show_bug.cgi?id=153116">bug 153116</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #269831 Flags</td>
           <td>review?
           </td>
           <td>review+
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Need ability to specify alternate image for AutoFill button in input fields"
   href="https://bugs.webkit.org/show_bug.cgi?id=153116#c20">Comment # 20</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Need ability to specify alternate image for AutoFill button in input fields"
   href="https://bugs.webkit.org/show_bug.cgi?id=153116">bug 153116</a>
              from <span class="vcard"><a class="email" href="mailto:darin&#64;apple.com" title="Darin Adler &lt;darin&#64;apple.com&gt;"> <span class="fn">Darin Adler</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=269831&amp;action=diff" name="attach_269831" title="Patch v3">attachment 269831</a> <a href="attachment.cgi?id=269831&amp;action=edit" title="Patch v3">[details]</a></span>
Patch v3

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=269831&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=269831&amp;action=review</a>

Code is OK. Still one significant problem with it (no way to remove the auto-fill button), and a number of questionable points of style.

<span class="quote">&gt; Source/WebCore/html/HTMLTextFormControlElement.h:37
&gt; +enum class AutoFillButtonType : uint8_t { Uninitialized, Credentials, Contacts };</span >

I think that the first value is None, not Uninitialized. It means no auto-fill button at all, not “uninitialized”.

<span class="quote">&gt; Source/WebCore/html/TextFieldInputType.cpp:643
&gt; +    AtomicString pseudoClassName = autoFillButtonTypeToAutoFillButtonPseudoClassName(autoFillButtonType);
&gt; +    m_autoFillButton-&gt;setPseudo(pseudoClassName);</span >

Would read better without a local variable as a single line.

<span class="quote">&gt; Source/WebCore/html/TextFieldInputType.cpp:654
&gt; +            createAutoFillButton(element().autoFillButtonType());</span >

Missing code to remove the auto-fill button if the type changes from contacts or credentials to none.

<span class="quote">&gt; Source/WebCore/html/TextFieldInputType.cpp:657
&gt; +        AtomicString pseudoContactsAutoFillClassName = AtomicString(&quot;-webkit-contacts-auto-fill-button&quot;, AtomicString::ConstructFromLiteral);
&gt; +        AtomicString pseudoCredentialsAutoFillClassName = AtomicString(&quot;-webkit-credentials-auto-fill-button&quot;, AtomicString::ConstructFromLiteral);</span >

This is a unnecessarily slow way to write the code. You can just write attribute == &quot;-webkit-contacts-auto-fill-button&quot;; no need to do all the extra work to create an atomic string.

<span class="quote">&gt; Source/WebCore/html/TextFieldInputType.cpp:658
&gt; +        AtomicString attribute = m_autoFillButton-&gt;getAttribute(pseudoAttr);</span >

Wrong type here. It should be auto&amp;, or const AtomicString&amp; to avoid unnecessary work.

Wrong function called here. It should be fastGetAttribute.

<span class="quote">&gt; Source/WebCore/html/TextFieldInputType.cpp:659
&gt; +        bool shouldUpdateAutoFillButtonType = ((attribute == pseudoContactsAutoFillClassName &amp;&amp; element().autoFillButtonType() != AutoFillButtonType::Contacts) || (attribute == pseudoCredentialsAutoFillClassName &amp;&amp; element().autoFillButtonType() != AutoFillButtonType::Credentials));</span >

This is really hard to read. I think a helper function would make it easier to read. But I also don’t understand why we wouldn’t just call setPseudo unconditionally. Are we trying to optimize something?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>