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

Changeset 248373 in webkit


Ignore:
Timestamp:
Aug 7, 2019, 10:24:19 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

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

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:
Location:
trunk
Files:
8 added
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r248368 r248373  
     12019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
     2
     3        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
     4        a yellow auto-filled appearance
     5        https://bugs.webkit.org/show_bug.cgi?id=200037
     6        rdar://problem/51900961
     7
     8        Reviewed by Daniel Bates.
     9
     10        * fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html: Added.
     11        Test for when the form is reset to no longer be autofilled.
     12
     13        * fast/forms/auto-fill-button/input-strong-password-viewable.html: Added.
     14        Test for when the form is set to being autofilled and viewable.
     15
     16        * fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js:
     17        (window.onload): Javascript used by test to set the element to be autofilled and viewable added
     18
     19        * platform/mac/fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset-expected.txt: Added.
     20        * platform/mac/fast/forms/auto-fill-button/input-strong-password-viewable-expected.txt:
     21
    1222019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
    223
  • trunk/LayoutTests/fast/forms/auto-fill-button/resources/process-auto-fill-button-type-and-invoke-runTest.js

    r231517 r248373  
    88    for (let inputElement of inputElements) {
    99        internals.setAutofilled(inputElement, inputElement.dataset.autofilled == "true");
     10        internals.setAutoFilledAndViewable(inputElement, inputElement.dataset.autoFilledAndViewable == "true");
    1011        internals.setShowAutoFillButton(inputElement, inputElement.dataset.autoFillButtonType);
    1112    }
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r248150 r248373  
    34003400
    34013401webkit.org/b/181662 fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html [ Missing Failure ]
     3402webkit.org/b/200037 fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html [ Missing Failure ]
     3403webkit.org/b/200037 fast/forms/auto-fill-button/input-strong-password-viewable.html [ Missing Failure ]
    34023404
    34033405webkit.org/b/182050 http/wpt/fetch/response-opaque-clone.html [ Pass Crash ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r248285 r248373  
    39313931
    39323932webkit.org/b/181662 fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html [ Failure ]
     3933webkit.org/b/200037 fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html [ Missing Failure ]
     3934webkit.org/b/200037 fast/forms/auto-fill-button/input-strong-password-viewable.html [ Missing Failure ]
    39333935
    39343936webkit.org/b/181854 svg/filters/feDiffuseLighting-bottomRightPixel.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r248370 r248373  
     12019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
     2
     3        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
     4        a yellow auto-filled appearance
     5        https://bugs.webkit.org/show_bug.cgi?id=200037
     6        rdar://problem/51900961
     7
     8        Reviewed by Daniel Bates.
     9
     10        Tests: fast/forms/auto-fill-button/hide-auto-fill-strong-password-viewable-treatment-when-form-is-reset.html
     11               fast/forms/auto-fill-button/input-strong-password-viewable.html
     12
     13        * css/CSSSelector.cpp:
     14        (WebCore::CSSSelector::selectorText const):
     15        Adding CSSSelector case for new pseudo class of AutofillStrongPasswordViewable.
     16
     17        * css/CSSSelector.h: Added PseudoClassAutofillStrongPasswordViewable
     18
     19        * css/SelectorChecker.cpp:
     20        (WebCore::SelectorChecker::checkOne const): Added handling for SelectorChecker.cpp
     21
     22        * css/SelectorCheckerTestFunctions.h:
     23        (WebCore::isAutofilledStrongPasswordViewable):
     24        Checking if the element is an input element and considered to be
     25        AutoFilled and Viewable. Returns a boolean accordingly.
     26
     27        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
     28        Add -webkit-autofill-strong-password-viewable css class.
     29
     30        * css/html.css:
     31        (input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable):
     32        (input:-webkit-autofill-strong-password-viewable):
     33        (input:-webkit-autofill, input:-webkit-autofill-strong-password): Deleted. Updated to include viewable pseudo class.
     34
     35        * cssjit/SelectorCompiler.cpp:
     36        (WebCore::SelectorCompiler::addPseudoClassType):
     37        Add case handling for PseudoClassAutofillStrongPasswordViewable.
     38
     39        * html/HTMLInputElement.cpp:
     40        (WebCore::HTMLInputElement::HTMLInputElement):
     41        Add boolean m_isAutoFilledAndViewable for representing if the
     42        input element is both AutoFilled and should be viewable.
     43        Don't update the viewable treatment in setValueFromRenderer() because even if the user makes edits to the input field
     44        the visual treatment should still be applied.
     45
     46        (WebCore::HTMLInputElement::resignStrongPasswordAppearance):
     47        Updates boolean representing if input element is autofilled and viewable to false.
     48
     49        (WebCore::HTMLInputElement::reset):
     50        Updates boolean representing if input element is autofilled and viewable to false.
     51
     52        (WebCore::HTMLInputElement::setAutoFilledAndViewable):
     53        Setter function for the boolean of m_isAutoFilledAndViewable.
     54
     55        * html/HTMLInputElement.h:
     56        (WebCore::HTMLInputElement::isAutoFilledAndViewable const):
     57        Creating boolean value for m_isAutoFilledAndViewable.
     58
     59        * testing/Internals.cpp:
     60        (WebCore::Internals::setAutoFilledAndViewable): Adding for testing purposes.
     61        * testing/Internals.h: Adding for testing purposes.
     62        * testing/Internals.idl:
     63
    1642019-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
    265
  • trunk/Source/WebCore/css/CSSSelector.cpp

    r246951 r248373  
    431431                str.appendLiteral(":-webkit-autofill-strong-password");
    432432                break;
     433            case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
     434                str.appendLiteral(":-webkit-autofill-strong-password-viewable");
     435                break;
    433436            case CSSSelector::PseudoClassDrag:
    434437                str.appendLiteral(":-webkit-drag");
  • trunk/Source/WebCore/css/CSSSelector.h

    r246951 r248373  
    109109            PseudoClassAutofill,
    110110            PseudoClassAutofillStrongPassword,
     111            PseudoClassAutofillStrongPasswordViewable,
    111112            PseudoClassHover,
    112113            PseudoClassDrag,
  • trunk/Source/WebCore/css/SelectorChecker.cpp

    r246490 r248373  
    972972        case CSSSelector::PseudoClassAutofillStrongPassword:
    973973            return isAutofilledStrongPassword(element);
     974        case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
     975            return isAutofilledStrongPasswordViewable(element);
    974976        case CSSSelector::PseudoClassAnyLink:
    975977        case CSSSelector::PseudoClassAnyLinkDeprecated:
  • trunk/Source/WebCore/css/SelectorCheckerTestFunctions.h

    r247529 r248373  
    5858}
    5959
     60ALWAYS_INLINE bool isAutofilledStrongPasswordViewable(const Element& element)
     61{
     62    return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isAutoFilledAndViewable();
     63}
     64
    6065ALWAYS_INLINE bool matchesDefaultPseudoClass(const Element& element)
    6166{
  • trunk/Source/WebCore/css/SelectorPseudoClassAndCompatibilityElementMap.in

    r237932 r248373  
    44-webkit-autofill
    55-webkit-autofill-strong-password
     6-webkit-autofill-strong-password-viewable
    67-webkit-drag
    78-webkit-full-page-media
  • trunk/Source/WebCore/css/html.css

    r244848 r248373  
    723723
    724724input:-webkit-autofill-strong-password {
     725    -webkit-user-select: none !important;
     726}
     727
     728input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable {
    725729    -webkit-text-security: none !important;
    726     -webkit-user-select: none !important;
    727730    cursor: default !important;
    728731    font-family: monospace;
    729732}
    730733
    731 input:-webkit-autofill, input:-webkit-autofill-strong-password {
     734input:-webkit-autofill, input:-webkit-autofill-strong-password, input:-webkit-autofill-strong-password-viewable {
    732735    background-color: #FAFFBD !important;
    733736    background-image: none !important;
  • trunk/Source/WebCore/cssjit/SelectorCompiler.cpp

    r246490 r248373  
    540540    case CSSSelector::PseudoClassAutofillStrongPassword:
    541541        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(isAutofilledStrongPassword));
     542        return FunctionType::SimpleSelectorChecker;
     543    case CSSSelector::PseudoClassAutofillStrongPasswordViewable:
     544        fragment.unoptimizedPseudoClasses.append(JSC::FunctionPtr<CSSOperationPtrTag>(isAutofilledStrongPasswordViewable));
    542545        return FunctionType::SimpleSelectorChecker;
    543546    case CSSSelector::PseudoClassChecked:
  • trunk/Source/WebCore/html/HTMLInputElement.cpp

    r248172 r248373  
    111111    , m_autocomplete(Uninitialized)
    112112    , m_isAutoFilled(false)
     113    , m_isAutoFilledAndViewable(false)
    113114    , m_autoFillButtonType(static_cast<uint8_t>(AutoFillButtonType::None))
    114115    , m_lastAutoFillButtonType(static_cast<uint8_t>(AutoFillButtonType::None))
     
    518519        return;
    519520    setAutoFilled(false);
     521    setAutoFilledAndViewable(false);
    520522    setShowAutoFillButton(AutoFillButtonType::None);
    521523    if (auto* page = document().page())
     
    916918
    917919    setAutoFilled(false);
     920    setAutoFilledAndViewable(false);
    918921    setShowAutoFillButton(AutoFillButtonType::None);
    919922    setChecked(hasAttributeWithoutSynchronization(checkedAttr));
     
    13411344
    13421345    m_isAutoFilled = autoFilled;
     1346    invalidateStyleForSubtree();
     1347}
     1348
     1349void HTMLInputElement::setAutoFilledAndViewable(bool autoFilledAndViewable)
     1350{
     1351    if (autoFilledAndViewable == m_isAutoFilledAndViewable)
     1352        return;
     1353
     1354    m_isAutoFilledAndViewable = autoFilledAndViewable;
    13431355    invalidateStyleForSubtree();
    13441356}
  • trunk/Source/WebCore/html/HTMLInputElement.h

    r246490 r248373  
    241241    WEBCORE_EXPORT void setAutoFilled(bool = true);
    242242
     243    bool isAutoFilledAndViewable() const { return m_isAutoFilledAndViewable; }
     244    WEBCORE_EXPORT void setAutoFilledAndViewable(bool = true);
     245
    243246    AutoFillButtonType lastAutoFillButtonType() const { return static_cast<AutoFillButtonType>(m_lastAutoFillButtonType); }
    244247    AutoFillButtonType autoFillButtonType() const { return static_cast<AutoFillButtonType>(m_autoFillButtonType); }
     
    466469    unsigned m_autocomplete : 2; // AutoCompleteSetting
    467470    bool m_isAutoFilled : 1;
     471    bool m_isAutoFilledAndViewable : 1;
    468472    unsigned m_autoFillButtonType : 3; // AutoFillButtonType
    469473    unsigned m_lastAutoFillButtonType : 3; // AutoFillButtonType
  • trunk/Source/WebCore/testing/Internals.cpp

    r248301 r248373  
    18641864}
    18651865
     1866void Internals::setAutoFilledAndViewable(HTMLInputElement& element, bool enabled)
     1867{
     1868    element.setAutoFilledAndViewable(enabled);
     1869}
     1870
    18661871static AutoFillButtonType toAutoFillButtonType(Internals::AutoFillButtonType type)
    18671872{
  • trunk/Source/WebCore/testing/Internals.h

    r248301 r248373  
    266266    bool elementShouldAutoComplete(HTMLInputElement&);
    267267    void setAutofilled(HTMLInputElement&, bool enabled);
     268    void setAutoFilledAndViewable(HTMLInputElement&, bool enabled);
    268269    enum class AutoFillButtonType { None, Contacts, Credentials, StrongPassword, CreditCard };
    269270    void setShowAutoFillButton(HTMLInputElement&, AutoFillButtonType);
  • trunk/Source/WebCore/testing/Internals.idl

    r248301 r248373  
    293293    boolean elementShouldAutoComplete(HTMLInputElement inputElement);
    294294    void setAutofilled(HTMLInputElement inputElement, boolean enabled);
     295    void setAutoFilledAndViewable(HTMLInputElement inputElement, boolean enabled);
    295296    void setShowAutoFillButton(HTMLInputElement inputElement, AutoFillButtonType autoFillButtonType);
    296297    AutoFillButtonType autoFillButtonType(HTMLInputElement inputElement);
  • trunk/Source/WebKit/ChangeLog

    r248372 r248373  
     12019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
     2
     3        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
     4        a yellow auto-filled appearance
     5        https://bugs.webkit.org/show_bug.cgi?id=200037
     6        rdar://problem/51900961
     7
     8        Reviewed by Daniel Bates.
     9
     10        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h:
     11        * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
     12        (-[WKWebProcessPlugInNodeHandle HTMLInputElementIsAutoFilledAndViewable]):
     13        Accessor function for boolean which represents if the input element is autofilled and viewable.
     14
     15        (-[WKWebProcessPlugInNodeHandle setHTMLInputElementIsAutoFilledAndViewable:]):
     16        Setter function for boolean which represents if the input element is autofilled and viewable.
     17
     18        * WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp:
     19        (WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable):
     20        Accessor function for boolean which represents if the input element is autofilled and viewable.
     21
     22       * WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h:
     23        Creating function declaration for boolean setter.
     24
     25        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
     26        Accessor function for boolean which represents if the input element is autofilled and viewable.
     27
     28        (WebKit::InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable const):
     29        Setter function for boolean which represents if the input element is autofilled and viewable.
     30
     31        (WebKit::InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable):
     32        Setter function for boolean which represents if the input element is autofilled and viewable.
     33
     34        * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
     35        Adding setter and getter functions for the boolean which represents if the input element is autofilled
     36        and viewable.
     37
    1382019-08-07  Chris Dumez  <cdumez@apple.com>
    239
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h

    r245294 r248373  
    5252@property (nonatomic, readonly) CGRect elementBounds;
    5353@property (nonatomic) BOOL HTMLInputElementIsAutoFilled;
     54@property (nonatomic) BOOL HTMLInputElementIsAutoFilledAndViewable;
    5455@property (nonatomic, readonly) BOOL HTMLInputElementIsUserEdited;
    5556@property (nonatomic, readonly) BOOL HTMLTextAreaElementIsUserEdited;
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm

    r242339 r248373  
    105105}
    106106
     107- (BOOL)HTMLInputElementIsAutoFilledAndViewable
     108{
     109    return _nodeHandle->isHTMLInputElementAutoFilledAndViewable();
     110}
     111
    107112- (void)setHTMLInputElementIsAutoFilled:(BOOL)isAutoFilled
    108113{
    109114    _nodeHandle->setHTMLInputElementAutoFilled(isAutoFilled);
     115}
     116
     117- (void)setHTMLInputElementIsAutoFilledAndViewable:(BOOL)isAutoFilledAndViewable
     118{
     119    _nodeHandle->setHTMLInputElementAutoFilledAndViewable(isAutoFilledAndViewable);
    110120}
    111121
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp

    r238832 r248373  
    131131}
    132132
     133void WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable(WKBundleNodeHandleRef htmlInputElementHandleRef, bool autoFilledAndViewable)
     134{
     135    WebKit::toImpl(htmlInputElementHandleRef)->setHTMLInputElementAutoFilledAndViewable(autoFilledAndViewable);
     136}
     137
    133138bool WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled(WKBundleNodeHandleRef htmlInputElementHandleRef)
    134139{
  • trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h

    r237647 r248373  
    6565WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutoFilled(WKBundleNodeHandleRef htmlInputElementHandle);
    6666WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFilled(WKBundleNodeHandleRef htmlInputElementHandle, bool filled);
     67WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFilledAndViewable(WKBundleNodeHandleRef htmlInputElementHandle, bool autoFilledAndViewable);
    6768WK_EXPORT bool WKBundleNodeHandleGetHTMLInputElementAutoFillButtonEnabled(WKBundleNodeHandleRef htmlInputElementHandle);
    6869WK_EXPORT void WKBundleNodeHandleSetHTMLInputElementAutoFillButtonEnabledWithButtonType(WKBundleNodeHandleRef htmlInputElementHandle, WKAutoFillButtonType autoFillButtonType);
  • trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp

    r247921 r248373  
    251251}
    252252
     253bool InjectedBundleNodeHandle::isHTMLInputElementAutoFilledAndViewable() const
     254{
     255    if (!is<HTMLInputElement>(m_node))
     256        return false;
     257
     258    return downcast<HTMLInputElement>(m_node.get()).isAutoFilledAndViewable();
     259}
     260
    253261void InjectedBundleNodeHandle::setHTMLInputElementAutoFilled(bool filled)
    254262{
     
    257265
    258266    downcast<HTMLInputElement>(m_node.get()).setAutoFilled(filled);
     267}
     268
     269void InjectedBundleNodeHandle::setHTMLInputElementAutoFilledAndViewable(bool autoFilledAndViewable)
     270{
     271    if (!is<HTMLInputElement>(m_node))
     272        return;
     273
     274    downcast<HTMLInputElement>(m_node.get()).setAutoFilledAndViewable(autoFilledAndViewable);
    259275}
    260276
  • trunk/Source/WebKit/WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h

    r239427 r248373  
    6868    void setHTMLInputElementSpellcheckEnabled(bool);
    6969    bool isHTMLInputElementAutoFilled() const;
     70    bool isHTMLInputElementAutoFilledAndViewable() const;
    7071    void setHTMLInputElementAutoFilled(bool);
     72    void setHTMLInputElementAutoFilledAndViewable(bool);
    7173    bool isHTMLInputElementAutoFillButtonEnabled() const;
    7274    void setHTMLInputElementAutoFillButtonEnabled(WebCore::AutoFillButtonType);
  • trunk/Source/WebKitLegacy/mac/ChangeLog

    r248190 r248373  
     12019-08-07  Priyanka Agarwal  <pagarwal999@apple.com>
     2
     3        Allow clients to toggle a text input field between being viewable and having characters hidden while maintaining
     4        a yellow auto-filled appearance
     5        https://bugs.webkit.org/show_bug.cgi?id=200037
     6        rdar://problem/51900961
     7
     8        Reviewed by Daniel Bates.
     9
     10        * DOM/WebDOMOperations.mm:
     11        (-[DOMHTMLInputElement _isAutoFilledAndViewable]):
     12        (-[DOMHTMLInputElement _setAutoFilledAndViewable:]):
     13        * DOM/WebDOMOperationsPrivate.h:
     14
    1152019-08-02  Keith Rollin  <krollin@apple.com>
    216
  • trunk/Source/WebKitLegacy/mac/DOM/WebDOMOperations.mm

    r237266 r248373  
    226226}
    227227
     228- (BOOL)_isAutoFilledAndViewable
     229{
     230    return downcast<HTMLInputElement>(core((DOMElement *)self))->isAutoFilledAndViewable();
     231}
     232
    228233- (void)_setAutofilled:(BOOL)autofilled
    229234{
    230235    downcast<HTMLInputElement>(core((DOMElement *)self))->setAutoFilled(autofilled);
     236}
     237
     238- (void)_setAutoFilledAndViewable:(BOOL)autoFilledAndViewable
     239{
     240    downcast<HTMLInputElement>(core((DOMElement *)self))->setAutoFilledAndViewable(autoFilledAndViewable);
    231241}
    232242
  • trunk/Source/WebKitLegacy/mac/DOM/WebDOMOperationsPrivate.h

    r211468 r248373  
    4444- (BOOL)_isAutofilled;
    4545- (void)_setAutofilled:(BOOL)autofilled;
     46
     47- (BOOL)_isAutoFilledAndViewable;
     48- (void)_setAutoFilledAndViewable:(BOOL)autoFilledAndViewable;
    4649@end
    4750
Note: See TracChangeset for help on using the changeset viewer.