Title: [225879] trunk
Revision
225879
Author
dba...@webkit.org
Date
2017-12-13 16:29:31 -0800 (Wed, 13 Dec 2017)

Log Message

Add more auto fill button types
https://bugs.webkit.org/show_bug.cgi?id=180651
<rdar://problem/35891125>
And
<rdar://problem/35977943>

Reviewed by Brent Fulgham.

Source/WebCore:

Tests: fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html
       fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html
       fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
       fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
       fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html
       fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html

* English.lproj/Localizable.strings:
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Add strings for new auto fill button types.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText const):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne const):
* css/SelectorCheckerTestFunctions.h:
(WebCore::isAutofilledStrongPassword):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* css/html.css:
(input::-webkit-strong-password-auto-fill-button):
(input:-webkit-autofill-strong-password):
(input:-webkit-autofill, input:-webkit-autofill-strong-password):
(input:-webkit-autofill): Deleted.
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
Add new CSS pseudo class and CSS styles.

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::reset): Hide the auto fill button when the form is reset. This is also called
whenever we suspend the page to put it into the page cache.
(WebCore::HTMLInputElement::setShowAutoFillButton): Modified to update the editability of the inner text element
and invalidate styles for the subtree as the editability may have changed depending on the auto fill button type.

(WebCore::autoFillStrongPasswordMaskImage):
(WebCore::HTMLInputElement::createInnerTextStyle):
(WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
Adjust the look of the inner text field. This function is not const because we may need to resolve style to
generate a mask image.

* html/HTMLInputElement.h:
(WebCore::HTMLInputElement::autoFillButtonType const): Fix style nit; use a C++ style cast while I am in
this area.
(WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const): Added.

* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::createInnerTextStyle):
(WebCore::HTMLTextAreaElement::createInnerTextStyle const): Deleted.
Made this non-const because HTMLInputElement::createInnerTextStyle() needs to be non-const. See above.

