Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Unified Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 200283003: drawFocusRing() function in CRC2D draws invalid focus ring. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: layout test Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/canvas/CanvasRenderingContext2D.cpp
diff --git a/Source/core/html/canvas/CanvasRenderingContext2D.cpp b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
index 3072c2bc1eed928c9dbb7cea67b29dda821bb365..efc514f5b657333033c8ba3c64a413c7de85e636 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -2283,21 +2283,24 @@ void CanvasRenderingContext2D::drawFocusRing(const Path& path)
if (!c)
return;
+ // These should match the style defined in html.css.
+ Color focusRingColor = RenderTheme::theme().focusRingColor();
+ const int focusRingWidth = 1;
Justin Novosad 2014/03/17 13:57:11 How come this value changed? Seems unrelated to t
+ const int focusRingOutline = 0;
+
+ // We need to add focusRingWidth to dirtyRect.
+ StrokeData strokeData;
+ strokeData.setThickness(focusRingWidth);
+
FloatRect dirtyRect;
- if (!computeDirtyRect(path.boundingRect(), &dirtyRect))
+ if (!computeDirtyRect(path.strokeBoundingRect(strokeData), &dirtyRect))
return;
c->save();
c->setAlphaAsFloat(1.0);
c->clearShadow();
c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal);
-
- // These should match the style defined in html.css.
- Color focusRingColor = RenderTheme::theme().focusRingColor();
- const int focusRingWidth = 5;
- const int focusRingOutline = 0;
c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
-
c->restore();
didDraw(dirtyRect);
« no previous file with comments | « LayoutTests/fast/canvas/draw-system-focus-ring-dirty-rect.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698