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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "core/css/resolver/StyleResolver.h" 32 #include "core/css/resolver/StyleResolver.h"
33 #include "core/editing/EditingUtilities.h" 33 #include "core/editing/EditingUtilities.h"
34 #include "core/editing/VisibleUnits.h" 34 #include "core/editing/VisibleUnits.h"
35 #include "core/frame/FrameView.h" 35 #include "core/frame/FrameView.h"
36 #include "core/frame/LocalFrame.h" 36 #include "core/frame/LocalFrame.h"
37 #include "core/frame/Settings.h" 37 #include "core/frame/Settings.h"
38 #include "core/html/HTMLDialogElement.h" 38 #include "core/html/HTMLDialogElement.h"
39 #include "core/html/HTMLFrameOwnerElement.h" 39 #include "core/html/HTMLFrameOwnerElement.h"
40 #include "core/html/parser/HTMLParserIdioms.h" 40 #include "core/html/parser/HTMLParserIdioms.h"
41 #include "core/layout/LayoutBox.h" 41 #include "core/layout/LayoutBox.h"
42 #include "core/layout/LayoutInline.h"
43 #include "core/layout/LayoutTheme.h"
44 #include "modules/accessibility/AXObjectCacheImpl.h" 42 #include "modules/accessibility/AXObjectCacheImpl.h"
45 #include "platform/UserGestureIndicator.h" 43 #include "platform/UserGestureIndicator.h"
46 #include "platform/text/PlatformLocale.h" 44 #include "platform/text/PlatformLocale.h"
47 #include "wtf/HashSet.h" 45 #include "wtf/HashSet.h"
48 #include "wtf/StdLibExtras.h" 46 #include "wtf/StdLibExtras.h"
49 #include "wtf/text/WTFString.h" 47 #include "wtf/text/WTFString.h"
50 48
51 using blink::WebLocalizedString; 49 using blink::WebLocalizedString;
52 50
53 namespace blink { 51 namespace blink {
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 if (container->isScrollableContainer() || containerLayoutObject->has Layer()) 1352 if (container->isScrollableContainer() || containerLayoutObject->has Layer())
1355 break; 1353 break;
1356 } 1354 }
1357 1355
1358 container = container->parentObjectUnignored(); 1356 container = container->parentObjectUnignored();
1359 } 1357 }
1360 1358
1361 if (!container) 1359 if (!container)
1362 return; 1360 return;
1363 *outContainer = container; 1361 *outContainer = container;
1364 1362 outBoundsInContainer = layoutObject->localBoundingBoxRectForAccessibility();
1365 // Next get the local bounds of this LayoutObject, which is typically
1366 // a rect at point (0, 0) with the width and height of the LayoutObject.
1367 LayoutRect localBounds;
1368 if (layoutObject->isText()) {
1369 Vector<FloatQuad> quads;
1370 toLayoutText(layoutObject)->quads(quads, LayoutText::ClipToEllipsis, Lay outText::LocalQuads);
1371 for (const FloatQuad& quad : quads)
1372 localBounds.unite(LayoutRect(quad.boundingBox()));
1373 } else if (layoutObject->isLayoutInline()) {
1374 Vector<LayoutRect> rects;
1375 toLayoutInline(layoutObject)->addOutlineRects(rects, LayoutPoint(), Layo utObject::IncludeBlockVisualOverflow);
1376 localBounds = unionRect(rects);
1377 } else if (layoutObject->isBox()) {
1378 localBounds = LayoutRect(LayoutPoint(), toLayoutBox(layoutObject)->size( ));
1379 } else if (layoutObject->isSVG()) {
1380 localBounds = LayoutRect(layoutObject->strokeBoundingBox());
1381 } else {
1382 DCHECK(false);
1383 }
1384 outBoundsInContainer = FloatRect(localBounds);
1385 1363
1386 // If the container has a scroll offset, subtract that out because we want o ur 1364 // If the container has a scroll offset, subtract that out because we want o ur
1387 // bounds to be relative to the *unscrolled* position of the container objec t. 1365 // bounds to be relative to the *unscrolled* position of the container objec t.
1388 ScrollableArea* scrollableArea = container->getScrollableAreaIfScrollable(); 1366 ScrollableArea* scrollableArea = container->getScrollableAreaIfScrollable();
1389 if (scrollableArea && !container->isWebArea()) { 1367 if (scrollableArea && !container->isWebArea()) {
1390 IntPoint scrollPosition = scrollableArea->scrollPosition(); 1368 IntPoint scrollPosition = scrollableArea->scrollPosition();
1391 outBoundsInContainer.move(FloatSize(scrollPosition.x(), scrollPosition.y ())); 1369 outBoundsInContainer.move(FloatSize(scrollPosition.x(), scrollPosition.y ()));
1392 } 1370 }
1393 1371
1394 // Compute the transform between the container's coordinate space and this o bject. 1372 // Compute the transform between the container's coordinate space and this o bject.
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
1818 1796
1819 DEFINE_TRACE(AXObject) 1797 DEFINE_TRACE(AXObject)
1820 { 1798 {
1821 visitor->trace(m_children); 1799 visitor->trace(m_children);
1822 visitor->trace(m_parent); 1800 visitor->trace(m_parent);
1823 visitor->trace(m_cachedLiveRegionRoot); 1801 visitor->trace(m_cachedLiveRegionRoot);
1824 visitor->trace(m_axObjectCache); 1802 visitor->trace(m_axObjectCache);
1825 } 1803 }
1826 1804
1827 } // namespace blink 1805 } // namespace blink
OLDNEW
« 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