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

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.cpp

Issue 203293005: Fix crash in 2D canvas drawSystemFocusRing with invalid argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/canvas/draw-system-focus-ring-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after
2231 // override this for accessibility, but currently Blink doesn't take advanta ge of this. 2231 // override this for accessibility, but currently Blink doesn't take advanta ge of this.
2232 return element->focused(); 2232 return element->focused();
2233 } 2233 }
2234 2234
2235 bool CanvasRenderingContext2D::focusRingCallIsValid(const Path& path, Element* e lement) 2235 bool CanvasRenderingContext2D::focusRingCallIsValid(const Path& path, Element* e lement)
2236 { 2236 {
2237 if (!state().m_invertibleCTM) 2237 if (!state().m_invertibleCTM)
2238 return false; 2238 return false;
2239 if (path.isEmpty()) 2239 if (path.isEmpty())
2240 return false; 2240 return false;
2241 if (!element->isDescendantOf(canvas())) 2241 if (!element || !element->isDescendantOf(canvas()))
2242 return false; 2242 return false;
2243 2243
2244 return true; 2244 return true;
2245 } 2245 }
2246 2246
2247 void CanvasRenderingContext2D::updateFocusRingAccessibility(const Path& path, El ement* element) 2247 void CanvasRenderingContext2D::updateFocusRingAccessibility(const Path& path, El ement* element)
2248 { 2248 {
2249 if (!canvas()->renderer()) 2249 if (!canvas()->renderer())
2250 return; 2250 return;
2251 2251
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2297 const int focusRingWidth = 5; 2297 const int focusRingWidth = 5;
2298 const int focusRingOutline = 0; 2298 const int focusRingOutline = 0;
2299 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor); 2299 c->drawFocusRing(path, focusRingWidth, focusRingOutline, focusRingColor);
2300 2300
2301 c->restore(); 2301 c->restore();
2302 2302
2303 didDraw(dirtyRect); 2303 didDraw(dirtyRect);
2304 } 2304 }
2305 2305
2306 } // namespace WebCore 2306 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/canvas/draw-system-focus-ring-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698