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 Intel Corporation. All rights reserved. | 8 * Copyright (C) 2012 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 2324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2335 attributes->setAlpha(m_hasAlpha); | 2335 attributes->setAlpha(m_hasAlpha); |
2336 return attributes.release(); | 2336 return attributes.release(); |
2337 } | 2337 } |
2338 | 2338 |
2339 void CanvasRenderingContext2D::drawSystemFocusRing(Element* element) | 2339 void CanvasRenderingContext2D::drawSystemFocusRing(Element* element) |
2340 { | 2340 { |
2341 if (!focusRingCallIsValid(m_path, element)) | 2341 if (!focusRingCallIsValid(m_path, element)) |
2342 return; | 2342 return; |
2343 | 2343 |
2344 updateFocusRingAccessibility(m_path, element); | 2344 updateFocusRingAccessibility(m_path, element); |
2345 if (element->focused()) | 2345 // Note: we need to check document->focusedElement() rather than just callin
g |
| 2346 // element->focused(), because element->focused() isn't updated until after |
| 2347 // focus events fire. |
| 2348 if (element->document() && element->document()->focusedElement() == element) |
2346 drawFocusRing(m_path); | 2349 drawFocusRing(m_path); |
2347 } | 2350 } |
2348 | 2351 |
2349 bool CanvasRenderingContext2D::drawCustomFocusRing(Element* element) | 2352 bool CanvasRenderingContext2D::drawCustomFocusRing(Element* element) |
2350 { | 2353 { |
2351 if (!focusRingCallIsValid(m_path, element)) | 2354 if (!focusRingCallIsValid(m_path, element)) |
2352 return false; | 2355 return false; |
2353 | 2356 |
2354 updateFocusRingAccessibility(m_path, element); | 2357 updateFocusRingAccessibility(m_path, element); |
2355 | 2358 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2401 Color focusRingColor = RenderTheme::focusRingColor(); | 2404 Color focusRingColor = RenderTheme::focusRingColor(); |
2402 const int focusRingWidth = 5; | 2405 const int focusRingWidth = 5; |
2403 const int focusRingOutline = 0; | 2406 const int focusRingOutline = 0; |
2404 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); | 2407 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); |
2405 didDraw(path.boundingRect()); | 2408 didDraw(path.boundingRect()); |
2406 | 2409 |
2407 c->restore(); | 2410 c->restore(); |
2408 } | 2411 } |
2409 | 2412 |
2410 } // namespace WebCore | 2413 } // namespace WebCore |
OLD | NEW |