⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280927 in webkit


Ignore:
Timestamp:
Aug 11, 2021, 1:19:33 PM (5 years ago)
Author:
Aditya Keerthi
Message:

REGRESSION (r273072): Caps lock indicator in password field is too large
https://bugs.webkit.org/show_bug.cgi?id=228970
rdar://81546781

Reviewed by Wenson Hsieh.

Source/WebCore:

r273072 made it so that flex items with an intrinsic size will honor
their aspect ratio when computing their content size. Prior to the
change, in taller password fields, the flex item representing the caps
lock indicator would be tall and narrow. The height would stretch to
fill the container, but the width would maintain its intrinsic width of
17px. Now that aspect ratio is accounted for, the width increases to
match the height, resulting in a much larger indicator in taller password
fields.

However, while r273072 regressed the appearance of the caps lock
indicator, it merely exposed an issue with the styling of the indicator.

Consider the following test case, which is a reduced version how the
caps lock indicator is styled:

<div style="display: flex; height: 100px">

<div style="content: url(17_x_17_blue_square.svg); align-self: stretch;"></div>

</div>

Prior to r273072, this displayed a 17x17 blue square (inside a 17x100
flex item). However, in Chrome, Firefox, and WebKit after r273072, this
shows a 100x100 blue square (inside a 100x100 flex item). This is the
expected behavior now that aspect ratio is accounted for.

Consequently, to fix the issue, the width of the indicator must be
limited to a maximum value. 17px was chosen to be the max-width, as the
indicator's width would not exceed 17px prior to r273072.

Test: fast/forms/caps-lock-indicator-width.html

  • css/html.css:

(input::-webkit-caps-lock-indicator):

LayoutTests:

Added a layout test to verify that the width of the caps lock indicator
adapts to the height of the password field, but does not exceed a
maximum width.

The added test is skipped on WK1, since DumpRenderTree does not support
toggling caps lock state. Implementing the testing hook in DRT is made
difficult by the fact that, in WK1, the caps lock state is queried
directly from the OS, using GetCurrentKeyModifiers.

  • fast/forms/caps-lock-indicator-width-expected.txt: Added.
  • fast/forms/caps-lock-indicator-width.html: Added.
  • platform/ios-wk1/TestExpectations:
  • platform/mac-wk1/TestExpectations:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r280923 r280927  
     12021-08-11  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        REGRESSION (r273072): Caps lock indicator in password field is too large
     4        https://bugs.webkit.org/show_bug.cgi?id=228970
     5        rdar://81546781
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Added a layout test to verify that the width of the caps lock indicator
     10        adapts to the height of the password field, but does not exceed a
     11        maximum width.
     12
     13        The added test is skipped on WK1, since DumpRenderTree does not support
     14        toggling caps lock state. Implementing the testing hook in DRT is made
     15        difficult by the fact that, in WK1, the caps lock state is queried
     16        directly from the OS, using GetCurrentKeyModifiers.
     17
     18        * fast/forms/caps-lock-indicator-width-expected.txt: Added.
     19        * fast/forms/caps-lock-indicator-width.html: Added.
     20        * platform/ios-wk1/TestExpectations:
     21        * platform/mac-wk1/TestExpectations:
     22
    1232021-08-11  Ayumi Kojima  <ayumi_kojima@apple.com>
    224
  • trunk/LayoutTests/platform/ios-wk1/TestExpectations

    r278498 r280927  
    12961296fast/text/international/system-language [ Skip ]
    12971297
     1298# DumpRenderTree doesn't support toggling caps lock key state. WK1 reads caps lock key state directly from the OS.
     1299fast/forms/caps-lock-indicator-width.html [ Skip ]
     1300
    12981301# Imported Blink tests.
    12991302imported/blink/compositing/layer-creation/iframe-clip-removed.html [ ImageOnlyFailure ]
  • trunk/LayoutTests/platform/mac-wk1/TestExpectations

    r280766 r280927  
    322322# DumpRenderTree doesn't support logging calls to runOpenPanel.
    323323fast/forms/file/open-file-panel.html [ Skip ]
     324
     325# DumpRenderTree doesn't support toggling caps lock key state. WK1 reads caps lock key state directly from the OS.
     326fast/forms/caps-lock-indicator-width.html [ Skip ]
    324327
    325328# WK1 and WK2 mousemove events are subtly different in ways that break this test on WK1.
  • trunk/Source/WebCore/ChangeLog

    r280924 r280927  
     12021-08-11  Aditya Keerthi  <akeerthi@apple.com>
     2
     3        REGRESSION (r273072): Caps lock indicator in password field is too large
     4        https://bugs.webkit.org/show_bug.cgi?id=228970
     5        rdar://81546781
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        r273072 made it so that flex items with an intrinsic size will honor
     10        their aspect ratio when computing their content size. Prior to the
     11        change, in taller password fields, the flex item representing the caps
     12        lock indicator would be tall and narrow. The height would stretch to
     13        fill the container, but the width would maintain its intrinsic width of
     14        17px. Now that aspect ratio is accounted for, the width increases to
     15        match the height, resulting in a much larger indicator in taller password
     16        fields.
     17
     18        However, while r273072 regressed the appearance of the caps lock
     19        indicator, it merely exposed an issue with the styling of the indicator.
     20
     21        Consider the following test case, which is a reduced version how the
     22        caps lock indicator is styled:
     23
     24        <div style="display: flex; height: 100px">
     25            <div style="content: url(17_x_17_blue_square.svg); align-self: stretch;"></div>
     26        </div>
     27
     28        Prior to r273072, this displayed a 17x17 blue square (inside a 17x100
     29        flex item). However, in Chrome, Firefox, and WebKit after r273072, this
     30        shows a 100x100 blue square (inside a 100x100 flex item). This is the
     31        expected behavior now that aspect ratio is accounted for.
     32
     33        Consequently, to fix the issue, the width of the indicator must be
     34        limited to a maximum value. 17px was chosen to be the max-width, as the
     35        indicator's width would not exceed 17px prior to r273072.
     36
     37        Test: fast/forms/caps-lock-indicator-width.html
     38
     39        * css/html.css:
     40        (input::-webkit-caps-lock-indicator):
     41
    1422021-08-11  Chris Dumez  <cdumez@apple.com>
    243
  • trunk/Source/WebCore/css/html.css

    r280581 r280927  
    689689    -webkit-appearance: caps-lock-indicator;
    690690    content: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="17" height="17"><path fill="black" fill-opacity="0.4" d="M12.5 0.5A 4 4 0 0 1 16.5 4.5L 16.5 12.5A 4 4 0 0 1 12.5 16.5L 4.5 16.5A 4 4 0 0 1 0.5 12.5L 0.5 4.5A 4 4 0 0 1 4.5 0.5L 12.5 0.5M 8.5 2L 4 7L 6.25 7L 6.25 10.25L 10.75 10.25L 10.75 7L 13 7L 8.5 2M 10.75 12L 6.25 12L 6.25 14.25L 10.75 14.25L 10.75 12"/></svg>');
     691    max-width: 17px;
    691692    align-self: stretch;
    692693    flex: none;
Note: See TracChangeset for help on using the changeset viewer.