Bug 207370 - macCatalyst: Unnecessary I-beam over images in editable areas
Summary: macCatalyst: Unnecessary I-beam over images in editable areas
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-02-06 17:27 PST by Tim Horton
Modified: 2020-02-07 12:14 PST (History)
9 users (show)

See Also:


Attachments
Patch (5.21 KB, patch)
2020-02-06 17:27 PST, Tim Horton
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2020-02-06 17:27:00 PST
macCatalyst: Unnecessary I-beam over images in editable areas
Comment 1 Tim Horton 2020-02-06 17:27:36 PST
Created attachment 390034 [details]
Patch
Comment 2 Tim Horton 2020-02-06 17:27:38 PST
<rdar://problem/59235429>
Comment 3 WebKit Commit Bot 2020-02-06 19:30:47 PST
Comment on attachment 390034 [details]
Patch

Clearing flags on attachment: 390034

Committed r256005: <https://trac.webkit.org/changeset/256005>
Comment 4 WebKit Commit Bot 2020-02-06 19:30:49 PST
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2020-02-07 12:14:03 PST
Comment on attachment 390034 [details]
Patch

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

> Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:2844
> +        if (!node)
> +            return false;
> +        RenderObject *renderer = node->renderer();
> +        if (!renderer)
> +            return false;
> +        return is<RenderReplaced>(*renderer);

Iā€™d replace these six lines with this one-liner:

    return node && is<RenderReplaced>(node->renderer());

Fixes the position of the "*" in "RenderObject *" by deleting it, takes advantage of the null checking already built into is<>, and I think is still easy to read and reason about.