Focus ring only appears in top-left tile
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2012 00:36:52 +0000 (00:36 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 May 2012 00:36:52 +0000 (00:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=85556
<rdar://problem/11359656>

Reviewed by Simon Fraser.

It is sufficient to just apply the current CTM to the clip rect and set that as the focus ring clip rect.

* platform/graphics/mac/WebLayer.mm:
(drawLayerContents):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116048 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/mac/WebLayer.mm

index ecdff44..fac639e 100644 (file)
@@ -1,3 +1,16 @@
+2012-05-03  Anders Carlsson  <andersca@apple.com>
+
+        Focus ring only appears in top-left tile
+        https://bugs.webkit.org/show_bug.cgi?id=85556
+        <rdar://problem/11359656>
+
+        Reviewed by Simon Fraser.
+
+        It is sufficient to just apply the current CTM to the clip rect and set that as the focus ring clip rect.
+
+        * platform/graphics/mac/WebLayer.mm:
+        (drawLayerContents):
+
 2012-05-03  Alec Flett  <alecflett@chromium.org>
 
         IndexedDB: Replace numeric constants with strings
index 576055d..97e9f28 100644 (file)
@@ -80,8 +80,9 @@ void drawLayerContents(CGContextRef context, CALayer *layer, WebCore::PlatformCA
     // smaller than the layer bounds (e.g. tiled layers)
     FloatRect clipBounds = CGContextGetClipBoundingBox(context);
 
-    // The focus ring machinery needs to know the exact clip rect in a flipped, non-transformed coordinate system.
-    ThemeMac::setFocusRingClipRect(FloatRect(clipBounds.x(), layerBounds.size.height - clipBounds.maxY(), clipBounds.width(), clipBounds.height()));
+    // Set the focus ring clip rect which needs to be in base coordinates.
+    AffineTransform transform = CGContextGetCTM(context);
+    ThemeMac::setFocusRingClipRect(transform.mapRect(clipBounds));
 
 #if !defined(BUILDING_ON_SNOW_LEOPARD)
     __block GraphicsContext* ctx = &graphicsContext;