| 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 970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 981 AXObjectCache* axObjectCache = element->document().existingAXObjectCache(); | 981 AXObjectCache* axObjectCache = element->document().existingAXObjectCache(); |
| 982 LayoutBoxModelObject* lbmo = canvas()->layoutBoxModelObject(); | 982 LayoutBoxModelObject* lbmo = canvas()->layoutBoxModelObject(); |
| 983 LayoutObject* renderer = canvas()->layoutObject(); | 983 LayoutObject* renderer = canvas()->layoutObject(); |
| 984 if (!axObjectCache || !lbmo || !renderer) | 984 if (!axObjectCache || !lbmo || !renderer) |
| 985 return; | 985 return; |
| 986 | 986 |
| 987 // Get the transformed path. | 987 // Get the transformed path. |
| 988 Path transformedPath = path; | 988 Path transformedPath = path; |
| 989 transformedPath.transform(state().transform()); | 989 transformedPath.transform(state().transform()); |
| 990 | 990 |
| 991 // Offset by the canvas rect, taking border and padding into account. | 991 // Add border and padding to the bounding rect. |
| 992 IntRect canvasRect = renderer->absoluteBoundingBoxRect(); | |
| 993 canvasRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop()
+ lbmo->paddingTop()); | |
| 994 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect())
; | 992 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect())
; |
| 995 elementRect.moveBy(canvasRect.location()); | 993 elementRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop()
+ lbmo->paddingTop()); |
| 996 axObjectCache->setCanvasObjectBounds(element, elementRect); | 994 |
| 995 // Update the accessible object. |
| 996 axObjectCache->setCanvasObjectBounds(canvas(), element, elementRect); |
| 997 } | 997 } |
| 998 | 998 |
| 999 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc
eptionState& exceptionState) | 999 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc
eptionState& exceptionState) |
| 1000 { | 1000 { |
| 1001 if (options.id().isEmpty() && !options.control()) { | 1001 if (options.id().isEmpty() && !options.control()) { |
| 1002 exceptionState.throwDOMException(NotSupportedError, "Both id and control
are null."); | 1002 exceptionState.throwDOMException(NotSupportedError, "Both id and control
are null."); |
| 1003 return; | 1003 return; |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 if (options.control() && !canvas()->isSupportedInteractiveCanvasFallback(*op
tions.control())) { | 1006 if (options.control() && !canvas()->isSupportedInteractiveCanvasFallback(*op
tions.control())) { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 return true; | 1097 return true; |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void CanvasRenderingContext2D::resetUsageTracking() | 1100 void CanvasRenderingContext2D::resetUsageTracking() |
| 1101 { | 1101 { |
| 1102 UsageCounters newCounters; | 1102 UsageCounters newCounters; |
| 1103 m_usageCounters = newCounters; | 1103 m_usageCounters = newCounters; |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 } // namespace blink | 1106 } // namespace blink |
| OLD | NEW |