Allow clients to toggle a text input field between being viewable and having characte...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 17:24:19 +0000 (17:24 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Aug 2019 17:24:19 +0000 (17:24 +0000)
a yellow auto-filled appearance
https://bugs.webkit.org/show_bug.cgi?id=200037
rdar://problem/51900961

Patch by Priyanka Agarwal <pagarwal999@apple.com> on 2019-08-07
Reviewed by Daniel Bates.

Source/WebCore:

Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
       fast/forms/auto-fill-button/input-strong-password-viewable.html

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.

* css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp

* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilledStrongPasswordViewable):
Checking if the element is an input element and considered to be
AutoFilled and Viewable. Returns a boolean accordingly.

* css/SelectorPseudoClassAndCompatibilityElementMap.in:
Add -webkit-autofill-strong-password-viewable css class.

* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill-strong-password-viewable):
(input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
Add case handling for PseudoClassAutofillStrongPasswordViewable.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::HTMLInputElement):
Add boolean m_isAutoFilledAndViewable for representing if the
input element is both AutoFilled and should be viewable.
Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
the visual treatment should still be applied.

(WebCore::HTMLInputElement::resignStrongPasswordAppearance):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::reset):
Updates boolean representing if input element is autofilled and viewable to false.

(WebCore::HTMLInputElement::setAutoFilledAndViewable):
Setter function for the boolean of m_isAutoFilledAndViewable.

* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::isAutoFilledAndViewable const):
Creating boolean value for m_isAutoFilledAndViewable.

