REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button...
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2018 04:17:11 +0000 (04:17 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Nov 2018 04:17:11 +0000 (04:17 +0000)
commitf514d2f15d55ca239bfc25431583de4475f86046
tree88fbb45fe72c18a46fb613816cdb65982b9a039d
parent3e60472f6a22605bc008e3c7c35d03f8c648fbcd
REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown
https://bugs.webkit.org/show_bug.cgi?id=191969
<rdar://problem/46247569>

Reviewed by Dean Jackson.

Source/WebCore:

Following r238078 we now support drawing the caps lock indicator in password fields on iOS.
However it is not meaningful to show the caps lock indicator when the Strong Password button
is visible because the password field is not editable. We should not paint the caps lock
indicator when the Strong Password button is visible.

Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html
       fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html

* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps
lock indicator when the password field has the Strong Password button.
(WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to
update the visibility of the caps lock indicator when the auto fill button has changed.

LayoutTests:

Add tests to ensure that we show or hide the caps lock indicator depending on whether the
Strong Password button is visible.

* TestExpectations: Skip the tests below on all platforms. We will selectively enable them on Mac.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible-expected.html: Added.
* fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html: Added.
* platform/mac-wk2/TestExpectations: Mark the tests above as PASS so that we run them.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238545 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html [new file with mode: 0644]
LayoutTests/fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible-expected.html [new file with mode: 0644]
LayoutTests/fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html [new file with mode: 0644]
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/html/TextFieldInputType.cpp