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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXObject.cpp

Issue 2324603002: Move AX local bounding box calculation into LayoutObject (Closed)
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
index efca9f950e1b73f6ce468aedfcc5354651e6164c..3167659f49f35e6729150c58318bc73291de8ec4 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -39,8 +39,6 @@
#include "core/html/HTMLFrameOwnerElement.h"
#include "core/html/parser/HTMLParserIdioms.h"
#include "core/layout/LayoutBox.h"
-#include "core/layout/LayoutInline.h"
-#include "core/layout/LayoutTheme.h"
#include "modules/accessibility/AXObjectCacheImpl.h"
#include "platform/UserGestureIndicator.h"
#include "platform/text/PlatformLocale.h"
@@ -1361,27 +1359,7 @@ void AXObject::getRelativeBounds(AXObject** outContainer, FloatRect& outBoundsIn
if (!container)
return;
*outContainer = container;
-
- // Next get the local bounds of this LayoutObject, which is typically
- // a rect at point (0, 0) with the width and height of the LayoutObject.
- LayoutRect localBounds;
- if (layoutObject->isText()) {
- Vector<FloatQuad> quads;
- toLayoutText(layoutObject)->quads(quads, LayoutText::ClipToEllipsis, LayoutText::LocalQuads);
- for (const FloatQuad& quad : quads)
- localBounds.unite(LayoutRect(quad.boundingBox()));
- } else if (layoutObject->isLayoutInline()) {
- Vector<LayoutRect> rects;
- toLayoutInline(layoutObject)->addOutlineRects(rects, LayoutPoint(), LayoutObject::IncludeBlockVisualOverflow);
- localBounds = unionRect(rects);
- } else if (layoutObject->isBox()) {
- localBounds = LayoutRect(LayoutPoint(), toLayoutBox(layoutObject)->size());
- } else if (layoutObject->isSVG()) {
- localBounds = LayoutRect(layoutObject->strokeBoundingBox());
- } else {
- DCHECK(false);
- }
- outBoundsInContainer = FloatRect(localBounds);
+ outBoundsInContainer = layoutObject->localBoundingBoxRectForAccessibility();
// If the container has a scroll offset, subtract that out because we want our
// bounds to be relative to the *unscrolled* position of the container object.
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698