* html/HTMLTextAreaElement.h:
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::isInnerTextElementEditable const):
(WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
Extract out the query to determine if the inner text element is editable into a virtual function isInnerTextElementEditable()
and have updateInnerTextElementEditability() make use of it. By default a field is considered editable if it is not disabled
or read-only. We override updateInnerTextElementEditability() in HTMLInputElement to also consider the auto fill button type.

* html/HTMLTextFormControlElement.h:
* html/TextFieldInputType.cpp:
(WebCore::autoFillButtonTypeToAccessibilityLabel):
(WebCore::autoFillButtonTypeToAutoFillButtonText):
(WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
(WebCore::isAutoFillButtonTypeChanged):
(WebCore::TextFieldInputType::createAutoFillButton):
(WebCore::TextFieldInputType::updateAutoFillButton):
Support having text for the auto fill button.

* platform/LocalizedStrings.cpp:
(WebCore::AXAutoFillStrongPasswordLabel):
(WebCore::AXAutoFillStrongConfirmationPasswordLabel):
(WebCore::autoFillStrongPasswordLabel):
* platform/LocalizedStrings.h:
Add localized strings.

* rendering/RenderTextControlSingleLine.h: Disallow scrolling depending on the auto fill button type.

* testing/Internals.cpp:
(WebCore::toAutoFillButtonType):
* testing/Internals.h:
* testing/Internals.idl:
Add support for testing.

Source/WebKit:

Adds enumerators for the new auto fill button types.

* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
(toAutoFillButtonType):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
(toAutoFillButtonType):
* WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:

LayoutTests:

* fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html: Added.
* fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html: Added.
* fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html: Added.
* fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html: Added.
* fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html: Added.
* fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html: Added.
* fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html: Added.
* fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html: Added.
* fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html: Added.
* fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html: Added.
* platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Added.
* platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Added.
* platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Added.
* platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (225878 => 225879)


--- trunk/LayoutTests/ChangeLog	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/LayoutTests/ChangeLog	2017-12-14 00:29:31 UTC (rev 225879)
@@ -1,3 +1,28 @@
+2017-12-13  Daniel Bates  <daba...@apple.com>
+
+        Add more auto fill button types
+        https://bugs.webkit.org/show_bug.cgi?id=180651
+        <rdar://problem/35891125>
+        And
+        <rdar://problem/35977943>
+
+        Reviewed by Brent Fulgham.
+
+        * fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html: Added.
+        * fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html: Added.
+        * fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html: Added.
+        * fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html: Added.
+        * fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html: Added.
+        * fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html: Added.
+        * fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html: Added.
+        * fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html: Added.
+        * fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html: Added.
+        * fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html: Added.
+        * platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Added.
+        * platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Added.
+        * platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt: Added.
+        * platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt: Added.
+
 2017-12-13  Zalan Bujtas  <za...@apple.com>
 
         RenderImage can be destroyed even before setting the style on it.

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button-expected.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that a disabled field with the Strong Password AutoFill buttons renders identical to a disabled field with the Strong Confirmation AutoFill button. It can only be tested in the test tool.</p>
+<input type="password" placeholder="disabled" disabled>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." disabled>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." style="width:300px" disabled>
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements) {
+        internals.setAutofilled(inputElement, true);
+        internals.setShowAutoFillButton(inputElement, "StrongConfirmationPassword");
+    }
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that a disabled field with the Strong Password AutoFill buttons renders identical to a disabled field with the Strong Confirmation AutoFill button. It can only be tested in the test tool.</p>
+<input type="password" placeholder="disabled" disabled>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." disabled>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." style="width:300px" disabled>
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements) {
+        internals.setAutofilled(inputElement, true);
+        internals.setShowAutoFillButton(inputElement, "StrongPassword");
+    }
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button-expected.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that a readonly field with the Strong Password AutoFill buttons renders identical to a disabled field with the Strong Confirmation AutoFill button. It can only be tested in the test tool.</p>
+<input type="password" placeholder="read only" readonly>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." readonly>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." style="width:300px" readonly>
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements) {
+        internals.setAutofilled(inputElement, true);
+        internals.setShowAutoFillButton(inputElement, "StrongConfirmationPassword");
+    }
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that a readonly field with the Strong Password AutoFill buttons renders identical to a disabled field with the Strong Confirmation AutoFill button. It can only be tested in the test tool.</p>
+<input type="password" placeholder="read only" readonly>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." readonly>
+<br>
+<input type="password" value="A quick brown fox jumped over the lazy dog." style="width:300px" readonly>
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements) {
+        internals.setAutofilled(inputElement, true);
+        internals.setShowAutoFillButton(inputElement, "StrongPassword");
+    }
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password and Strong Confirmation Password AutoFill buttons do not render in a disabled field. It can only be tested in the test tool.</p>
+<input type="password" placeholder="disabled" disabled>
+<input type="password" placeholder="disabled" disabled>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password and Strong Confirmation Password AutoFill buttons do not render in a disabled field. It can only be tested in the test tool.</p>
+<input type="password" placeholder="disabled" disabled data-auto-fill-button-type="StrongPassword">
+<input type="password" placeholder="disabled" disabled data-auto-fill-button-type="StrongConfirmationPassword">
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements)
+        internals.setShowAutoFillButton(inputElement, inputElement.dataset.autoFillButtonType);
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons-expected.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password and Strong Confirmation Password AutoFill buttons do not render read only field. It can only be tested in the test tool.</p>
+<input type="password" placeholder="read only" readonly>
+<input type="password" placeholder="read only" readonly>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password and Strong Confirmation Password AutoFill buttons do not render read only field. It can only be tested in the test tool.</p>
+<input type="password" placeholder="read only" readonly data-auto-fill-button-type="StrongPassword">
+<input type="password" placeholder="read only" readonly data-auto-fill-button-type="StrongConfirmationPassword">
+<script>
+if (window.internals) {
+    var inputElements = document.getElementsByTagName("input");
+    for (let inputElement of inputElements)
+        internals.setShowAutoFillButton(inputElement, inputElement.dataset.autoFillButtonType);
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Confirmation Password AutoFill button 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">
+</div>
+<script>
+if (window.internals) {
+    var inputs = document.querySelectorAll("input");
+    for (var i = 0; i < inputs.length; ++i) {
+        window.internals.setAutofilled(inputs[i], true);
+        window.internals.setShowAutoFillButton(inputs[i], "StrongConfirmationPassword");
+    }
+
+    var dynamicInput = document.createElement("input");
+    window.internals.setAutofilled(dynamicInput, true);
+    window.internals.setShowAutoFillButton(dynamicInput, "StrongConfirmationPassword");
+    document.querySelector("#container").appendChild(dynamicInput);
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html (0 => 225879)


--- trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html	                        (rev 0)
+++ trunk/LayoutTests/fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<body>
+<p>This tests that the Strong Password AutoFill button 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">
+</div>
+<script>
+if (window.internals) {
+    var inputs = document.querySelectorAll("input");
+    for (var i = 0; i < inputs.length; ++i) {
+        window.internals.setAutofilled(inputs[i], true);
+        window.internals.setShowAutoFillButton(inputs[i], "StrongPassword");
+    }
+
+    var dynamicInput = document.createElement("input");
+    window.internals.setAutofilled(dynamicInput, true);
+    window.internals.setShowAutoFillButton(dynamicInput, "StrongPassword");
+    document.querySelector("#container").appendChild(dynamicInput);
+}
+</script>
+</body>
+</html>

Added: trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt (0 => 225879)


--- trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,46 @@
+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 766x39
+          text run at (0,0) width 766: "This tests that the Strong Confirmation Password AutoFill button renders in an auto-filled input. It can only be tested in"
+          text run at (0,20) width 79: "the test tool."
+      RenderBlock {DIV} at (0,56) size 784x25
+        RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (122,7) size 0x0
+        RenderText {#text} at (139,1) size 5x19
+          text run at (139,1) width 5: " "
+        RenderTextControl {INPUT} at (145,2) size 136x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (122,7) size 0x0
+        RenderText {#text} at (282,1) size 5x19
+          text run at (282,1) width 5: " "
+        RenderTextControl {INPUT} at (286,2) size 314x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 301x15
+            RenderBlock {DIV} at (0,0) size 300x14
+            RenderBlock {DIV} at (300,7) size 0x0
+        RenderText {#text} at (599,1) size 5x19
+          text run at (599,1) width 5: " "
+        RenderTextControl {INPUT} at (605,2) size 137x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 123x14
+            RenderBlock {DIV} at (122,7) size 0x0
+layer at (17,77) size 122x14 scrollWidth 215
+  RenderBlock {DIV} at (0,0) size 123x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (160,77) size 122x14 scrollWidth 215
+  RenderBlock {DIV} at (0,0) size 123x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (301,77) size 300x14
+  RenderBlock {DIV} at (0,0) size 300x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (620,77) size 122x14
+  RenderBlock {DIV} at (0,0) size 123x14 [color=#00000099]

Added: trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt (0 => 225879)


--- trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,53 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x85
+  RenderBlock {HTML} at (0,0) size 800x85
+    RenderBody {BODY} at (8,16) size 784x61
+      RenderBlock {P} at (0,0) size 784x20
+        RenderText {#text} at (0,0) size 758x19
+          text run at (0,0) width 758: "This tests that the Strong Password AutoFill button renders in an auto-filled input. It can only be tested in the test tool."
+      RenderBlock {DIV} at (0,36) size 784x25
+        RenderTextControl {INPUT} at (2,2) size 136x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 30x14
+            RenderBlock {DIV} at (29,0) size 94x14
+              RenderText {#text} at (6,0) size 88x14
+                text run at (6,0) width 88: "strong password"
+        RenderText {#text} at (139,1) size 5x19
+          text run at (139,1) width 5: " "
+        RenderTextControl {INPUT} at (145,2) size 136x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 30x14
+            RenderBlock {DIV} at (29,0) size 94x14
+              RenderText {#text} at (6,0) size 88x14
+                text run at (6,0) width 88: "strong password"
+        RenderText {#text} at (282,1) size 5x19
+          text run at (282,1) width 5: " "
+        RenderTextControl {INPUT} at (286,2) size 314x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 301x15
+            RenderBlock {DIV} at (0,0) size 207x14
+            RenderBlock {DIV} at (206,0) size 94x14
+              RenderText {#text} at (6,0) size 88x14
+                text run at (6,0) width 88: "strong password"
+        RenderText {#text} at (599,1) size 5x19
+          text run at (599,1) width 5: " "
+        RenderTextControl {INPUT} at (605,2) size 137x22 [bgcolor=#F7EC87] [border: (1px solid #4C4C4C)]
+          RenderFlexibleBox {DIV} at (6,3) size 123x15
+            RenderBlock {DIV} at (0,0) size 30x14
+            RenderBlock {DIV} at (29,0) size 94x14
+              RenderText {#text} at (6,0) size 88x14
+                text run at (6,0) width 88: "strong password"
+layer at (17,57) size 29x14 scrollWidth 215
+  RenderBlock {DIV} at (0,0) size 30x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (160,57) size 29x14 scrollWidth 215
+  RenderBlock {DIV} at (0,0) size 30x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (301,57) size 207x14 scrollWidth 215
+  RenderBlock {DIV} at (0,0) size 207x14 [color=#00000099]
+    RenderText {#text} at (0,0) size 216x14
+      text run at (0,0) width 216: "A quick brown fox jumped over the lazy dog."
+layer at (620,57) size 29x14
+  RenderBlock {DIV} at (0,0) size 30x14 [color=#00000099]

Added: trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt (0 => 225879)


--- trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button-expected.txt	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,46 @@
+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 764x36
+          text run at (0,0) width 764: "This tests that the Strong Confirmation Password AutoFill button renders in an auto-filled input. It can only be tested in"
+          text run at (0,18) width 79: "the test tool."
+      RenderBlock {DIV} at (0,52) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 137x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 131x13
+            RenderBlock {DIV} at (130,6) size 0x0
+        RenderText {#text} at (140,2) size 5x18
+          text run at (140,2) width 5: " "
+        RenderTextControl {INPUT} at (146,2) size 137x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 131x13
+            RenderBlock {DIV} at (130,6) size 0x0
+        RenderText {#text} at (284,2) size 5x18
+          text run at (284,2) width 5: " "
+        RenderTextControl {INPUT} at (288,2) size 307x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 300x13
+            RenderBlock {DIV} at (0,0) size 300x13
+            RenderBlock {DIV} at (300,6) size 0x0
+        RenderText {#text} at (594,2) size 5x18
+          text run at (594,2) width 5: " "
+        RenderTextControl {INPUT} at (600,2) size 138x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 131x13
+            RenderBlock {DIV} at (130,6) size 0x0
+layer at (13,73) size 130x13 scrollWidth 236
+  RenderBlock {DIV} at (0,0) size 131x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (157,73) size 130x13 scrollWidth 236
+  RenderBlock {DIV} at (0,0) size 131x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (300,73) size 300x13
+  RenderBlock {DIV} at (0,0) size 300x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (612,73) size 130x13
+  RenderBlock {DIV} at (0,0) size 131x13 [color=#00000099]

Added: trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt (0 => 225879)


--- trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/forms/auto-fill-button/input-strong-password-auto-fill-button-expected.txt	2017-12-14 00:29:31 UTC (rev 225879)
@@ -0,0 +1,53 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x81
+  RenderBlock {HTML} at (0,0) size 800x81
+    RenderBody {BODY} at (8,16) size 784x57
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 757x18
+          text run at (0,0) width 757: "This tests that the Strong Password AutoFill button renders in an auto-filled input. It can only be tested in the test tool."
+      RenderBlock {DIV} at (0,34) size 784x23
+        RenderTextControl {INPUT} at (2,2) size 137x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 37x13
+            RenderBlock {DIV} at (36,0) size 95x13
+              RenderText {#text} at (6,0) size 89x13
+                text run at (6,0) width 89: "strong password"
+        RenderText {#text} at (140,2) size 5x18
+          text run at (140,2) width 5: " "
+        RenderTextControl {INPUT} at (146,2) size 137x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 37x13
+            RenderBlock {DIV} at (36,0) size 95x13
+              RenderText {#text} at (6,0) size 89x13
+                text run at (6,0) width 89: "strong password"
+        RenderText {#text} at (284,2) size 5x18
+          text run at (284,2) width 5: " "
+        RenderTextControl {INPUT} at (288,2) size 307x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 300x13
+            RenderBlock {DIV} at (0,0) size 206x13
+            RenderBlock {DIV} at (205,0) size 95x13
+              RenderText {#text} at (6,0) size 89x13
+                text run at (6,0) width 89: "strong password"
+        RenderText {#text} at (594,2) size 5x18
+          text run at (594,2) width 5: " "
+        RenderTextControl {INPUT} at (600,2) size 138x19 [bgcolor=#FAFFBD] [border: (2px inset #000000)]
+          RenderFlexibleBox {DIV} at (3,3) size 131x13
+            RenderBlock {DIV} at (0,0) size 37x13
+            RenderBlock {DIV} at (36,0) size 95x13
+              RenderText {#text} at (6,0) size 89x13
+                text run at (6,0) width 89: "strong password"
+layer at (13,55) size 36x13 scrollWidth 236
+  RenderBlock {DIV} at (0,0) size 37x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (157,55) size 36x13 scrollWidth 236
+  RenderBlock {DIV} at (0,0) size 37x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (300,55) size 206x13 scrollWidth 236
+  RenderBlock {DIV} at (0,0) size 206x13 [color=#00000099]
+    RenderText {#text} at (0,0) size 236x13
+      text run at (0,0) width 236: "A quick brown fox jumped over the lazy dog."
+layer at (612,55) size 36x13
+  RenderBlock {DIV} at (0,0) size 37x13 [color=#00000099]

Modified: trunk/Source/WebCore/ChangeLog (225878 => 225879)


--- trunk/Source/WebCore/ChangeLog	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/ChangeLog	2017-12-14 00:29:31 UTC (rev 225879)
@@ -1,3 +1,96 @@
+2017-12-13  Daniel Bates  <daba...@apple.com>
+
+        Add more auto fill button types
+        https://bugs.webkit.org/show_bug.cgi?id=180651
+        <rdar://problem/35891125>
+        And
+        <rdar://problem/35977943>
+
+        Reviewed by Brent Fulgham.
+
+        Tests: fast/forms/auto-fill-button/input-autofilled-disabled-strong-password-auto-fill-button.html
+               fast/forms/auto-fill-button/input-autofilled-readonly-strong-password-auto-fill-button.html
+               fast/forms/auto-fill-button/input-disabled-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
+               fast/forms/auto-fill-button/input-readonly-strong-password-and-strong-confirmation-password-auto-fill-buttons.html
+               fast/forms/auto-fill-button/input-strong-confirmation-password-auto-fill-button.html
+               fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html
+
+        * English.lproj/Localizable.strings:
+        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
+        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Add strings for new auto fill button types.
+
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText const):
+        * css/CSSSelector.h:
+        * css/SelectorChecker.cpp:
+        (WebCore::SelectorChecker::checkOne const):
+        * css/SelectorCheckerTestFunctions.h:
+        (WebCore::isAutofilledStrongPassword):
+        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
+        * css/html.css:
+        (input::-webkit-strong-password-auto-fill-button):
+        (input:-webkit-autofill-strong-password):
+        (input:-webkit-autofill, input:-webkit-autofill-strong-password):
+        (input:-webkit-autofill): Deleted.
+        * cssjit/SelectorCompiler.cpp:
+        (WebCore::SelectorCompiler::addPseudoClassType):
+        Add new CSS pseudo class and CSS styles.
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::reset): Hide the auto fill button when the form is reset. This is also called
+        whenever we suspend the page to put it into the page cache.
+        (WebCore::HTMLInputElement::setShowAutoFillButton): Modified to update the editability of the inner text element
+        and invalidate styles for the subtree as the editability may have changed depending on the auto fill button type.
+
+        (WebCore::autoFillStrongPasswordMaskImage):
+        (WebCore::HTMLInputElement::createInnerTextStyle):
+        (WebCore::HTMLInputElement::createInnerTextStyle const): Deleted.
+        Adjust the look of the inner text field. This function is not const because we may need to resolve style to
+        generate a mask image.
+
+        * html/HTMLInputElement.h:
+        (WebCore::HTMLInputElement::autoFillButtonType const): Fix style nit; use a C++ style cast while I am in
+        this area.
+        (WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const): Added.
+
+        * html/HTMLTextAreaElement.cpp:
+        (WebCore::HTMLTextAreaElement::createInnerTextStyle):
+        (WebCore::HTMLTextAreaElement::createInnerTextStyle const): Deleted.
+        Made this non-const because HTMLInputElement::createInnerTextStyle() needs to be non-const. See above.
+
+        * html/HTMLTextAreaElement.h:
+        * html/HTMLTextFormControlElement.cpp:
+        (WebCore::HTMLTextFormControlElement::isInnerTextElementEditable const):
+        (WebCore::HTMLTextFormControlElement::updateInnerTextElementEditability):
+        Extract out the query to determine if the inner text element is editable into a virtual function isInnerTextElementEditable()
+        and have updateInnerTextElementEditability() make use of it. By default a field is considered editable if it is not disabled
+        or read-only. We override updateInnerTextElementEditability() in HTMLInputElement to also consider the auto fill button type.
+
+        * html/HTMLTextFormControlElement.h:
+        * html/TextFieldInputType.cpp:
+        (WebCore::autoFillButtonTypeToAccessibilityLabel):
+        (WebCore::autoFillButtonTypeToAutoFillButtonText):
+        (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
+        (WebCore::isAutoFillButtonTypeChanged):
+        (WebCore::TextFieldInputType::createAutoFillButton):
+        (WebCore::TextFieldInputType::updateAutoFillButton):
+        Support having text for the auto fill button.
+
+        * platform/LocalizedStrings.cpp:
+        (WebCore::AXAutoFillStrongPasswordLabel):
+        (WebCore::AXAutoFillStrongConfirmationPasswordLabel):
+        (WebCore::autoFillStrongPasswordLabel):
+        * platform/LocalizedStrings.h:
+        Add localized strings.
+
+        * rendering/RenderTextControlSingleLine.h: Disallow scrolling depending on the auto fill button type.
+
+        * testing/Internals.cpp:
+        (WebCore::toAutoFillButtonType):
+        * testing/Internals.h:
+        * testing/Internals.idl:
+        Add support for testing.
+
 2017-12-13  Ryosuke Niwa  <rn...@webkit.org>
 
         Crash inside ImageLoader::updateFromElement()

Modified: trunk/Source/WebCore/English.lproj/Localizable.strings (225878 => 225879)


--- trunk/Source/WebCore/English.lproj/Localizable.strings	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/English.lproj/Localizable.strings	2017-12-14 00:29:31 UTC (rev 225879)
@@ -1254,3 +1254,12 @@
 
 /* Alternative presentation button subtitle. */
 "alternative presentation button subtitle" = "alternative presentation button subtitle";
+
+/* Label for strong password. */
+"strong password" = "strong password";
+
+/* Label for the auto fill strong password button inside a text field. */
+"strong password auto fill" = "strong password auto fill";
+
+/* Label for the auto fill strong confirmation password button inside a text field. */
+"strong confirmation password auto fill" = "strong confirmation password auto fill";

Modified: trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm (225878 => 225879)


--- trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm	2017-12-14 00:29:31 UTC (rev 225879)
@@ -3084,6 +3084,10 @@
             return @"credentials";
         case AutoFillButtonType::Contacts:
             return @"contacts";
+        case AutoFillButtonType::StrongConfirmationPassword:
+            return @"strong confirmation password";
+        case AutoFillButtonType::StrongPassword:
+            return @"strong password";
         }
     }
     

Modified: trunk/Source/WebCore/css/CSSSelector.cpp (225878 => 225879)


--- trunk/Source/WebCore/css/CSSSelector.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/CSSSelector.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -434,6 +434,9 @@
             case CSSSelector::PseudoClassAutofill:
                 str.appendLiteral(":-webkit-autofill");
                 break;
+            case CSSSelector::PseudoClassAutofillStrongPassword:
+                str.appendLiteral(":-webkit-autofill-strong-password");
+                break;
             case CSSSelector::PseudoClassDrag:
                 str.appendLiteral(":-webkit-drag");
                 break;

Modified: trunk/Source/WebCore/css/CSSSelector.h (225878 => 225879)


--- trunk/Source/WebCore/css/CSSSelector.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/CSSSelector.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -107,6 +107,7 @@
             PseudoClassAnyLink,
             PseudoClassAnyLinkDeprecated,
             PseudoClassAutofill,
+            PseudoClassAutofillStrongPassword,
             PseudoClassHover,
             PseudoClassDrag,
             PseudoClassFocus,

Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (225878 => 225879)


--- trunk/Source/WebCore/css/SelectorChecker.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -942,6 +942,8 @@
             break;
         case CSSSelector::PseudoClassAutofill:
             return isAutofilled(element);
+        case CSSSelector::PseudoClassAutofillStrongPassword:
+            return isAutofilledStrongPassword(element);
         case CSSSelector::PseudoClassAnyLink:
         case CSSSelector::PseudoClassAnyLinkDeprecated:
         case CSSSelector::PseudoClassLink:

Modified: trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h (225878 => 225879)


--- trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -45,6 +45,11 @@
     return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilled();
 }
 
+ALWAYS_INLINE bool isAutofilledStrongPassword(const Element& element)
+{
+    return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilled() && downcast<HTMLInputElement>(element).hasAutoFillStrongPasswordButton();
+}
+
 ALWAYS_INLINE bool matchesDefaultPseudoClass(const Element& element)
 {
     return element.matchesDefaultPseudoClass();

Modified: trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in (225878 => 225879)


--- trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in	2017-12-14 00:29:31 UTC (rev 225879)
@@ -2,6 +2,7 @@
 -webkit-any
 -webkit-any-link, PseudoClassAnyLinkDeprecated, PseudoElementUnknown
 -webkit-autofill
+-webkit-autofill-strong-password
 -webkit-drag
 -webkit-full-page-media
 active

Modified: trunk/Source/WebCore/css/html.css (225878 => 225879)


--- trunk/Source/WebCore/css/html.css	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/css/html.css	2017-12-14 00:29:31 UTC (rev 225879)
@@ -542,6 +542,17 @@
     -webkit-user-select: none;
 }
 
+input::-webkit-strong-password-auto-fill-button {
+    flex: none !important;
+    font-family: -apple-system !important;
+    -webkit-text-security: none !important;
+    -webkit-user-select: none !important;
+    pointer-events: none !important;
+    text-align: right !important;
+    color: black !important;
+    padding-left: 6px !important;
+}
+
 input::-webkit-credentials-auto-fill-button {
     -webkit-mask-image: -webkit-image-set(url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA8AAAAMCAYAAAC9QufkAAAAAXNSR0IB2cksfwAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAADyWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA0LTAzVDE2OjA2OjI1PC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNCAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNC0wM1QxNjowMzoxNjwveG1wOkNyZWF0ZURhdGU
 +CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4xNTwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgoz37ZdAAAA5ElEQVQoFY2RsQ5BQRBFd9EgEYXv8QlaEqVGpfUPao3oKXyEQiJI1ERESaGmwnPu2k2QJ2uS82Z2du7s7jyTJInBWnCABeygoXwM6kwN1GELFo7wgOo/4gmFEovzWzyMiTMUlyFYJQT4wlucGko8T90xZv0j/5EusVpCuLr8FPK6NraHPmT8Oks8gI2bKEEOZhAauEJf3PX5Eb4ImpEG2gni0NWJvwdFYRvuoIHeoOUa++56+wpSxb6myf4J6qG5VWCt1ckPvHsksf531HSiDJ1VV9n15eJfJ+YkvWcMF+jFZa+KJ554xIc+jempAAAAAElFTkSuQmCC") 1x, url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAYCAYAAADtaU2/AAAAAXNSR0IB2cks
 fwAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsTAAALEwEAmpwYAAADyWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOnRpZmY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vdGlmZi8xLjAvIgogICAgICAgICAgICB4bWxuczpleGlmPSJodHRwOi8vbnMuYWRvYmUuY29tL2V4aWYvMS4wLyI+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA0LTAzVDE2OjA2OjIxPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNCAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNC0wM1QxNjowMzoyNTwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyPC90aWZmOllSZXNvbHV0aW9uPgogICAgICAgICA8dGlmZjpSZXNvb
 HV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjwvdGlmZjpYUmVzb2x1dGlvbj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4zMDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4yNDwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpGMDB3AAAB8UlEQVRIDbVWO07DQBS0QSJUNJQcAloOQMEZ6InSUMEBkFJEQihQkQKJklQUlFBQQoH4SHAKJDokAgIz4+wLs5u15RjypOF9dvaN197dkCS/NodwC7gG3hxuXI1jUcuyLKkDa7aE4B7IHM7hCcs5Rs6Y1RHlHBpXo6JXeXX45xLOxB8QN2QsD+sKz2B2E1iRhqnEsxIvI96U/M8hv6mtyjxXehGpk+tZ3RVzdQOgcPN4KkPuvNbse2mtSsxXPYl9TkIu41L4rowQjD0Fee2UwqcTzA65/TRNB0CzSg/ygHegT34D4FGxjVXkHx0XbmQfiIzfKtto4LWEy3m58XLQs2zNzPPByAltGwXj0EfFUecbUd4O8pFxZ98CSrC4bNfvypxvxBu6cubAl3DaRSfBxNRjXtxckw5GjU+RXJweUNGOPRTqnrWRWQP1HkkTaRSK98CLioYr5vV4BqigxarlxSbsmu0XzO8qLxRmw/WCiRyLmjYEgTfhEWAPTM88VV4ozDP9HEyyBijHLdKQ4l2AR+YAGBMNhcFJVgETU8+xqIXCVXNtxm9cdJyU58VVhUKe/khwB+55XaeYqDC/zd
 oUtbzWFDPj7fQCLFjB+Vf4xaA2SvkK65iumLvwJNLkOFL79xJXfQhwlQTjsnu61r+2fEs/b4ZbzrEPMzEAAAAASUVORK5CYII=") 2x);
     -webkit-mask-size: 15px 12px;
@@ -646,7 +657,14 @@
     text-align: start !important;
 }
 
-input:-webkit-autofill {
+input:-webkit-autofill-strong-password {
+    -webkit-text-security: none !important;
+    -webkit-user-select: none !important;
+    cursor: default !important;
+    font-family: monospace;
+}
+
+input:-webkit-autofill, input:-webkit-autofill-strong-password {
 #if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS
     background-color: #F7EC87 !important;
 #else

Modified: trunk/Source/WebCore/cssjit/SelectorCompiler.cpp (225878 => 225879)


--- trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/cssjit/SelectorCompiler.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -532,6 +532,9 @@
     case CSSSelector::PseudoClassAutofill:
         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isAutofilled));
         return FunctionType::SimpleSelectorChecker;
+    case CSSSelector::PseudoClassAutofillStrongPassword:
+        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isAutofilledStrongPassword));
+        return FunctionType::SimpleSelectorChecker;
     case CSSSelector::PseudoClassChecked:
         fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr(isChecked));
         return FunctionType::SimpleSelectorChecker;

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -31,7 +31,9 @@
 
 #include "AXObjectCache.h"
 #include "BeforeTextInsertedEvent.h"
+#include "CSSGradientValue.h"
 #include "CSSPropertyNames.h"
+#include "CSSValuePool.h"
 #include "DateTimeChooser.h"
 #include "Document.h"
 #include "Editor.h"
@@ -917,6 +919,7 @@
         setValue(String());
 
     setAutoFilled(false);
+    setShowAutoFillButton(AutoFillButtonType::None);
     setChecked(hasAttributeWithoutSynchronization(checkedAttr));
     m_reflectsCheckedAttribute = true;
 }
@@ -1375,6 +1378,8 @@
 
     m_autoFillButtonType = static_cast<uint8_t>(autoFillButtonType);
     m_inputType->updateAutoFillButton();
+    updateInnerTextElementEditability();
+    invalidateStyleForSubtree();
 }
 
 FileList* HTMLInputElement::files()
@@ -2039,8 +2044,25 @@
     return { };
 }
 
-RenderStyle HTMLInputElement::createInnerTextStyle(const RenderStyle& style) const
+static Ref<CSSLinearGradientValue> autoFillStrongPasswordMaskImage()
 {
+    CSSGradientColorStop firstStop;
+    firstStop.m_color = CSSValuePool::singleton().createColorValue(Color::black);
+    firstStop.m_position = CSSValuePool::singleton().createValue(3, CSSPrimitiveValue::UnitType::CSS_EMS);
+
+    CSSGradientColorStop secondStop;
+    secondStop.m_color = CSSValuePool::singleton().createColorValue(Color::transparent);
+    secondStop.m_position = CSSValuePool::singleton().createValue(7, CSSPrimitiveValue::UnitType::CSS_EMS);
+
+    auto gradient = CSSLinearGradientValue::create(CSSGradientRepeat::NonRepeating, CSSGradientType::CSSLinearGradient);
+    gradient->setAngle(CSSValuePool::singleton().createValue(90, CSSPrimitiveValue::UnitType::CSS_DEG));
+    gradient->addStop(firstStop);
+    gradient->addStop(secondStop);
+    return gradient;
+}
+
+RenderStyle HTMLInputElement::createInnerTextStyle(const RenderStyle& style)
+{
     auto textBlockStyle = RenderStyle::create();
     textBlockStyle.inheritFrom(style);
     adjustInnerTextStyle(style, textBlockStyle);
@@ -2051,12 +2073,21 @@
     textBlockStyle.setOverflowY(OHIDDEN);
     textBlockStyle.setTextOverflow(shouldTruncateText(style) ? TextOverflowEllipsis : TextOverflowClip);
 
+    textBlockStyle.setDisplay(BLOCK);
+
+    if (hasAutoFillStrongPasswordButton()) {
+        textBlockStyle.setColor({ 0.0f, 0.0f, 0.0f, 0.6f });
+        textBlockStyle.setTextOverflow(TextOverflowClip);
+        textBlockStyle.setMaskImage(styleResolver().styleImage(autoFillStrongPasswordMaskImage()));
+        // A stacking context is needed for the mask.
+        if (textBlockStyle.hasAutoZIndex())
+            textBlockStyle.setZIndex(0);
+    }
+
     // Do not allow line-height to be smaller than our default.
     if (textBlockStyle.fontMetrics().lineSpacing() > style.computedLineHeight())
         textBlockStyle.setLineHeight(RenderStyle::initialLineHeight());
 
-    textBlockStyle.setDisplay(BLOCK);
-
     return textBlockStyle;
 }
 

Modified: trunk/Source/WebCore/html/HTMLInputElement.h (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLInputElement.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLInputElement.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -135,7 +135,7 @@
     HTMLElement* containerElement() const;
     
     RefPtr<TextControlInnerTextElement> innerTextElement() const final;
-    RenderStyle createInnerTextStyle(const RenderStyle&) const override;
+    RenderStyle createInnerTextStyle(const RenderStyle&) override;
 
     HTMLElement* innerBlockElement() const;
     HTMLElement* innerSpinButtonElement() const;
@@ -244,9 +244,11 @@
     bool isAutoFilled() const { return m_isAutoFilled; }
     WEBCORE_EXPORT void setAutoFilled(bool = true);
 
-    AutoFillButtonType autoFillButtonType() const { return (AutoFillButtonType)m_autoFillButtonType; }
+    AutoFillButtonType autoFillButtonType() const { return static_cast<AutoFillButtonType>(m_autoFillButtonType); }
     WEBCORE_EXPORT void setShowAutoFillButton(AutoFillButtonType);
 
+    bool hasAutoFillStrongPasswordButton() const  { return autoFillButtonType() == AutoFillButtonType::StrongPassword || autoFillButtonType() == AutoFillButtonType::StrongConfirmationPassword; }
+
     bool isAutoFillAvailable() const { return m_isAutoFillAvailable; }
     void setAutoFillAvailable(bool autoFillAvailable) { m_isAutoFillAvailable = autoFillAvailable; }
 
@@ -371,6 +373,8 @@
     void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) final;
     bool shouldUseInputMethod() final;
 
+    bool isInnerTextElementEditable() const final { return !hasAutoFillStrongPasswordButton() && HTMLTextFormControlElement::isInnerTextElementEditable(); }
+
     bool canTriggerImplicitSubmission() const final { return isTextField(); }
 
     const AtomicString& formControlType() const final;
@@ -458,7 +462,7 @@
     bool m_isActivatedSubmit : 1;
     unsigned m_autocomplete : 2; // AutoCompleteSetting
     bool m_isAutoFilled : 1;
-    unsigned m_autoFillButtonType : 2; // AutoFillButtonType;
+    unsigned m_autoFillButtonType : 3; // AutoFillButtonType;
     bool m_isAutoFillAvailable : 1;
 #if ENABLE(DATALIST_ELEMENT)
     bool m_hasNonEmptyList : 1;

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.cpp (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -546,7 +546,7 @@
     return !isDisabledFormControl();
 }
 
-RenderStyle HTMLTextAreaElement::createInnerTextStyle(const RenderStyle& style) const
+RenderStyle HTMLTextAreaElement::createInnerTextStyle(const RenderStyle& style)
 {
     auto textBlockStyle = RenderStyle::create();
     textBlockStyle.inheritFrom(style);

Modified: trunk/Source/WebCore/html/HTMLTextAreaElement.h (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLTextAreaElement.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLTextAreaElement.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -54,7 +54,7 @@
     bool isValidValue(const String&) const;
     
     RefPtr<TextControlInnerTextElement> innerTextElement() const final;
-    RenderStyle createInnerTextStyle(const RenderStyle&) const final;
+    RenderStyle createInnerTextStyle(const RenderStyle&) final;
     void copyNonAttributePropertiesFromElement(const Element&) final;
 
     void rendererWillBeDestroyed();

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -511,10 +511,17 @@
     updateInnerTextElementEditability();
 }
 
+bool HTMLTextFormControlElement::isInnerTextElementEditable() const
+{
+    return !isDisabledOrReadOnly();
+}
+
 void HTMLTextFormControlElement::updateInnerTextElementEditability()
 {
-    if (auto innerText = innerTextElement())
-        innerText->setAttributeWithoutSynchronization(contenteditableAttr, isDisabledOrReadOnly() ? "false" : "plaintext-only");
+    if (auto innerText = innerTextElement()) {
+        auto value = isInnerTextElementEditable() ? AtomicString { "plaintext-only", AtomicString::ConstructFromLiteral } : AtomicString { "false", AtomicString::ConstructFromLiteral };
+        innerText->setAttributeWithoutSynchronization(contenteditableAttr, value);
+    }
 }
 
 bool HTMLTextFormControlElement::lastChangeWasUserEdit() const

Modified: trunk/Source/WebCore/html/HTMLTextFormControlElement.h (225878 => 225879)


--- trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/HTMLTextFormControlElement.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -33,7 +33,7 @@
 class TextControlInnerTextElement;
 class VisiblePosition;
 
-enum class AutoFillButtonType : uint8_t { None, Credentials, Contacts };
+enum class AutoFillButtonType : uint8_t { None, Credentials, Contacts, StrongConfirmationPassword, StrongPassword };
 enum TextFieldSelectionDirection { SelectionHasNoDirection, SelectionHasForwardDirection, SelectionHasBackwardDirection };
 enum TextFieldEventBehavior { DispatchNoEvent, DispatchChangeEvent, DispatchInputAndChangeEvent };
 
@@ -82,7 +82,7 @@
     virtual String value() const = 0;
 
     virtual RefPtr<TextControlInnerTextElement> innerTextElement() const = 0;
-    virtual RenderStyle createInnerTextStyle(const RenderStyle&) const = 0;
+    virtual RenderStyle createInnerTextStyle(const RenderStyle&) = 0;
 
     void selectionChanged(bool shouldFireSelectEvent);
     WEBCORE_EXPORT bool lastChangeWasUserEdit() const;
@@ -106,6 +106,7 @@
 
     void disabledStateChanged() override;
     void readOnlyAttributeChanged() override;
+    virtual bool isInnerTextElementEditable() const;
     void updateInnerTextElementEditability();
 
     void cacheSelection(int start, int end, TextFieldSelectionDirection direction)

Modified: trunk/Source/WebCore/html/TextFieldInputType.cpp (225878 => 225879)


--- trunk/Source/WebCore/html/TextFieldInputType.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/html/TextFieldInputType.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -406,29 +406,46 @@
         return AXAutoFillContactsLabel();
     case AutoFillButtonType::Credentials:
         return AXAutoFillCredentialsLabel();
-    default:
+    case AutoFillButtonType::StrongConfirmationPassword:
+        return AXAutoFillStrongConfirmationPasswordLabel();
+    case AutoFillButtonType::StrongPassword:
+        return AXAutoFillStrongPasswordLabel();
     case AutoFillButtonType::None:
         ASSERT_NOT_REACHED();
-        return String();
+        return { };
     }
 }
-    
+
+static String autoFillButtonTypeToAutoFillButtonText(AutoFillButtonType autoFillButtonType)
+{
+    switch (autoFillButtonType) {
+    case AutoFillButtonType::Contacts:
+    case AutoFillButtonType::Credentials:
+    case AutoFillButtonType::StrongConfirmationPassword:
+        return emptyString();
+    case AutoFillButtonType::StrongPassword:
+        return autoFillStrongPasswordLabel();
+    case AutoFillButtonType::None:
+        ASSERT_NOT_REACHED();
+        return { };
+    }
+}
+
 static AtomicString autoFillButtonTypeToAutoFillButtonPseudoClassName(AutoFillButtonType autoFillButtonType)
 {
-    AtomicString pseudoClassName;
     switch (autoFillButtonType) {
     case AutoFillButtonType::Contacts:
-        pseudoClassName = AtomicString("-webkit-contacts-auto-fill-button", AtomicString::ConstructFromLiteral);
-        break;
+        return { "-webkit-contacts-auto-fill-button", AtomicString::ConstructFromLiteral };
     case AutoFillButtonType::Credentials:
-        pseudoClassName = AtomicString("-webkit-credentials-auto-fill-button", AtomicString::ConstructFromLiteral);
-        break;
+        return { "-webkit-credentials-auto-fill-button", AtomicString::ConstructFromLiteral };
+    case AutoFillButtonType::StrongConfirmationPassword:
+        return { "-webkit-strong-confirmation-password-auto-fill-button", AtomicString::ConstructFromLiteral };
+    case AutoFillButtonType::StrongPassword:
+        return { "-webkit-strong-password-auto-fill-button", AtomicString::ConstructFromLiteral };
     case AutoFillButtonType::None:
         ASSERT_NOT_REACHED();
-        break;
+        return emptyAtom();
     }
-
-    return pseudoClassName;
 }
 
 static bool isAutoFillButtonTypeChanged(const AtomicString& attribute, AutoFillButtonType autoFillButtonType)
@@ -435,10 +452,12 @@
 {
     if (attribute == "-webkit-contacts-auto-fill-button" && autoFillButtonType != AutoFillButtonType::Contacts)
         return true;
-
     if (attribute == "-webkit-credentials-auto-fill-button" && autoFillButtonType != AutoFillButtonType::Credentials)
         return true;
-
+    if (attribute == "-webkit-strong-confirmation-password-auto-fill-button" && autoFillButtonType != AutoFillButtonType::StrongConfirmationPassword)
+        return true;
+    if (attribute == "-webkit-strong-password-auto-fill-button" && autoFillButtonType != AutoFillButtonType::StrongPassword)
+        return true;
     return false;
 }
 
@@ -663,6 +682,7 @@
     m_autoFillButton->setPseudo(autoFillButtonTypeToAutoFillButtonPseudoClassName(autoFillButtonType));
     m_autoFillButton->setAttributeWithoutSynchronization(roleAttr, AtomicString("button", AtomicString::ConstructFromLiteral));
     m_autoFillButton->setAttributeWithoutSynchronization(aria_labelAttr, autoFillButtonTypeToAccessibilityLabel(autoFillButtonType));
+    m_autoFillButton->setTextContent(autoFillButtonTypeToAutoFillButtonText(autoFillButtonType));
     m_container->appendChild(*m_autoFillButton);
 }
 
@@ -672,14 +692,16 @@
         if (!m_container)
             createContainer();
 
+        AutoFillButtonType autoFillButtonType = element().autoFillButtonType();
         if (!m_autoFillButton)
-            createAutoFillButton(element().autoFillButtonType());
+            createAutoFillButton(autoFillButtonType);
 
         const AtomicString& attribute = m_autoFillButton->attributeWithoutSynchronization(pseudoAttr);
-        bool shouldUpdateAutoFillButtonType = isAutoFillButtonTypeChanged(attribute, element().autoFillButtonType());
+        bool shouldUpdateAutoFillButtonType = isAutoFillButtonTypeChanged(attribute, autoFillButtonType);
         if (shouldUpdateAutoFillButtonType) {
-            m_autoFillButton->setPseudo(autoFillButtonTypeToAutoFillButtonPseudoClassName(element().autoFillButtonType()));
-            m_autoFillButton->setAttributeWithoutSynchronization(aria_labelAttr, autoFillButtonTypeToAccessibilityLabel(element().autoFillButtonType()));
+            m_autoFillButton->setPseudo(autoFillButtonTypeToAutoFillButtonPseudoClassName(autoFillButtonType));
+            m_autoFillButton->setAttributeWithoutSynchronization(aria_labelAttr, autoFillButtonTypeToAccessibilityLabel(autoFillButtonType));
+            m_autoFillButton->setTextContent(autoFillButtonTypeToAutoFillButtonText(autoFillButtonType));
         }
         m_autoFillButton->setInlineStyleProperty(CSSPropertyDisplay, CSSValueBlock, true);
         return;

Modified: trunk/Source/WebCore/platform/LocalizedStrings.cpp (225878 => 225879)


--- trunk/Source/WebCore/platform/LocalizedStrings.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/platform/LocalizedStrings.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -640,6 +640,21 @@
     return WEB_UI_STRING("alternative presentation button subtitle", "Subtitle text for alternative presentation button");
 }
 
+String AXAutoFillStrongPasswordLabel()
+{
+    return WEB_UI_STRING("strong password auto fill", "Label for the strong password auto fill button inside a text field.");
+}
+
+String AXAutoFillStrongConfirmationPasswordLabel()
+{
+    return WEB_UI_STRING("strong confirmation password auto fill", "Label for the strong confirmation password auto fill button inside a text field.");
+}
+
+String autoFillStrongPasswordLabel()
+{
+    return WEB_UI_STRING("strong password", "Label for strong password.");
+}
+
 String missingPluginText()
 {
     return WEB_UI_STRING("Missing Plug-in", "Label text to be used when a plugin is missing");

Modified: trunk/Source/WebCore/platform/LocalizedStrings.h (225878 => 225879)


--- trunk/Source/WebCore/platform/LocalizedStrings.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/platform/LocalizedStrings.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -215,6 +215,9 @@
     
     String AXAutoFillCredentialsLabel();
     String AXAutoFillContactsLabel();
+    String AXAutoFillStrongPasswordLabel();
+    String AXAutoFillStrongConfirmationPasswordLabel();
+    String autoFillStrongPasswordLabel();
 
     String missingPluginText();
     String crashedPluginText();

Modified: trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h (225878 => 225879)


--- trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -95,7 +95,13 @@
 private:
     bool hasLineIfEmpty() const override { return true; }
     bool isTextControlInnerBlock() const override { return true; }
-    bool canBeProgramaticallyScrolled() const override { return true; }
+    bool canBeProgramaticallyScrolled() const override
+    {
+        auto* shadowHost = element()->shadowHost();
+        if (is<HTMLInputElement>(shadowHost))
+            return !downcast<HTMLInputElement>(*shadowHost).hasAutoFillStrongPasswordButton();
+        return true;
+    }
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/testing/Internals.cpp (225878 => 225879)


--- trunk/Source/WebCore/testing/Internals.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/testing/Internals.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -1663,6 +1663,10 @@
         return AutoFillButtonType::Credentials;
     case Internals::AutoFillButtonType::Contacts:
         return AutoFillButtonType::Contacts;
+    case Internals::AutoFillButtonType::StrongPassword:
+        return AutoFillButtonType::StrongPassword;
+    case Internals::AutoFillButtonType::StrongConfirmationPassword:
+        return AutoFillButtonType::StrongConfirmationPassword;
     }
     ASSERT_NOT_REACHED();
     return AutoFillButtonType::None;

Modified: trunk/Source/WebCore/testing/Internals.h (225878 => 225879)


--- trunk/Source/WebCore/testing/Internals.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/testing/Internals.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -234,7 +234,7 @@
     bool elementShouldAutoComplete(HTMLInputElement&);
     void setEditingValue(HTMLInputElement&, const String&);
     void setAutofilled(HTMLInputElement&, bool enabled);
-    enum class AutoFillButtonType { None, Contacts, Credentials };
+    enum class AutoFillButtonType { None, Contacts, Credentials, StrongPassword, StrongConfirmationPassword };
     void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);
     ExceptionOr<void> scrollElementToRect(Element&, int x, int y, int w, int h);
 

Modified: trunk/Source/WebCore/testing/Internals.idl (225878 => 225879)


--- trunk/Source/WebCore/testing/Internals.idl	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebCore/testing/Internals.idl	2017-12-14 00:29:31 UTC (rev 225879)
@@ -61,7 +61,9 @@
 enum AutoFillButtonType {
     "None",
     "Contacts",
-    "Credentials"
+    "Credentials",
+    "StrongPassword",
+    "StrongConfirmationPassword"
 };
 
 enum UserInterfaceLayoutDirection {

Modified: trunk/Source/WebKit/ChangeLog (225878 => 225879)


--- trunk/Source/WebKit/ChangeLog	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebKit/ChangeLog	2017-12-14 00:29:31 UTC (rev 225879)
@@ -1,3 +1,22 @@
+2017-12-13  Daniel Bates  <daba...@apple.com>
+
+        Add more auto fill button types
+        https://bugs.webkit.org/show_bug.cgi?id=180651
+        <rdar://problem/35891125>
+        And
+        <rdar://problem/35977943>
+
+        Reviewed by Brent Fulgham.
+
+        Adds enumerators for the new auto fill button types.
+
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
+        (toAutoFillButtonType):
+        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h:
+        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
+        (toAutoFillButtonType):
+        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
+
 2017-12-13  Matt Lewis  <jlew...@apple.com>
 
         Unreviewed, rolling out r225864.

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm (225878 => 225879)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm	2017-12-14 00:29:31 UTC (rev 225879)
@@ -135,6 +135,10 @@
         return WebCore::AutoFillButtonType::Contacts;
     case _WKAutoFillButtonTypeCredentials:
         return WebCore::AutoFillButtonType::Credentials;
+    case _WKAutoFillButtonTypeStrongConfirmationPassword:
+        return WebCore::AutoFillButtonType::StrongConfirmationPassword;
+    case _WKAutoFillButtonTypeStrongPassword:
+        return WebCore::AutoFillButtonType::StrongPassword;
     }
     ASSERT_NOT_REACHED();
     return WebCore::AutoFillButtonType::None;

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h (225878 => 225879)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandlePrivate.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -31,6 +31,8 @@
     _WKAutoFillButtonTypeNone,
     _WKAutoFillButtonTypeCredentials,
     _WKAutoFillButtonTypeContacts,
+    _WKAutoFillButtonTypeStrongConfirmationPassword,
+    _WKAutoFillButtonTypeStrongPassword,
 } WK_API_AVAILABLE(macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
 
 @interface WKWebProcessPlugInNodeHandle (WKPrivate)

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp (225878 => 225879)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp	2017-12-14 00:29:31 UTC (rev 225879)
@@ -46,6 +46,10 @@
         return WebCore::AutoFillButtonType::Contacts;
     case kWKAutoFillButtonTypeCredentials:
         return WebCore::AutoFillButtonType::Credentials;
+    case kWKAutoFillButtonTypeStrongConfirmationPassword:
+        return WebCore::AutoFillButtonType::StrongConfirmationPassword;
+    case kWKAutoFillButtonTypeStrongPassword:
+        return WebCore::AutoFillButtonType::StrongPassword;
     }
     ASSERT_NOT_REACHED();
     return WebCore::AutoFillButtonType::None;

Modified: trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h (225878 => 225879)


--- trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h	2017-12-14 00:05:42 UTC (rev 225878)
+++ trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h	2017-12-14 00:29:31 UTC (rev 225879)
@@ -38,7 +38,9 @@
 enum {
     kWKAutoFillButtonTypeNone,
     kWKAutoFillButtonTypeCredentials,
-    kWKAutoFillButtonTypeContacts
+    kWKAutoFillButtonTypeContacts,
+    kWKAutoFillButtonTypeStrongPassword,
+    kWKAutoFillButtonTypeStrongConfirmationPassword,
 };
 typedef uint8_t WKAutoFillButtonType;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to