Bug 21960

Summary: Chrome/Safari selects the region outside the element
Product: WebKit Reporter: Jon@Chromium <jon>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ahmad.saleem792, michael.vm, simon.fraser, tonikitoo, zalan
Priority: P2    
Version: 525.x (Safari 3.1)   
Hardware: PC   
OS: OS X 10.5   
URL: http://bash.org.ru/
Attachments:
Description Flags
Reduction
none
Reduction (quirks mode) none

Description Jon@Chromium 2008-10-29 15:58:45 PDT
Issue originated in Chromium bugs, see http://code.google.com/p/chromium/issues/detail?id=3527

IE and FF selects only the region inside the red box but Chrome/Safari does select the region outside.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<body>
<div style="margin: 20px auto; width: 740px;font-family: 'Lucida Grande', 'Tahoma', sans-serif; border: 2px solid red">Only area with in div region should get selected. But the region that lies outside the div also gets selected.</div>
</body>
</html>

See the attached reductions.
Comment 1 Jon@Chromium 2008-10-29 15:59:35 PDT
Created attachment 24759 [details]
Reduction
Comment 2 Jon@Chromium 2008-10-29 16:00:22 PDT
Created attachment 24760 [details]
Reduction (quirks mode)
Comment 3 Ahmad Saleem 2023-05-05 14:18:03 PDT
Isn't this intentional behavior of WebKit / Safari to have gapless selection, hence, we have empty space with 'selection' color painted as well, while Chrome now has 'gapped' selection, so only have selection around text?

Can someone please confirm whether we need to fix it or not? Or we can mark this duplicate of other 'gapped' selection bug?
Comment 4 zalan 2023-05-05 19:23:28 PDT
(In reply to Ahmad Saleem from comment #3)
> Isn't this intentional behavior of WebKit / Safari to have gapless
> selection, hence, we have empty space with 'selection' color painted as
> well, while Chrome now has 'gapped' selection, so only have selection around
> text?
Correct!