Bug 211307

Summary: Text manipulation should observe the value attribute of some input elements
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: HTML EditingAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, darin, ews-watchlist, megan_gardner, mifenton, sihui_liu, thorton, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
darin: review+
Patch for landing none

Description Wenson Hsieh 2020-05-01 12:10:52 PDT
<rdar://problem/61568528>
Comment 1 Wenson Hsieh 2020-05-01 15:10:10 PDT
Created attachment 398246 [details]
Patch
Comment 2 Darin Adler 2020-05-01 18:39:38 PDT
Comment on attachment 398246 [details]
Patch

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

> Source/WebCore/editing/TextManipulationController.cpp:233
> +    if (nameToCheck == valueAttr.get() && is<HTMLInputElement>(element))
> +        return downcast<HTMLInputElement>(element).isTextButton();

I would write:

    if (nameToCheck == valueAttr)
        return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isTextButton();
Comment 3 Wenson Hsieh 2020-05-01 18:43:24 PDT
Comment on attachment 398246 [details]
Patch

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

>> Source/WebCore/editing/TextManipulationController.cpp:233
>> +        return downcast<HTMLInputElement>(element).isTextButton();
> 
> I would write:
> 
>     if (nameToCheck == valueAttr)
>         return is<HTMLInputElement>(element) && downcast<HTMLInputElement>(element).isTextButton();

Sounds good!
Comment 4 Wenson Hsieh 2020-05-01 18:48:00 PDT
Created attachment 398269 [details]
Patch for landing
Comment 5 EWS 2020-05-01 19:26:28 PDT
Committed r261042: <https://trac.webkit.org/changeset/261042>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 398269 [details].