Bug 20229

Summary: REGRESSION: WebKit double-draws selections in some cases
Product: WebKit Reporter: Eric Seidel <eric>
Component: New BugsAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: ap, bugs, dglazkov, parag, rniwa, webkit.review.bot
Priority: P1 Keywords: NeedsRadar, NeedsReduction, Regression
Version: 528+ (Nightly build)   
Hardware: Macintosh   
OS: OS X 10.5   
URL: http://www.mathewgross.com/about
Description Flags
example of double-drawn selection
Proposed Patch
webkit.review.bot: commit-queue-
Archive of layout-test-results from ec2-cr-linux-03 none

Description Eric Seidel 2008-07-30 10:16:27 PDT
See the attached image.

Go to:
and select the top portion of the page.  Notice how the selection is drawn twice in some areas.  Firefox leaves large blank spaces (which isn't better).  But the double-draw makes the text hard to read.

WebKit should instead clip around the existing selection (I think) when drawing new selection rects so that they don't overlap.
Comment 1 Eric Seidel 2008-07-30 10:16:51 PDT
Created attachment 22555 [details]
example of double-drawn selection
Comment 2 Pierre-Luc Beaudoin 2008-07-30 12:48:29 PDT
It looks like the selection isn't double drawn but that it is drawn in a translucent way. What I see in your screen shot is a big selection for the 2nd line which overlaps the other line's selection.

I think this bug should be named "Overlapping selection highlight".  The bug might simply be that the 2nd line ("Submitted by Mathew Gross on February 18, 2008 - 4:01pm.") selection's highlight is too high.
Comment 3 Dave Hyatt 2008-07-30 18:08:22 PDT
Confirmed.  One of the lines is getting a crazy tall selection highlight.  This is a regression from Safari 3.1.
Comment 4 Dave Hyatt 2008-07-30 18:12:30 PDT
Padding and border on inline elements is being incorporated into selection top and bottom since we use overflow.  We need to change selection away from using painting overflow and to be its own unique values.

This is a regression because an empty inline element is now present (because of fixes to make sure those show up).  (<span class=taxonomy>)

Comment 5 ivank 2009-08-15 16:16:54 PDT
I encountered a double-drawn selection when I was hiding and unhiding divs. I have a simple reproduction of this:

http://ludios.net/webkit_bugs/selection_bugs.html  (it is the first bug listed)
Comment 6 Parag Radke 2012-03-26 08:39:28 PDT
Created attachment 133821 [details]
Proposed Patch

Patch to fix double-draws selections.
Comment 7 Parag Radke 2012-03-26 08:42:28 PDT
This patch will cause some pixel tests to fail on chromium port because of propagation.
Comment 8 WebKit Review Bot 2012-03-26 09:30:22 PDT
Comment on attachment 133821 [details]
Proposed Patch

Attachment 133821 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12132863

New failing tests:
Comment 9 WebKit Review Bot 2012-03-26 09:30:29 PDT
Created attachment 133831 [details]
Archive of layout-test-results from ec2-cr-linux-03

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-03  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 10 Parag Radke 2012-03-27 01:52:08 PDT
Comment on attachment 133821 [details]
Proposed Patch

This change is not correct to avoid double selection 'll upload a new patch for this.