Selection draws over content that won't get copied
https://bugs.webkit.org/show_bug.cgi?id=30694
Summary Selection draws over content that won't get copied
Evan Martin
Reported 2009-10-22 16:55:53 PDT
Created attachment 41698 [details] screenshot of selection on webkit.org In the attached screenshot, observe how the selection paints over the sidebar. Maciej wrote: "http://daringfireball.net/ is another site that has the same problem, likely for the very same reason. I expect this will happen on any site uses a large left margin on the main content to lay out around an absolute-positioned sidebar. Some sites use floats for this kind of thing and are not affected. I'm not sure what the best fix is. Maybe we should be stopping selection painting at the border box and not draw into margins. I'm not sure if this would have negative consequences on other sites."
Attachments
screenshot of selection on webkit.org (251.39 KB, image/png)
2009-10-22 16:55 PDT, Evan Martin
no flags
Peter Kasting
Comment 1 2010-06-20 18:32:20 PDT
Ojan has been doing work on selection bugs, so he's a good triage person for this.
Ojan Vafai
Comment 2 2010-07-08 12:23:18 PDT
Stopping selection painting at the border box makes sense to me. The downside, I think, is that you'd get a jagged right edge in some cases. For example: <div style="width:200px">foo</div> <div style="width:400px">foo</div> If you were to select all that, then the top part of the selection would be smaller. My intuition is that's a less common case than the cases like this one that it would fix.
Peter Kasting
Comment 3 2010-07-08 12:24:44 PDT
Seems like hyatt checked in something years ago explicitly to make selection not have jagged edges. I wonder if that patch is the exact opposite of the suggested fix here.
Ojan Vafai
Comment 4 2012-04-09 11:41:01 PDT
(In reply to comment #3) > Seems like hyatt checked in something years ago explicitly to make selection not have jagged edges. I wonder if that patch is the exact opposite of the suggested fix here. These are all heuristics. We need to pick the one that maximizes only highlighting the part of the DOM you have selected while minimizing jagged edges. I expect highlighting the border-box of elements instead of their margin-box would almost always be better. I can easily construct pages where selections would look bad with either approach. Would be great for someone to put together a patch that we could try locally and see how it feels on different real pages.
Note You need to log in before you can comment on or make changes to this bug.