[Webkit-unassigned] [Bug 153116] Need ability to specify alternate image for AutoFill button in input fields

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 25 17:02:38 PST 2016


https://bugs.webkit.org/show_bug.cgi?id=153116

--- Comment #18 from Zach Li <zacharyli323 at gmail.com> ---
Comment on attachment 269302
  --> https://bugs.webkit.org/attachment.cgi?id=269302
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=269302&action=review

>>> Source/WebCore/html/HTMLInputElement.h:436
>>> +    AutoFillButtonType m_autoFillButtonType;
>> 
>> This is only one bit. It’s not great that it’s going to make every HTMLInputElement 32 bits bigger (or more). Notice that all the fields around this are using bitfields to keep things cheap. Not OK to make every input element so much bigger. I think this should be:
>> 
>>     unsigned m_autoFillButtonType : 1; // AutoFillButtonType
>> 
>> To match how we do things in the rest of the class.
>> 
>> We could also consider combining this with
> 
> We could also consider combining this with the flag that says there is an auto-fill button. We don’t need to support setting the type when showAutoFillButton is false, and over time that could save us some bits.

Great suggestion! The new AutoFill button type will contain Contacts, Credentials, and Uninitialized. The Uninitialized is equivalent to the AutoFill button being not enabled.

>> Source/WebCore/html/HTMLTextFormControlElement.h:37
>> +enum class AutoFillButtonType : uint32_t { Credentials, AddressBook };
> 
> 32 bits just to hold one bit? How about 8 bits?

Will change to uint8_t.

>> Source/WebCore/html/InputType.h:268
>> +    virtual void updateAutoFillButton(AutoFillButtonType);
> 
> We should not add this argument to this function. The members functions in TextFieldInputType can get the type from the element directly; it doesn’t need to be passed in.

You are right, I can get the type from element().autoFillButtonType().

>>> Source/WebCore/html/TextFieldInputType.cpp:644
>>> +            createAutoFillButton(autoFillButtonType);
>> 
>> This looks wrong. If the auto fill button type has changed, I don’t see code to cause the old one to be destroyed and a new one of the correct type to be created.
> 
> We should make a test case that shows the auto-fill button correctly changing even when the attribute is changed after the fact.

Ideally, the case should not happen, but I will handle such case.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160126/edfdcec2/attachment.html>


More information about the webkit-unassigned mailing list