Bug 20229

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

Description From 2008-07-30 10:16:27 PST
See the attached image.

Go to:
http://www.mathewgross.com/about
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 From 2008-07-30 10:16:51 PST -------
Created an attachment (id=22555) [details]
example of double-drawn selection
------- Comment #2 From 2008-07-30 12:48:29 PST -------
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 From 2008-07-30 18:08:22 PST -------
Confirmed.  One of the lines is getting a crazy tall selection highlight.  This is a regression from Safari 3.1.
------- Comment #4 From 2008-07-30 18:12:30 PST -------
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 From 2009-08-15 16:16:54 PST -------
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 From 2012-03-26 08:39:28 PST -------
Created an attachment (id=133821) [details]
Proposed Patch

Patch to fix double-draws selections.
------- Comment #7 From 2012-03-26 08:42:28 PST -------
This patch will cause some pixel tests to fail on chromium port because of propagation.
------- Comment #8 From 2012-03-26 09:30:22 PST -------
(From update of attachment 133821 [details])
Attachment 133821 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/12132863

New failing tests:
editing/pasteboard/subframe-dragndrop-1.html
editing/selection/3690703-2.html
editing/selection/3690703.html
editing/selection/inline-closest-leaf-child.html
fast/repaint/4774354.html
fast/replaced/selection-rect-transform.html
editing/selection/contains-boundaries.html
fast/repaint/block-selection-gap-in-composited-layer.html
fast/writing-mode/vertical-lr-replaced-selection.html
fast/replaced/selection-rect-in-table-cell.html
fast/writing-mode/horizontal-bt-replaced-selection.html
editing/selection/3690719.html
fast/replaced/selection-rect.html
fast/writing-mode/vertical-rl-replaced-selection.html
------- Comment #9 From 2012-03-26 09:30:29 PST -------
Created an attachment (id=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 From 2012-03-27 01:52:08 PST -------
(From update of attachment 133821 [details])
This change is not correct to avoid double selection 'll upload a new patch for this.