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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 1692183002: Canvas2d: The control in hit region should be a canvas fallback element. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp ('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 2216 matching lines...) Expand 10 before | Expand all | Expand 10 after
2227 axObjectCache->setCanvasObjectBounds(element, elementRect); 2227 axObjectCache->setCanvasObjectBounds(element, elementRect);
2228 } 2228 }
2229 2229
2230 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState) 2230 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState)
2231 { 2231 {
2232 if (options.id().isEmpty() && !options.control()) { 2232 if (options.id().isEmpty() && !options.control()) {
2233 exceptionState.throwDOMException(NotSupportedError, "Both id and control are null."); 2233 exceptionState.throwDOMException(NotSupportedError, "Both id and control are null.");
2234 return; 2234 return;
2235 } 2235 }
2236 2236
2237 if (options.control() && !canvas()->isSupportedInteractiveCanvasFallback(*op tions.control())) {
2238 exceptionState.throwDOMException(NotSupportedError, "The control is neit her null nor a supported interactive canvas fallback element.");
2239 return;
2240 }
2241
2237 Path hitRegionPath = options.hasPath() ? options.path()->path() : m_path; 2242 Path hitRegionPath = options.hasPath() ? options.path()->path() : m_path;
2238 2243
2239 SkCanvas* c = drawingCanvas(); 2244 SkCanvas* c = drawingCanvas();
2240 2245
2241 if (hitRegionPath.isEmpty() || !c || !state().isTransformInvertible() 2246 if (hitRegionPath.isEmpty() || !c || !state().isTransformInvertible()
2242 || !c->getClipDeviceBounds(0)) { 2247 || !c->getClipDeviceBounds(0)) {
2243 exceptionState.throwDOMException(NotSupportedError, "The specified path has no pixels."); 2248 exceptionState.throwDOMException(NotSupportedError, "The specified path has no pixels.");
2244 return; 2249 return;
2245 } 2250 }
2246 2251
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) 2360 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage)
2356 return; 2361 return;
2357 if (alpha < 0xFF) 2362 if (alpha < 0xFF)
2358 return; 2363 return;
2359 } 2364 }
2360 2365
2361 canvas()->buffer()->willOverwriteCanvas(); 2366 canvas()->buffer()->willOverwriteCanvas();
2362 } 2367 }
2363 2368
2364 } // namespace blink 2369 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLCanvasElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698