OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008, 2010 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> | 4 * Copyright (C) 2007 Alp Toker <alp@atoker.com> |
5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 5 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> | 6 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> |
7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 7 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012, 2013 Intel Corporation. All rights reserved. |
9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 9 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
10 * | 10 * |
(...skipping 2265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2276 } | 2276 } |
2277 } | 2277 } |
2278 } | 2278 } |
2279 | 2279 |
2280 void CanvasRenderingContext2D::drawFocusRing(const Path& path) | 2280 void CanvasRenderingContext2D::drawFocusRing(const Path& path) |
2281 { | 2281 { |
2282 GraphicsContext* c = drawingContext(); | 2282 GraphicsContext* c = drawingContext(); |
2283 if (!c) | 2283 if (!c) |
2284 return; | 2284 return; |
2285 | 2285 |
| 2286 // These should match the style defined in html.css. |
| 2287 Color focusRingColor = RenderTheme::theme().focusRingColor(); |
| 2288 const int focusRingWidth = 5; |
| 2289 const int focusRingOutline = 0; |
| 2290 |
| 2291 // We need to add focusRingWidth to dirtyRect. |
| 2292 StrokeData strokeData; |
| 2293 strokeData.setThickness(focusRingWidth); |
| 2294 |
2286 FloatRect dirtyRect; | 2295 FloatRect dirtyRect; |
2287 if (!computeDirtyRect(path.boundingRect(), &dirtyRect)) | 2296 if (!computeDirtyRect(path.strokeBoundingRect(strokeData), &dirtyRect)) |
2288 return; | 2297 return; |
2289 | 2298 |
2290 c->save(); | 2299 c->save(); |
2291 c->setAlphaAsFloat(1.0); | 2300 c->setAlphaAsFloat(1.0); |
2292 c->clearShadow(); | 2301 c->clearShadow(); |
2293 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); | 2302 c->setCompositeOperation(CompositeSourceOver, blink::WebBlendModeNormal); |
2294 | |
2295 // These should match the style defined in html.css. | |
2296 Color focusRingColor = RenderTheme::theme().focusRingColor(); | |
2297 const int focusRingWidth = 5; | |
2298 const int focusRingOutline = 0; | |
2299 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2303 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
2300 | |
2301 c->restore(); | 2304 c->restore(); |
2302 | 2305 |
2303 didDraw(dirtyRect); | 2306 didDraw(dirtyRect); |
2304 } | 2307 } |
2305 | 2308 |
2306 } // namespace WebCore | 2309 } // namespace WebCore |
OLD | NEW |