* testing/Internals.cpp:
(WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
* testing/Internals.h: Adding for testing purposes.
* testing/Internals.idl:

Source/WebKit:

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
Accessor function for boolean which represents if the input element is autofilled and viewable.

(-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
Accessor function for boolean which represents if the input element is autofilled and viewable.

       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
Creating function declaration for boolean setter.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
Accessor function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
Setter function for boolean which represents if the input element is autofilled and viewable.

(WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
Setter function for boolean which represents if the input element is autofilled and viewable.

* WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
Adding setter and getter functions for the boolean which represents if the input element is autofilled
and viewable.

Source/WebKitLegacy/mac:

* DOM/WebDOMOperations.mm:
(-[DOMHTMLInputElement _isAutoFilledAndViewable]):
(-[DOMHTMLInputElement _setAutoFilledAndViewable:]):
* DOM/WebDOMOperationsPrivate.h:

LayoutTests:

* fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html: Added.
Test for when the form is reset to no longer be autofilled.

* fast/forms/auto-fill-button/input-strong-password-viewable.html: Added.
Test for when the form is set to being autofilled and viewable.

* fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js:
(window.onload): Javascript used by test to set the element to be autofilled and viewable added

* platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Added.
* platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248373 268f45cc-cd09-0410-ab3c-d52691b4dbfc

35 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html [new file with mode: 0644]
LayoutTests/fast/forms/auto-fill-button/input-strong-password-viewable.html [new file with mode: 0644]
LayoutTests/fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt [new file with mode: 0644]
LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/css/CSSSelector.cpp
Source/WebCore/css/CSSSelector.h
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/css/SelectorCheckerTestFunctions.h
Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in
Source/WebCore/css/html.css
Source/WebCore/cssjit/SelectorCompiler.cpp
Source/WebCore/html/HTMLInputElement.cpp
Source/WebCore/html/HTMLInputElement.h
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit/ChangeLog
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h
Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp
Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp
Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DOM/WebDOMOperations.mm
Source/WebKitLegacy/mac/DOM/WebDOMOperationsPrivate.h

index b178ef6..8c26c60 100644 (file)
@@ -1,3 +1,24 @@
+2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
+
+        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
+        a yellow auto-filled appearance
+        https://bugs.webkit.org/show_bug.cgi?id=200037
+        rdar://problem/51900961
+
+        Reviewed by Daniel Bates.
+
+        * fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html: Added.
+        Test for when the form is reset to no longer be autofilled.
+
+        * fast/forms/auto-fill-button/input-strong-password-viewable.html: Added.
+        Test for when the form is set to being autofilled and viewable.
+
+        * fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js:
+        (window.onload): Javascript used by test to set the element to be autofilled and viewable added
+
+        * platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Added.
+        * platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:
+
 2019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Extra space inserted at start of line when inserting a newline in Mail compose
diff --git a/LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html b/LayoutTests/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
new file mode 100644 (file)
index 0000000..7b69cbf
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/process-auto-fill-button-type-and-invoke-runTest.js"></script>
+<script>
+if (window.testRunner)
+    testRunner.waitUntilDone();
+
+function runTest()
+{
+    document.forms[0].reset();
+    if (window.internals)
+        internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
+    if (window.testRunner)
+        testRunner.notifyDone();
+}
+</script>
+</head>
+<body>
+<p>This tests that that an autofilled and viewable Strong Password decorated text field reverts to its original appearance when the form is reset. It can only be tested in the test tool.</p>
+<form>
+<input type="password" value="Cupertino" data-auto-fill-button-type="StrongPassword" data-autofilled="true">
+</form>
+</body>
+</html>
diff --git a/LayoutTests/fast/forms/auto-fill-button/input-strong-password-viewable.html b/LayoutTests/fast/forms/auto-fill-button/input-strong-password-viewable.html
new file mode 100644 (file)
index 0000000..b395839
--- /dev/null
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password AutoFill and viewable visual treatment renders in an auto-filled input. It can only be tested in the test tool.</p>
+<div id="container">
+    <input type="text" value="A quick brown fox jumped over the lazy dog.">
+    <input type="password" value="A quick brown fox jumped over the lazy dog.">
+    <input type="password" value="A quick brown fox jumped over the lazy dog." style="width:300px">
+    <input type="password" value="A quick brown fox jumped over the lazy dog." style="width:20px">
+    <input type="password" value="A quick brown fox jumped over the lazy dog." style="height:100px">
+    <input type="password" value="A quick brown fox jumped over the lazy dog." style="width:20px; height:100px">
+</div>
+<script>
+if (window.internals) {
+    var inputs = document.querySelectorAll("input");
+    for (var i = 0; i < inputs.length; ++i) {
+        window.internals.setAutoFilledAndViewable(inputs[i], true);
+    }
+
+    var dynamicInput = document.createElement("input");
+    window.internals.setAutoFilledAndViewable(dynamicInput, true);
+    document.querySelector("#container").appendChild(dynamicInput);
+}
+</script>
+</body>
+</html>
+
index 628a857..6fbde6b 100644 (file)
@@ -7,6 +7,7 @@ window.onload = function ()
     let inputElements = document.getElementsByTagName("input");
     for (let inputElement of inputElements) {
         internals.setAutofilled(inputElement, inputElement.dataset.autofilled == "true");
+       internals.setAutoFilledAndViewable(inputElement, inputElement.dataset.autoFilledAndViewable == "true");
         internals.setShowAutoFillButton(inputElement, inputElement.dataset.autoFillButtonType);
     }
     if (window.runTest)
index 68f59f9..36af1fc 100644 (file)
@@ -3399,6 +3399,8 @@ webkit.org/b/180802 imported/w3c/web-platform-tests/html/webappapis/system-state
 webkit.org/b/180803 imported/w3c/web-platform-tests/media-source/mediasource-duration-boundaryconditions.html [ Failure ]
 
 webkit.org/b/181662 fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html [ Missing Failure ]
+webkit.org/b/200037 fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html [ Missing Failure ]
+webkit.org/b/200037 fast/forms/auto-fill-button/input-strong-password-viewable.html [ Missing Failure ]
 
 webkit.org/b/182050 http/wpt/fetch/response-opaque-clone.html [ Pass Crash ]
 
diff --git a/LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt b/LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt
new file mode 100644 (file)
index 0000000..ce5d778
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x105
+  RenderBlock {HTML} at (0,0) size 800x105
+    RenderBody {BODY} at (8,16) size 784x81
+      RenderBlock {P} at (0,0) size 784x40
+        RenderText {#text} at (0,0) size 782x39
+          text run at (0,0) width 782: "This tests that that an autofilled and viewable Strong Password decorated text field reverts to its original appearance when"
+          text run at (0,20) width 340: "the form is reset. It can only be tested in the test tool."
+      RenderBlock {FORM} at (0,56) size 784x25
+        RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#FFFFFF] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 123x14
+        RenderText {#text} at (0,0) size 0x0
+layer at (17,77) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14
+    RenderText {#text} at (0,0) size 60x14
+      text run at (0,0) width 60: "\x{25CF}\x{25CF}\x{25CF}\x{25CF}\x{25CF}\x{25CF}\x{25CF}\x{25CF}\x{25CF}"
diff --git a/LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt b/LayoutTests/platform/ios-simulator/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt
new file mode 100644 (file)
index 0000000..ccaeb0a
--- /dev/null
@@ -0,0 +1,64 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x211
+  RenderBlock {HTML} at (0,0) size 800x211
+    RenderBody {BODY} at (8,16) size 784x187
+      RenderBlock {P} at (0,0) size 784x40
+        RenderText {#text} at (0,0) size 768x39
+          text run at (0,0) width 768: "This tests that the Strong Password AutoFill and viewable visual treatment renders in an auto-filled input. It can only be"
+          text run at (0,20) width 137: "tested in the test tool."
+      RenderBlock {DIV} at (0,56) size 784x131
+        RenderTextControl {INPUT} at (2,3) size 153x20 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+        RenderText {#text} at (157,0) size 4x19
+          text run at (157,0) width 4: " "
+        RenderTextControl {INPUT} at (163,3) size 153x20 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 141x13
+            RenderBlock {DIV} at (0,0) size 140x12
+        RenderText {#text} at (318,0) size 4x19
+          text run at (318,0) width 4: " "
+        RenderTextControl {INPUT} at (322,3) size 313x20 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 301x13
+            RenderBlock {DIV} at (0,0) size 300x12
+        RenderText {#text} at (635,0) size 4x19
+          text run at (635,0) width 4: " "
+        RenderTextControl {INPUT} at (639,3) size 33x20 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 21x13
+            RenderBlock {DIV} at (0,0) size 20x12
+        RenderText {#text} at (0,0) size 0x0
+        RenderTextControl {INPUT} at (2,24) size 153x108 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 141x101
+            RenderBlock {DIV} at (0,44) size 140x12
+        RenderText {#text} at (157,65) size 4x19
+          text run at (157,65) width 4: " "
+        RenderTextControl {INPUT} at (161,24) size 33x108 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 21x101
+            RenderBlock {DIV} at (0,44) size 20x12
+        RenderText {#text} at (194,65) size 4x19
+          text run at (194,65) width 4: " "
+        RenderTextControl {INPUT} at (200,68) size 153x20 [bgcolor=#FAFFBD] [border: (1px solid #4C4C4C)]
+layer at (17,78) size 140x12 scrollWidth 285
+  RenderBlock {DIV} at (6,3) size 141x13
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (178,78) size 140x12 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 140x12
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (337,78) size 300x12
+  RenderBlock {DIV} at (0,0) size 300x12
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (654,78) size 20x12 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 20x12
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (17,143) size 140x12 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 140x12
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (176,143) size 20x12 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 20x12
+    RenderText {#text} at (0,0) size 284x12
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (215,143) size 140x12
+  RenderBlock {DIV} at (6,3) size 141x13
diff --git a/LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.png b/LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.png
new file mode 100644 (file)
index 0000000..8ce620b
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt b/LayoutTests/platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt
new file mode 100644 (file)
index 0000000..41d42b3
--- /dev/null
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x99
+  RenderBlock {HTML} at (0,0) size 800x99
+    RenderBody {BODY} at (8,16) size 784x75
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 780x36
+          text run at (0,0) width 780: "This tests that that an autofilled and viewable Strong Password decorated text field reverts to its original appearance when"
+          text run at (0,18) width 340: "the form is reset. It can only be tested in the test tool."
+      RenderBlock {FORM} at (0,52) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 146x19 [bgcolor=#FFFFFF] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 140x13
+            RenderBlock {DIV} at (0,0) size 140x13
+        RenderText {#text} at (0,0) size 0x0
+layer at (13,73) size 140x13
+  RenderBlock {DIV} at (0,0) size 140x13
+    RenderText {#text} at (0,0) size 47x13
+      text run at (0,0) width 47: "\x{2022}\x{2022}\x{2022}\x{2022}\x{2022}\x{2022}\x{2022}\x{2022}\x{2022}"
diff --git a/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.png b/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.png
new file mode 100644 (file)
index 0000000..4bfa11b
Binary files /dev/null and b/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt b/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt
new file mode 100644 (file)
index 0000000..3c5cf7a
--- /dev/null
@@ -0,0 +1,64 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x205
+  RenderBlock {HTML} at (0,0) size 800x205
+    RenderBody {BODY} at (8,16) size 784x181
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 767x36
+          text run at (0,0) width 767: "This tests that the Strong Password AutoFill and viewable visual treatment renders in an auto-filled input. It can only be"
+          text run at (0,18) width 137: "tested in the test tool."
+      RenderBlock {DIV} at (0,52) size 784x129
+        RenderTextControl {INPUT} at (2,2) size 158x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+        RenderText {#text} at (162,1) size 4x18
+          text run at (162,1) width 4: " "
+        RenderTextControl {INPUT} at (168,2) size 158x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 152x13
+            RenderBlock {DIV} at (0,0) size 152x13
+        RenderText {#text} at (328,1) size 4x18
+          text run at (328,1) width 4: " "
+        RenderTextControl {INPUT} at (332,2) size 306x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 300x13
+            RenderBlock {DIV} at (0,0) size 300x13
+        RenderText {#text} at (638,1) size 4x18
+          text run at (638,1) width 4: " "
+        RenderTextControl {INPUT} at (642,2) size 26x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 20x13
+            RenderBlock {DIV} at (0,0) size 20x13
+        RenderText {#text} at (0,0) size 0x0
+        RenderTextControl {INPUT} at (2,23) size 158x106 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 152x100
+            RenderBlock {DIV} at (0,43) size 152x14
+        RenderText {#text} at (162,65) size 4x18
+          text run at (162,65) width 4: " "
+        RenderTextControl {INPUT} at (166,23) size 26x106 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 20x100
+            RenderBlock {DIV} at (0,43) size 20x14
+        RenderText {#text} at (192,65) size 4x18
+          text run at (192,65) width 4: " "
+        RenderTextControl {INPUT} at (198,66) size 158x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+layer at (13,73) size 152x13 scrollWidth 285
+  RenderBlock {DIV} at (3,3) size 152x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (179,73) size 152x13 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 152x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (343,73) size 300x13
+  RenderBlock {DIV} at (0,0) size 300x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (653,73) size 20x13 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 20x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (13,138) size 152x13 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 152x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (177,138) size 20x13 scrollWidth 285
+  RenderBlock {DIV} at (0,0) size 20x13
+    RenderText {#text} at (0,0) size 284x13
+      text run at (0,0) width 284: "A quick brown fox jumped over the lazy dog."
+layer at (209,137) size 152x13
+  RenderBlock {DIV} at (3,3) size 152x13
index 9bb52fd..1a2aec3 100644 (file)
@@ -3930,6 +3930,8 @@ webkit.org/b/181346 mathml/opentype/opentype-stretchy-horizontal.html [ Failure
 webkit.org/b/181501 accessibility/table-header-calculation-for-header-rows.html [ Failure ]
 
 webkit.org/b/181662 fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html [ Failure ]
+webkit.org/b/200037 fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html [ Missing Failure ]
+webkit.org/b/200037 fast/forms/auto-fill-button/input-strong-password-viewable.html [ Missing Failure ]
 
 webkit.org/b/181854 svg/filters/feDiffuseLighting-bottomRightPixel.html [ ImageOnlyFailure ]
 
index f7fa097..e9a7477 100644 (file)
@@ -1,3 +1,66 @@
+2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
+
+        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
+        a yellow auto-filled appearance
+        https://bugs.webkit.org/show_bug.cgi?id=200037
+        rdar://problem/51900961
+
+        Reviewed by Daniel Bates.
+
+        Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
+               fast/forms/auto-fill-button/input-strong-password-viewable.html
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText const):
+        Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.
+
+        * css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable
+
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp
+
+        * css/SelectorCheckerTestFunctions.h:
+        (WebCore::isAutofilledStrongPasswordViewable):
+        Checking if the element is an input element and considered to be
+        AutoFilled and Viewable. Returns a boolean accordingly.
+
+        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+        Add -webkit-autofill-strong-password-viewable css class.
+
+        * css/html.css:
+        (input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
+        (input:-webkit-autofill-strong-password-viewable):
+        (input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.
+
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::addPseudoClassType):
+        Add case handling for PseudoClassAutofillStrongPasswordViewable.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::HTMLInputElement):
+        Add boolean m_isAutoFilledAndViewable for representing if the
+        input element is both AutoFilled and should be viewable.
+        Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
+        the visual treatment should still be applied.
+
+        (WebCore::HTMLInputElement::resignStrongPasswordAppearance):
+        Updates boolean representing if input element is autofilled and viewable to false.
+
+        (WebCore::HTMLInputElement::reset):
+        Updates boolean representing if input element is autofilled and viewable to false.
+
+        (WebCore::HTMLInputElement::setAutoFilledAndViewable):
+        Setter function for the boolean of m_isAutoFilledAndViewable.
+
+        * html/HTMLInputElement.h:
+        (WebCore::HTMLInputElement::isAutoFilledAndViewable const):
+        Creating boolean value for m_isAutoFilledAndViewable.
+
+        * testing/Internals.cpp:
+        (WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
+        * testing/Internals.h: Adding for testing purposes.
+        * testing/Internals.idl:
+
 2019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
 
         Declarations and implementations of findCaret(Min|Max)imumOffset have inconsistent signatures
index 719e5f8..47542af 100644 (file)
@@ -430,6 +430,9 @@ String CSSSelector::selectorText(const String& rightSide) const
             case CSSSelector::PseudoClassAutofillStrongPassword:
                 str.appendLiteral(":-webkit-autofill-strong-password");
                 break;
+            case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
+                str.appendLiteral(":-webkit-autofill-strong-password-viewable");
+                break;
             case CSSSelector::PseudoClassDrag:
                 str.appendLiteral(":-webkit-drag");
                 break;
index 46434e0..6be90cc 100644 (file)
@@ -108,6 +108,7 @@ namespace WebCore {
             PseudoClassAnyLinkDeprecated,
             PseudoClassAutofill,
             PseudoClassAutofillStrongPassword,
+            PseudoClassAutofillStrongPasswordViewable,
             PseudoClassHover,
             PseudoClassDrag,
             PseudoClassFocus,
index 2db31dd..e183cb8 100644 (file)
@@ -971,6 +971,8 @@ bool SelectorChecker::checkOne(CheckingContext& checkingContext, const LocalCont
             return isAutofilled(element);
         case CSSSelector::PseudoClassAutofillStrongPassword:
             return isAutofilledStrongPassword(element);
+        case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
+            return isAutofilledStrongPasswordViewable(element);
         case CSSSelector::PseudoClassAnyLink:
         case CSSSelector::PseudoClassAnyLinkDeprecated:
         case CSSSelector::PseudoClassLink:
index 631b384..8fa80cc 100644 (file)
@@ -57,6 +57,11 @@ ALWAYS_INLINE bool isAutofilledStrongPassword(const Element& element)
     return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilled() && downcast<HTMLInputElement>(element).hasAutoFillStrongPasswordButton();
 }
 
+ALWAYS_INLINE bool isAutofilledStrongPasswordViewable(const Element& element)
+{
+    return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilledAndViewable();
+}
+
 ALWAYS_INLINE bool matchesDefaultPseudoClass(const Element& element)
 {
     return element.matchesDefaultPseudoClass();
index 6d6f3f1..9155f0c 100644 (file)
@@ -3,6 +3,7 @@
 -webkit-any-link, PseudoClassAnyLinkDeprecated, PseudoElementUnknown
 -webkit-autofill
 -webkit-autofill-strong-password
+-webkit-autofill-strong-password-viewable
 -webkit-drag
 -webkit-full-page-media
 active
index 627d148..6d40c19 100644 (file)
@@ -722,13 +722,16 @@ input[type="file"] {
 }
 
 input:-webkit-autofill-strong-password {
-    -webkit-text-security: none !important;
     -webkit-user-select: none !important;
+}
+
+input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable {
+    -webkit-text-security: none !important;
     cursor: default !important;
     font-family: monospace;
 }
 
-input:-webkit-autofill, input:-webkit-autofill-strong-password {
+input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable {
     background-color: #FAFFBD !important;
     background-image: none !important;
     color: #000000 !important;
index 1148790..fb42f37 100644 (file)
@@ -540,6 +540,9 @@ static inline FunctionType addPseudoClassType(const CSSSelector& selector, Selec
     case CSSSelector::PseudoClassAutofillStrongPassword:
         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(isAutofilledStrongPassword));
         return FunctionType::SimpleSelectorChecker;
+    case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
+        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(isAutofilledStrongPasswordViewable));
+        return FunctionType::SimpleSelectorChecker;
     case CSSSelector::PseudoClassChecked:
         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(isChecked));
         return FunctionType::SimpleSelectorChecker;
index 8f4f564..0c25cdd 100644 (file)
@@ -110,6 +110,7 @@ HTMLInputElement::HTMLInputElement(const QualifiedName& tagName, Document& docum
     , m_isActivatedSubmit(false)
     , m_autocomplete(Uninitialized)
     , m_isAutoFilled(false)
+    , m_isAutoFilledAndViewable(false)
     , m_autoFillButtonType(static_cast<uint8_t>(AutoFillButtonType::None))
     , m_lastAutoFillButtonType(static_cast<uint8_t>(AutoFillButtonType::None))
     , m_isAutoFillAvailable(false)
@@ -517,6 +518,7 @@ void HTMLInputElement::resignStrongPasswordAppearance()
     if (!hasAutoFillStrongPasswordButton())
         return;
     setAutoFilled(false);
+    setAutoFilledAndViewable(false);
     setShowAutoFillButton(AutoFillButtonType::None);
     if (auto* page = document().page())
         page->chrome().client().inputElementDidResignStrongPasswordAppearance(*this);
@@ -915,6 +917,7 @@ void HTMLInputElement::reset()
         setValue(String());
 
     setAutoFilled(false);
+    setAutoFilledAndViewable(false);
     setShowAutoFillButton(AutoFillButtonType::None);
     setChecked(hasAttributeWithoutSynchronization(checkedAttr));
     m_dirtyCheckednessFlag = false;
@@ -1343,6 +1346,15 @@ void HTMLInputElement::setAutoFilled(bool autoFilled)
     invalidateStyleForSubtree();
 }
 
+void HTMLInputElement::setAutoFilledAndViewable(bool autoFilledAndViewable)
+{
+    if (autoFilledAndViewable == m_isAutoFilledAndViewable)
+        return;
+
+    m_isAutoFilledAndViewable = autoFilledAndViewable;
+    invalidateStyleForSubtree();
+}
+
 void HTMLInputElement::setShowAutoFillButton(AutoFillButtonType autoFillButtonType)
 {
     if (static_cast<uint8_t>(autoFillButtonType) == m_autoFillButtonType)
index 08114dd..f228c37 100644 (file)
@@ -240,6 +240,9 @@ public:
     bool isAutoFilled() const { return m_isAutoFilled; }
     WEBCORE_EXPORT void setAutoFilled(bool = true);
 
+    bool isAutoFilledAndViewable() const { return m_isAutoFilledAndViewable; }
+    WEBCORE_EXPORT void setAutoFilledAndViewable(bool = true);
+
     AutoFillButtonType lastAutoFillButtonType() const { return static_cast<AutoFillButtonType>(m_lastAutoFillButtonType); }
     AutoFillButtonType autoFillButtonType() const { return static_cast<AutoFillButtonType>(m_autoFillButtonType); }
     WEBCORE_EXPORT void setShowAutoFillButton(AutoFillButtonType);
@@ -465,6 +468,7 @@ private:
     bool m_isActivatedSubmit : 1;
     unsigned m_autocomplete : 2; // AutoCompleteSetting
     bool m_isAutoFilled : 1;
+    bool m_isAutoFilledAndViewable : 1;
     unsigned m_autoFillButtonType : 3; // AutoFillButtonType
     unsigned m_lastAutoFillButtonType : 3; // AutoFillButtonType
     bool m_isAutoFillAvailable : 1;
index 84ab98c..46efea2 100644 (file)
@@ -1863,6 +1863,11 @@ void Internals::setAutofilled(HTMLInputElement& element, bool enabled)
     element.setAutoFilled(enabled);
 }
 
+void Internals::setAutoFilledAndViewable(HTMLInputElement& element, bool enabled)
+{
+    element.setAutoFilledAndViewable(enabled);
+}
+
 static AutoFillButtonType toAutoFillButtonType(Internals::AutoFillButtonType type)
 {
     switch (type) {
index a9af319..2d78d8a 100644 (file)
@@ -265,6 +265,7 @@ public:
     ExceptionOr<bool> wasLastChangeUserEdit(Element& textField);
     bool elementShouldAutoComplete(HTMLInputElement&);
     void setAutofilled(HTMLInputElement&, bool enabled);
+    void setAutoFilledAndViewable(HTMLInputElement&, bool enabled);
     enum class AutoFillButtonType { None, Contacts, Credentials, StrongPassword, CreditCard };
     void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);
     AutoFillButtonType autoFillButtonType(const HTMLInputElement&);
index 7bc8604..31ef1de 100644 (file)
@@ -292,6 +292,7 @@ enum CompositingPolicy {
     [MayThrowException] boolean wasLastChangeUserEdit(Element textField);
     boolean elementShouldAutoComplete(HTMLInputElement inputElement);
     void setAutofilled(HTMLInputElement inputElement, boolean enabled);
+    void setAutoFilledAndViewable(HTMLInputElement inputElement, boolean enabled);
     void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
     AutoFillButtonType autoFillButtonType(HTMLInputElement inputElement);
     AutoFillButtonType lastAutoFillButtonType(HTMLInputElement inputElement);
index 46ee2df..d8aacee 100644 (file)
@@ -1,3 +1,40 @@
+2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
+
+        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
+        a yellow auto-filled appearance
+        https://bugs.webkit.org/show_bug.cgi?id=200037
+        rdar://problem/51900961
+
+        Reviewed by Daniel Bates.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
+        (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
+        Accessor function for boolean which represents if the input element is autofilled and viewable.
+
+        (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
+        Setter function for boolean which represents if the input element is autofilled and viewable.
+
+        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
+        (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
+        Accessor function for boolean which represents if the input element is autofilled and viewable.
+
+       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
+        Creating function declaration for boolean setter.
+
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
+        Accessor function for boolean which represents if the input element is autofilled and viewable.
+
+        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
+        Setter function for boolean which represents if the input element is autofilled and viewable.
+
+        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
+        Setter function for boolean which represents if the input element is autofilled and viewable.
+
+        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
+        Adding setter and getter functions for the boolean which represents if the input element is autofilled
+        and viewable.
+
 2019-08-07  Chris Dumez  <cdumez@apple.com>
 
         Add more threading assertions to ITP code
index 9eba283..2a4af6c 100644 (file)
@@ -51,6 +51,7 @@ WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
 
 @property (nonatomic, readonly) CGRect elementBounds;
 @property (nonatomic) BOOL HTMLInputElementIsAutoFilled;
+@property (nonatomic) BOOL HTMLInputElementIsAutoFilledAndViewable;
 @property (nonatomic, readonly) BOOL HTMLInputElementIsUserEdited;
 @property (nonatomic, readonly) BOOL HTMLTextAreaElementIsUserEdited;
 @property (nonatomic, readonly) WKWebProcessPlugInNodeHandle *HTMLTableCellElementCellAbove;
index 07412d4..b886acc 100644 (file)
     return _nodeHandle->isHTMLInputElementAutoFilled();
 }
 
+- (BOOL)HTMLInputElementIsAutoFilledAndViewable
+{
+    return _nodeHandle->isHTMLInputElementAutoFilledAndViewable();
+}
+
 - (void)setHTMLInputElementIsAutoFilled:(BOOL)isAutoFilled
 {
     _nodeHandle->setHTMLInputElementAutoFilled(isAutoFilled);
 }
 
+- (void)setHTMLInputElementIsAutoFilledAndViewable:(BOOL)isAutoFilledAndViewable
+{
+    _nodeHandle->setHTMLInputElementAutoFilledAndViewable(isAutoFilledAndViewable);
+}
+
 - (BOOL)isHTMLInputElementAutoFillButtonEnabled
 {
     return _nodeHandle->isHTMLInputElementAutoFillButtonEnabled();
index aa5fe24..fc7e00b 100644 (file)
@@ -130,6 +130,11 @@ void WKBundleNodeHandleSetHTMLInputElementAutoFilled(WKBundleNodeHandleRef htmlI
     WebKit::toImpl(htmlInputElementHandleRef)->setHTMLInputElementAutoFilled(filled);
 }
 
+void WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable(WKBundleNodeHandleRef htmlInputElementHandleRef, bool autoFilledAndViewable)
+{
+    WebKit::toImpl(htmlInputElementHandleRef)->setHTMLInputElementAutoFilledAndViewable(autoFilledAndViewable);
+}
+
 bool WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled(WKBundleNodeHandleRef htmlInputElementHandleRef)
 {
     return WebKit::toImpl(htmlInputElementHandleRef)->isHTMLInputElementAutoFillButtonEnabled();
index 07929b6..d0c9177 100644 (file)
@@ -64,6 +64,7 @@ WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementValueForUser(WKBundleNodeHan
 WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled(WKBundleNodeHandleRef htmlInputElementHandle, bool enabled);
 WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutoFilled(WKBundleNodeHandleRef htmlInputElementHandle);
 WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFilled(WKBundleNodeHandleRef htmlInputElementHandle, bool filled);
+WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable(WKBundleNodeHandleRef htmlInputElementHandle, bool autoFilledAndViewable);
 WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled(WKBundleNodeHandleRef htmlInputElementHandle);
 WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabledWithButtonType(WKBundleNodeHandleRef htmlInputElementHandle, WKAutoFillButtonType autoFillButtonType);
 WK_EXPORT WKAutoFillButtonType WKBundleNodeHandleGetHTMLInputElementAutoFillButtonType(WKBundleNodeHandleRef htmlInputElementHandle);
index 4f0e50e..519f552 100644 (file)
@@ -250,6 +250,14 @@ bool InjectedBundleNodeHandle::isHTMLInputElementAutoFilled() const
     return downcast<HTMLInputElement>(m_node.get()).isAutoFilled();
 }
 
+bool InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable() const
+{
+    if (!is<HTMLInputElement>(m_node))
+        return false;
+
+    return downcast<HTMLInputElement>(m_node.get()).isAutoFilledAndViewable();
+}
+
 void InjectedBundleNodeHandle::setHTMLInputElementAutoFilled(bool filled)
 {
     if (!is<HTMLInputElement>(m_node))
@@ -258,6 +266,14 @@ void InjectedBundleNodeHandle::setHTMLInputElementAutoFilled(bool filled)
     downcast<HTMLInputElement>(m_node.get()).setAutoFilled(filled);
 }
 
+void InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable(bool autoFilledAndViewable)
+{
+    if (!is<HTMLInputElement>(m_node))
+        return;
+
+    downcast<HTMLInputElement>(m_node.get()).setAutoFilledAndViewable(autoFilledAndViewable);
+}
+
 bool InjectedBundleNodeHandle::isHTMLInputElementAutoFillButtonEnabled() const
 {
     if (!is<HTMLInputElement>(m_node))
index 94222a9..42cf222 100644 (file)
@@ -67,7 +67,9 @@ public:
     void setHTMLInputElementValueForUser(const String&);
     void setHTMLInputElementSpellcheckEnabled(bool);
     bool isHTMLInputElementAutoFilled() const;
+    bool isHTMLInputElementAutoFilledAndViewable() const;
     void setHTMLInputElementAutoFilled(bool);
+    void setHTMLInputElementAutoFilledAndViewable(bool);
     bool isHTMLInputElementAutoFillButtonEnabled() const;
     void setHTMLInputElementAutoFillButtonEnabled(WebCore::AutoFillButtonType);
     WebCore::AutoFillButtonType htmlInputElementAutoFillButtonType() const;
index 570b15b..f6b8485 100644 (file)
@@ -1,3 +1,17 @@
+2019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
+
+        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining 
+        a yellow auto-filled appearance
+        https://bugs.webkit.org/show_bug.cgi?id=200037
+        rdar://problem/51900961
+
+        Reviewed by Daniel Bates.
+
+        * DOM/WebDOMOperations.mm:
+        (-[DOMHTMLInputElement _isAutoFilledAndViewable]):
+        (-[DOMHTMLInputElement _setAutoFilledAndViewable:]):
+        * DOM/WebDOMOperationsPrivate.h:
+
 2019-08-02  Keith Rollin  <krollin@apple.com>
 
         Consistently use Obj-C boolean literals
index fea4233..7e51001 100644 (file)
@@ -225,11 +225,21 @@ using namespace JSC;
     return downcast<HTMLInputElement>(core((DOMElement *)self))->isAutoFilled();
 }
 
+- (BOOL)_isAutoFilledAndViewable
+{
+    return downcast<HTMLInputElement>(core((DOMElement *)self))->isAutoFilledAndViewable();
+}
+
 - (void)_setAutofilled:(BOOL)autofilled
 {
     downcast<HTMLInputElement>(core((DOMElement *)self))->setAutoFilled(autofilled);
 }
 
+- (void)_setAutoFilledAndViewable:(BOOL)autoFilledAndViewable
+{
+    downcast<HTMLInputElement>(core((DOMElement *)self))->setAutoFilledAndViewable(autoFilledAndViewable);
+}
+
 @end
 
 @implementation DOMHTMLObjectElement (WebDOMHTMLObjectElementOperations)
index 769cff8..af9aeaa 100644 (file)
@@ -43,6 +43,9 @@
 @interface DOMHTMLInputElement (WebDOMHTMLInputElementOperationsPrivate)
 - (BOOL)_isAutofilled;
 - (void)_setAutofilled:(BOOL)autofilled;
+
+- (BOOL)_isAutoFilledAndViewable;
+- (void)_setAutoFilledAndViewable:(BOOL)autoFilledAndViewable;
 @end
 
 @interface DOMNode (WebDOMNodeOperationsPendingPublic)