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 2161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 Loading... | |
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 |
OLD | NEW |