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

Unified Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp

Issue 2169273004: Switch all LayoutTests to use new accessibility relative bounding box API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix absolute bounds in AXInlineTextBox::elementRect Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
index baa008606aa270dee1285506c565e58a9ef0362e..65195a054ac0f0816f56d3421cc778da5ba2a696 100644
--- a/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2D.cpp
@@ -988,12 +988,12 @@ void CanvasRenderingContext2D::updateElementAccessibility(const Path& path, Elem
Path transformedPath = path;
transformedPath.transform(state().transform());
- // Offset by the canvas rect, taking border and padding into account.
- IntRect canvasRect = renderer->absoluteBoundingBoxRect();
- canvasRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop() + lbmo->paddingTop());
+ // Add border and padding to the bounding rect.
LayoutRect elementRect = enclosingLayoutRect(transformedPath.boundingRect());
- elementRect.moveBy(canvasRect.location());
- axObjectCache->setCanvasObjectBounds(element, elementRect);
+ elementRect.move(lbmo->borderLeft() + lbmo->paddingLeft(), lbmo->borderTop() + lbmo->paddingTop());
+
+ // Update the accessible object.
+ axObjectCache->setCanvasObjectBounds(canvas(), element, elementRect);
}
void CanvasRenderingContext2D::addHitRegion(const HitRegionOptions& options, ExceptionState& exceptionState)

Powered by Google App Engine
This is Rietveld 408576698