Fix to make selection more like NSTextView. All gap painting is now done by WebCore...
[WebKit-https.git] / WebKit / WebCoreSupport.subproj / WebTextRenderer.m
index 49f1e55058d8d581d428d4da822ec0632a08e759..2ae682bfe4c2f08f2b4028c20b6ffcb0e8f68fdf 100644 (file)
@@ -936,13 +936,6 @@ static void _drawGlyphs(NSFont *font, NSColor *color, CGGlyph *glyphs, CGSize *a
         else {
             [NSBezierPath fillRect:NSMakeRect(startX, yPos, backgroundWidth, height)];
         }
-
-        // Draw the extra rectangles on either side of the selection to mimic Cocoa behavior.
-        if (geometry->selectionMinX != geometry->point.x) {
-            [NSBezierPath fillRect:NSMakeRect(geometry->selectionMinX, yPos, geometry->point.x - geometry->selectionMinX, height)];
-        }
-        if (geometry->selectionMaxX != geometry->point.x)
-            [NSBezierPath fillRect:NSMakeRect(startX + backgroundWidth, yPos, geometry->selectionMaxX - (startX + backgroundWidth), height)];
     }
 }
 
@@ -1545,13 +1538,6 @@ static WebCoreTextRun reverseCharactersInRun(const WebCoreTextRun *run)
         [NSBezierPath fillRect:NSMakeRect(selectedLeftX, yPos, backgroundWidth, height)];
     }
 
-    // Draw the extra rectangles on either side of the selection to mimic Cocoa behavior.
-    if (geometry->selectionMinX != geometry->point.x) {
-        [NSBezierPath fillRect:NSMakeRect(geometry->selectionMinX, yPos, geometry->point.x - geometry->selectionMinX, height)];
-    }
-    if (geometry->selectionMaxX != geometry->point.x)
-        [NSBezierPath fillRect:NSMakeRect(selectedLeftX + backgroundWidth, yPos, geometry->selectionMaxX - (selectedLeftX + backgroundWidth), height)];
-
     ATSUDisposeTextLayout (layout); // Ignore the error.  Nothing we can do anyway.
 
     if (style->visuallyOrdered)