Bug 223518

Summary: [macOS] Context menu should account for image overlay content
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: PlatformAssignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin, cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, hi, megan_gardner, mifenton, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Wenson Hsieh 2021-03-19 09:21:35 PDT
<rdar://problem/75505210>
Comment 1 Wenson Hsieh 2021-03-19 13:32:50 PDT
Created attachment 423767 [details]
Patch
Comment 2 Devin Rousso 2021-03-19 13:46:49 PDT
Comment on attachment 423767 [details]
Patch

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

r=me

> Source/WebCore/html/HTMLElement.cpp:1240
> +    if (auto host = node.shadowHost(); is<HTMLElement>(host) && downcast<HTMLElement>(*host).hasImageOverlay())
> +        return makeRefPtr(downcast<HTMLElement>(*host));

NIT: Can we avoid the double dereference-`downcast`?
Comment 3 Wenson Hsieh 2021-03-19 13:53:16 PDT
Comment on attachment 423767 [details]
Patch

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

>> Source/WebCore/html/HTMLElement.cpp:1240
>> +        return makeRefPtr(downcast<HTMLElement>(*host));
> 
> NIT: Can we avoid the double dereference-`downcast`?

Yes, fixed!
Comment 4 Wenson Hsieh 2021-03-19 14:54:12 PDT
Created attachment 423783 [details]
Patch
Comment 5 EWS 2021-03-22 12:06:07 PDT
Committed r274772: <https://commits.webkit.org/r274772>

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