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

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

Issue 1242263002: Canvas2d: Fix a bug to update incorrect rect bounds for accessibility. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp » ('j') | 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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after
2172 LayoutBoxModelObject* lbmo = canvas()->layoutBoxModelObject(); 2172 LayoutBoxModelObject* lbmo = canvas()->layoutBoxModelObject();
2173 LayoutObject* renderer = canvas()->layoutObject(); 2173 LayoutObject* renderer = canvas()->layoutObject();
2174 if (!axObjectCache || !lbmo || !renderer) 2174 if (!axObjectCache || !lbmo || !renderer)
2175 return; 2175 return;
2176 2176
2177 // Get the transformed path. 2177 // Get the transformed path.
2178 Path transformedPath = path; 2178 Path transformedPath = path;
2179 transformedPath.transform(state().transform()); 2179 transformedPath.transform(state().transform());
2180 2180
2181 // Offset by the canvas rect, taking border and padding into account. 2181 // Offset by the canvas rect, taking border and padding into account.
2182 element->document().updateLayoutIgnorePendingStylesheets();
Justin Novosad 2015/07/27 14:36:36 You should to do this update update before calling
zino 2015/07/28 00:38:48 Done.
2182 IntRect canvasRect = renderer->absoluteBoundingBoxRect(); 2183 IntRect canvasRect = renderer->absoluteBoundingBoxRect();
2183 canvasRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop() + lbmo->paddingTop()); 2184 canvasRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop() + lbmo->paddingTop());
2184 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect()) ; 2185 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect()) ;
2185 elementRect.moveBy(canvasRect.location()); 2186 elementRect.moveBy(canvasRect.location());
2186 axObjectCache->setCanvasObjectBounds(element, elementRect); 2187 axObjectCache->setCanvasObjectBounds(element, elementRect);
2187 } 2188 }
2188 2189
2189 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState) 2190 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc eptionState& exceptionState)
2190 { 2191 {
2191 if (options.id().isEmpty() && !options.control()) { 2192 if (options.id().isEmpty() && !options.control()) {
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2316 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage) 2317 if (imageType == CanvasRenderingContext2DState::NonOpaqueImage)
2317 return; 2318 return;
2318 if (alpha < 0xFF) 2319 if (alpha < 0xFF)
2319 return; 2320 return;
2320 } 2321 }
2321 2322
2322 canvas()->buffer()->willOverwriteCanvas(); 2323 canvas()->buffer()->willOverwriteCanvas();
2323 } 2324 }
2324 2325
2325 } // namespace blink 2326 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/modules/canvas2d/CanvasRenderingContext2DAPITest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698