Bug 270738

Summary: Right clicking a link highlights children, resulting in overlapping selection on some websites
Product: WebKit Reporter: brisker-sleep-0m
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Normal CC: ahmad.saleem792, ap, bfulgham, mike, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari 17   
Hardware: Unspecified   
OS: macOS 14   
See Also: https://bugs.webkit.org/show_bug.cgi?id=20363
https://bugs.webkit.org/show_bug.cgi?id=20229
Attachments:
Description Flags
Demo of bug
none
Screenshot of Google
none
Screenshot of tech news site none

brisker-sleep-0m
Reported 2024-03-09 04:30:29 PST
Created attachment 470258 [details] Demo of bug Right clicking any link (<a> tag) in Safari will cause it to highlight the contents of the <a> tag. It will do this on any website and if the child of the <a> tag is more than just text it will also select the complete child. Looks like a regression of https://bugs.webkit.org/show_bug.cgi?id=235172 maybe.
Attachments
Demo of bug (1.67 MB, video/quicktime)
2024-03-09 04:30 PST, brisker-sleep-0m
no flags
Screenshot of Google (21.07 KB, image/png)
2024-03-11 15:18 PDT, brisker-sleep-0m
no flags
Screenshot of tech news site (66.65 KB, image/png)
2024-03-11 15:18 PDT, brisker-sleep-0m
no flags
Alexey Proskuryakov
Comment 1 2024-03-11 15:00:10 PDT
Thank you for the report! This is different from bug 235172. Could you please clarify why you consider this to be a bug? This seems like a desirable behavior to me. What's highlighted is the object that the context menu will operate on, and in this case, it's the whole link.
brisker-sleep-0m
Comment 2 2024-03-11 15:17:33 PDT
Well coming from Firefox it's strange to me (they don't do it). Another thing is that when you do it to something that's not just a link, it honestly looks just messed up, like when people but whole chunks of other DOM in <a> tags. (see screenshot of Google results). That only gets worse and more messe the more stuff websites cram in there (see other screenshot of a tech news website). Having checked Chrome they seem to do it as well, but it might be intermittence when Webkit became Blink. IMO it just hurts readability in general when it highlights a whole chunk of nested DOM structure since it kinda lights up like a Christmas tree. If that's intended behaviour though I guess that's "fine" but in that case it'd be neat if you just could toggle the whole thing off.
brisker-sleep-0m
Comment 3 2024-03-11 15:18:05 PDT
Created attachment 470301 [details] Screenshot of Google
brisker-sleep-0m
Comment 4 2024-03-11 15:18:46 PDT
Created attachment 470302 [details] Screenshot of tech news site
Alexey Proskuryakov
Comment 5 2024-03-11 15:52:48 PDT
Firefox in particular doesn't implement the highlighting behavior at all - not even when right-clicking on plain text. This is a violation of macOS platform behavior, so in my opinion that's a bug. The behavior on attached screenshots is not user friendly indeed. And perhaps it's fixable in WebKit with a more targeted fix - at least the double-painting is clearly wrong.
brisker-sleep-0m
Comment 6 2024-03-11 15:59:49 PDT
Agreed, I think if the double-painting was gone it probably wouldn't be so bothersome, cause depending on the website that makes stuff unreadable (right clicking a "Followed channel on Twitch for example is so stacked you literally can not read anything anymore).
Radar WebKit Bug Importer
Comment 7 2024-03-16 05:31:11 PDT
Ahmad Saleem
Comment 8 2024-04-05 03:13:42 PDT
> Looks like a regression of https://bugs.webkit.org/show_bug.cgi?id=235172 maybe. This seems to landed for IFC but when I look to find following code: else if (boxState == RenderObject::HighlightState::None && state == RenderObject::HighlightState::Start) Which the patch was modifying it is in 'Legacy Inline Layout'. :-? https://searchfox.org/wubkat/rev/17c01d484bd83e089e42d7cc7343d1f84a28f8a9/Source/WebCore/rendering/LegacyRootInlineBox.cpp#98 Plus it seems that it was not reverted. (Searched via 'commit' and bug id on GitHub).
Note You need to log in before you can comment on or make changes to this bug.