Bug 207370

Summary: macCatalyst: Unnecessary I-beam over images in editable areas
Product: WebKit Reporter: Tim Horton <thorton>
Component: New BugsAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, commit-queue, darin, dbates, esprehn+autocc, ews-watchlist, kangil.han, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch none

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.