RESOLVED FIXED Bug 224576
[macOS] Make image extraction interactions work for elements inside links
https://bugs.webkit.org/show_bug.cgi?id=224576
Summary [macOS] Make image extraction interactions work for elements inside links
Wenson Hsieh
Reported 2021-04-14 14:05:26 PDT
(Similar to #224517, but on macOS this time)
Attachments
Patch (6.72 KB, patch)
2021-04-14 14:15 PDT, Wenson Hsieh
no flags
Address comments (11.43 KB, patch)
2021-04-14 14:52 PDT, Wenson Hsieh
no flags
Radar WebKit Bug Importer
Comment 1 2021-04-14 14:12:26 PDT
Wenson Hsieh
Comment 2 2021-04-14 14:15:13 PDT
Devin Rousso
Comment 3 2021-04-14 14:26:48 PDT
Comment on attachment 426044 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426044&action=review r=me > Source/WebCore/page/EventHandler.cpp:960 > + VisibleSelection newSelection { oldSelection }; NIT: Do we have a preference as to style of this vs something like `auto newSelection = oldSelection;`? > Source/WebCore/page/EventHandler.cpp:1009 > + auto isImageOverlayText = [&] (RefPtr<Node>&& node) { NIT: Does this need to capture `&`? NIT: It's a bit odd that this takes a `RefPtr<Node>&&` instead of just `RefPtr<Node>&` or something 🤔
Wenson Hsieh
Comment 4 2021-04-14 14:32:11 PDT
Comment on attachment 426044 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426044&action=review Thanks for the review! >> Source/WebCore/page/EventHandler.cpp:960 >> + VisibleSelection newSelection { oldSelection }; > > NIT: Do we have a preference as to style of this vs something like `auto newSelection = oldSelection;`? I don't think the style guidelines cover this, but I do agree that we generally use `auto/=` in new code, so I'll change it to that. >> Source/WebCore/page/EventHandler.cpp:1009 >> + auto isImageOverlayText = [&] (RefPtr<Node>&& node) { > > NIT: Does this need to capture `&`? > > NIT: It's a bit odd that this takes a `RefPtr<Node>&&` instead of just `RefPtr<Node>&` or something 🤔 Good point — removed the `&` capture, and changed to take `const RefPtr<Node>&`.
Wenson Hsieh
Comment 5 2021-04-14 14:38:34 PDT
(In reply to Wenson Hsieh from comment #4) > Comment on attachment 426044 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=426044&action=review > > Thanks for the review! > > >> Source/WebCore/page/EventHandler.cpp:960 > >> + VisibleSelection newSelection { oldSelection }; > > > > NIT: Do we have a preference as to style of this vs something like `auto newSelection = oldSelection;`? > > I don't think the style guidelines cover this, but I do agree that we > generally use `auto/=` in new code, so I'll change it to that. > > >> Source/WebCore/page/EventHandler.cpp:1009 > >> + auto isImageOverlayText = [&] (RefPtr<Node>&& node) { > > > > NIT: Does this need to capture `&`? > > > > NIT: It's a bit odd that this takes a `RefPtr<Node>&&` instead of just `RefPtr<Node>&` or something 🤔 > > Good point — removed the `&` capture, and changed to take `const > RefPtr<Node>&`. I'm going to add a `HTMLElement::isImageOverlayText(const Node*)` overload and use that instead, as you suggested over Slack.
Wenson Hsieh
Comment 6 2021-04-14 14:52:05 PDT
Created attachment 426050 [details] Address comments
EWS
Comment 7 2021-04-14 19:04:27 PDT
Committed r275988 (236540@main): <https://commits.webkit.org/236540@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426050 [details].
Note You need to log in before you can comment on or make changes to this bug.