Changeset 185166 in webkit


Ignore:
Timestamp:
Jun 3, 2015 1:44:56 PM (9 years ago)
Author:
dbates@webkit.org
Message:

AutoFill button should not be shown in read-only or disabled field
https://bugs.webkit.org/show_bug.cgi?id=145579
<rdar://problem/21212494>

Reviewed by Darin Adler.

Source/WebCore:

Fixes an issue where the AutoFill button is shown in a read-only or disabled
field. We should not show the AutoFill button in such cases.

Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html

fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
fast/forms/auto-fill-button/input-auto-fill-button.html
fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html

  • html/TextFieldInputType.cpp:

(WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
(WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
(WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
when the field is disabled or read-only.

LayoutTests:

Add tests to ensure that we do no show the AutoFill button in a read-only or disabled field.

Additionally, create directory LayoutTests/fast/forms/auto-fill-button and move existing test
LayoutTests/fast/forms/input-auto-fill-button.html and associated test results into this directory
or the platform-specific variant of this directory.

  • fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled-expected.html: Added.
  • fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html: Added.
  • fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly-expected.html: Added.
  • fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html: Added.
  • fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/fast/forms/input-auto-fill-button-expected.txt.
  • fast/forms/auto-fill-button/input-auto-fill-button.html: Renamed from LayoutTests/fast/forms/input-auto-fill-button.html.
  • fast/forms/auto-fill-button/input-disabled-auto-fill-button-expected.html: Added.
  • fast/forms/auto-fill-button/input-disabled-auto-fill-button.html: Added.
  • fast/forms/auto-fill-button/input-readonly-auto-fill-button-expected.html: Added.
  • fast/forms/auto-fill-button/input-readonly-auto-fill-button.html: Added.
  • fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button-expected.html: Added.
  • fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html: Added.
  • platform/ios-simulator/fast/forms/auto-fill-button/input-auto-fill-button-expected.png: Renamed from LayoutTests/platform/ios-simulator/fast/forms/input-auto-fill-button-expected.png.
  • platform/ios-simulator/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/forms/input-auto-fill-button-expected.txt.
  • platform/mac-mavericks/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/mac-mavericks/fast/forms/input-auto-fill-button-expected.txt.
  • platform/win/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/win/fast/forms/input-auto-fill-button-expected.txt.
Location:
trunk
Files:
14 added
3 edited
6 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r185160 r185166  
     12015-06-03  Daniel Bates  <dabates@apple.com>
     2
     3        AutoFill button should not be shown in read-only or disabled field
     4        https://bugs.webkit.org/show_bug.cgi?id=145579
     5        <rdar://problem/21212494>
     6
     7        Reviewed by Darin Adler.
     8
     9        Add tests to ensure that we do no show the AutoFill button in a read-only or disabled field.
     10
     11        Additionally, create directory LayoutTests/fast/forms/auto-fill-button and move existing test
     12        LayoutTests/fast/forms/input-auto-fill-button.html and associated test results into this directory
     13        or the platform-specific variant of this directory.
     14
     15        * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled-expected.html: Added.
     16        * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html: Added.
     17        * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly-expected.html: Added.
     18        * fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html: Added.
     19        * fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/fast/forms/input-auto-fill-button-expected.txt.
     20        * fast/forms/auto-fill-button/input-auto-fill-button.html: Renamed from LayoutTests/fast/forms/input-auto-fill-button.html.
     21        * fast/forms/auto-fill-button/input-disabled-auto-fill-button-expected.html: Added.
     22        * fast/forms/auto-fill-button/input-disabled-auto-fill-button.html: Added.
     23        * fast/forms/auto-fill-button/input-readonly-auto-fill-button-expected.html: Added.
     24        * fast/forms/auto-fill-button/input-readonly-auto-fill-button.html: Added.
     25        * fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button-expected.html: Added.
     26        * fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html: Added.
     27        * platform/ios-simulator/fast/forms/auto-fill-button/input-auto-fill-button-expected.png: Renamed from LayoutTests/platform/ios-simulator/fast/forms/input-auto-fill-button-expected.png.
     28        * platform/ios-simulator/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/ios-simulator/fast/forms/input-auto-fill-button-expected.txt.
     29        * platform/mac-mavericks/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/mac-mavericks/fast/forms/input-auto-fill-button-expected.txt.
     30        * platform/win/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt: Renamed from LayoutTests/platform/win/fast/forms/input-auto-fill-button-expected.txt.
     31
    1322015-06-02  Filip Pizlo  <fpizlo@apple.com>
    233
  • trunk/LayoutTests/platform/win/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt

    r185165 r185166  
    1010        RenderTextControl {INPUT} at (2,2) size 149x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1111          RenderFlexibleBox {DIV} at (2,3) size 145x15
    12             RenderBlock {DIV} at (0,0) size 125x15
     12            RenderBlock {DIV} at (0,0) size 129x15
    1313        RenderText {#text} at (153,3) size 4x18
    1414          text run at (153,3) width 4: " "
    1515        RenderTextControl {INPUT} at (159,2) size 149x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    1616          RenderFlexibleBox {DIV} at (2,3) size 145x15
    17             RenderBlock {DIV} at (0,0) size 125x15
     17            RenderBlock {DIV} at (0,0) size 129x15
    1818        RenderText {#text} at (310,3) size 4x18
    1919          text run at (310,3) width 4: " "
    2020        RenderTextControl {INPUT} at (316,2) size 149x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    2121          RenderFlexibleBox {DIV} at (2,3) size 145x15
    22             RenderBlock {DIV} at (0,0) size 125x15
     22            RenderBlock {DIV} at (0,0) size 129x15
    2323        RenderTextControl {INPUT} at (469,2) size 149x21 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
    24 layer at (12,47) size 125x15
    25   RenderBlock {DIV} at (0,0) size 125x15
    26 layer at (169,47) size 125x15
    27   RenderBlock {DIV} at (0,0) size 125x15
    28 layer at (326,47) size 125x15
    29   RenderBlock {DIV} at (0,0) size 125x15
     24layer at (12,47) size 129x15
     25  RenderBlock {DIV} at (0,0) size 129x15
     26layer at (169,47) size 129x15
     27  RenderBlock {DIV} at (0,0) size 129x15
     28layer at (326,47) size 129x15
     29  RenderBlock {DIV} at (0,0) size 129x15
    3030layer at (479,47) size 145x15
    3131  RenderBlock {DIV} at (2,3) size 145x15
    32 layer at (140,49) size 15x12
    33   RenderBlock {DIV} at (128,1) size 15x13 [bgcolor=#000000]
    34 layer at (297,49) size 15x12
    35   RenderBlock {DIV} at (128,1) size 15x13 [bgcolor=#000000]
    36 layer at (454,49) size 15x12
    37   RenderBlock {DIV} at (128,1) size 15x13 [bgcolor=#000000]
     32layer at (141,47) size 16x15
     33  RenderImage {DIV} at (129,0) size 16x15
     34layer at (298,47) size 16x15
     35  RenderImage {DIV} at (129,0) size 16x15
     36layer at (455,47) size 16x15
     37  RenderImage {DIV} at (129,0) size 16x15
  • trunk/Source/WebCore/ChangeLog

    r185156 r185166  
     12015-06-03  Daniel Bates  <dabates@apple.com>
     2
     3        AutoFill button should not be shown in read-only or disabled field
     4        https://bugs.webkit.org/show_bug.cgi?id=145579
     5        <rdar://problem/21212494>
     6
     7        Reviewed by Darin Adler.
     8
     9        Fixes an issue where the AutoFill button is shown in a read-only or disabled
     10        field. We should not show the AutoFill button in such cases.
     11
     12        Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
     13               fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
     14               fast/forms/auto-fill-button/input-auto-fill-button.html
     15               fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
     16               fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
     17               fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
     18
     19        * html/TextFieldInputType.cpp:
     20        (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
     21        (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
     22        (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
     23        when the field is disabled or read-only.
     24
    1252015-06-03  Brent Fulgham  <bfulgham@apple.com>
    226
  • trunk/Source/WebCore/html/TextFieldInputType.cpp

    r185089 r185166  
    359359    if (m_innerSpinButton)
    360360        m_innerSpinButton->releaseCapture();
     361    updateAutoFillButton();
    361362}
    362363
     
    365366    if (m_innerSpinButton)
    366367        m_innerSpinButton->releaseCapture();
     368    updateAutoFillButton();
    367369}
    368370
     
    571573bool TextFieldInputType::shouldDrawAutoFillButton() const
    572574{
    573     return element().showAutoFillButton();
     575    return !element().isDisabledOrReadOnly() && element().showAutoFillButton();
    574576}
    575577
Note: See TracChangeset for help on using the changeset viewer.