Bug 211307 - Text manipulation should observe the value attribute of some input elements
Summary: Text manipulation should observe the value attribute of some input elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-05-01 12:10 PDT by Wenson Hsieh
Modified: 2020-05-01 19:26 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.36 KB, patch)
2020-05-01 15:10 PDT, Wenson Hsieh
darin: review+
Details | Formatted Diff | Diff
Patch for landing (5.35 KB, patch)
2020-05-01 18:48 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].