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 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 scrollPathIntoViewInternal(m_path); | 1270 scrollPathIntoViewInternal(m_path); |
1271 } | 1271 } |
1272 | 1272 |
1273 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d) | 1273 void CanvasRenderingContext2D::scrollPathIntoView(Path2D* path2d) |
1274 { | 1274 { |
1275 scrollPathIntoViewInternal(path2d->path()); | 1275 scrollPathIntoViewInternal(path2d->path()); |
1276 } | 1276 } |
1277 | 1277 |
1278 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path) | 1278 void CanvasRenderingContext2D::scrollPathIntoViewInternal(const Path& path) |
1279 { | 1279 { |
1280 LayoutObject* renderer = canvas()->renderer(); | 1280 LayoutObject* renderer = canvas()->layoutObject(); |
1281 LayoutBox* layoutBox = canvas()->layoutBox(); | 1281 LayoutBox* layoutBox = canvas()->layoutBox(); |
1282 if (!renderer || !layoutBox || !state().m_invertibleCTM || path.isEmpty()) | 1282 if (!renderer || !layoutBox || !state().m_invertibleCTM || path.isEmpty()) |
1283 return; | 1283 return; |
1284 | 1284 |
1285 canvas()->document().updateLayoutIgnorePendingStylesheets(); | 1285 canvas()->document().updateLayoutIgnorePendingStylesheets(); |
1286 | 1286 |
1287 // Apply transformation and get the bounding rect | 1287 // Apply transformation and get the bounding rect |
1288 Path transformedPath = path; | 1288 Path transformedPath = path; |
1289 transformedPath.transform(state().m_transform); | 1289 transformedPath.transform(state().m_transform); |
1290 FloatRect boundingRect = transformedPath.boundingRect(); | 1290 FloatRect boundingRect = transformedPath.boundingRect(); |
(...skipping 1118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2409 AXObjectCache* axObjectCache = element->document().existingAXObjectCache(); | 2409 AXObjectCache* axObjectCache = element->document().existingAXObjectCache(); |
2410 if (!axObjectCache) | 2410 if (!axObjectCache) |
2411 return; | 2411 return; |
2412 | 2412 |
2413 // Get the transformed path. | 2413 // Get the transformed path. |
2414 Path transformedPath = path; | 2414 Path transformedPath = path; |
2415 transformedPath.transform(state().m_transform); | 2415 transformedPath.transform(state().m_transform); |
2416 | 2416 |
2417 // Offset by the canvas rect, taking border and padding into account. | 2417 // Offset by the canvas rect, taking border and padding into account. |
2418 LayoutBoxModelObject* rbmo = canvas()->layoutBoxModelObject(); | 2418 LayoutBoxModelObject* rbmo = canvas()->layoutBoxModelObject(); |
2419 IntRect canvasRect = canvas()->renderer()->absoluteBoundingBoxRect(); | 2419 IntRect canvasRect = canvas()->layoutObject()->absoluteBoundingBoxRect(); |
2420 canvasRect.move(rbmo->borderLeft() + rbmo->paddingLeft(), rbmo->borderTop()
+ rbmo->paddingTop()); | 2420 canvasRect.move(rbmo->borderLeft() + rbmo->paddingLeft(), rbmo->borderTop()
+ rbmo->paddingTop()); |
2421 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect())
; | 2421 LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect())
; |
2422 elementRect.moveBy(canvasRect.location()); | 2422 elementRect.moveBy(canvasRect.location()); |
2423 axObjectCache->setCanvasObjectBounds(element, elementRect); | 2423 axObjectCache->setCanvasObjectBounds(element, elementRect); |
2424 } | 2424 } |
2425 | 2425 |
2426 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc
eptionState& exceptionState) | 2426 void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, Exc
eptionState& exceptionState) |
2427 { | 2427 { |
2428 if (options.id().isEmpty() && !options.control()) { | 2428 if (options.id().isEmpty() && !options.control()) { |
2429 exceptionState.throwDOMException(NotSupportedError, "Both id and control
are null."); | 2429 exceptionState.throwDOMException(NotSupportedError, "Both id and control
are null."); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2552 if (imageType == NonOpaqueImage) | 2552 if (imageType == NonOpaqueImage) |
2553 return; | 2553 return; |
2554 if (alpha < 0xFF) | 2554 if (alpha < 0xFF) |
2555 return; | 2555 return; |
2556 } | 2556 } |
2557 | 2557 |
2558 canvas()->buffer()->willOverwriteCanvas(); | 2558 canvas()->buffer()->willOverwriteCanvas(); |
2559 } | 2559 } |
2560 | 2560 |
2561 } // namespace blink | 2561 } // namespace blink |
OLD | NEW |