[webkit-reviews] review granted: [Bug 221828] Unconditionally return information in _autofillContext SPI when a field is focused : [Attachment 420182] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Feb 15 17:11:25 PST 2021


Darin Adler <darin at apple.com> has granted Ricky Mondello
<rmondello at apple.com>'s request for review:
Bug 221828: Unconditionally return information in _autofillContext SPI when a
field is focused
https://bugs.webkit.org/show_bug.cgi?id=221828

Attachment 420182: Patch

https://bugs.webkit.org/attachment.cgi?id=420182&action=review




--- Comment #8 from Darin Adler <darin at apple.com> ---
Comment on attachment 420182
  --> https://bugs.webkit.org/attachment.cgi?id=420182
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=420182&action=review

> Source/WebKit/ChangeLog:11
> +	       text field. Add a "version" key. Explicitly indicate whether
we're in a login context. This SPI remains stringly

Ah, "stringly typed", a term of art I had not heard before.

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:7904
> +    NSMutableDictionary *context = [[[NSMutableDictionary alloc] init]
autorelease];

We are trying to cut down on the use of explicit calls to [x release] and [x
autorelease] in WebKit code.

A better style would be to use a RetainPtr<NSMutableDictionary> like this:

    auto context = adoptNS([[NSMutableDictionary alloc] init]);

    context.get()[@"_WKAutofillContextVersion"] = @(2);

    ...

    return context.autorelease();

Those "get()" calls are ugly, but its the direction we are going.

> Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:7908
> +    BOOL provideStrongPasswordAssistance =
_focusRequiresStrongPasswordAssistance &&
_focusedElementInformation.elementType == WebKit::InputType::Password;
> +    if (provideStrongPasswordAssistance) {

Not sure we really need the local variable any more. Just collapse those into
one line?


More information about the webkit-reviews mailing list