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

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

Issue 21643002: Canvas focus outline should match style in html.css. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix compile Created 7 years, 4 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 | « Source/core/html/canvas/CanvasRenderingContext2D.h ('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 e8342072089e713747687c4ec34c892029963a88..7237511056123c56f429bf2e182705fc5d74b43c 100644
--- a/Source/core/html/canvas/CanvasRenderingContext2D.cpp
+++ b/Source/core/html/canvas/CanvasRenderingContext2D.cpp
@@ -2345,7 +2345,7 @@ void CanvasRenderingContext2D::drawSystemFocusRing(Element* element)
updateFocusRingAccessibility(m_path, element);
if (element->focused())
- drawFocusRing(m_path, element);
+ drawFocusRing(m_path);
}
bool CanvasRenderingContext2D::drawCustomFocusRing(Element* element)
@@ -2388,7 +2388,7 @@ void CanvasRenderingContext2D::updateFocusRingAccessibility(const Path& path, El
}
}
-void CanvasRenderingContext2D::drawFocusRing(const Path& path, Element* element)
+void CanvasRenderingContext2D::drawFocusRing(const Path& path)
{
GraphicsContext* c = drawingContext();
if (!c)
@@ -2399,9 +2399,11 @@ void CanvasRenderingContext2D::drawFocusRing(const Path& path, Element* element)
c->clearShadow();
c->setCompositeOperation(CompositeSourceOver, BlendModeNormal);
- RefPtr<RenderStyle> style(RenderStyle::createDefaultStyle());
+ // These should match the style defined in html.css.
Color focusRingColor = RenderTheme::focusRingColor();
- c->drawFocusRing(path, style->outlineWidth(), style->outlineOffset(), focusRingColor);
+ const int focusRingWidth = 5;
+ const int focusRingOutline = 0;
+ c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
didDraw(path.boundingRect());
c->restore();
« no previous file with comments | « Source/core/html/canvas/CanvasRenderingContext2D.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698