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

Side by Side Diff: Source/modules/accessibility/AXObject.cpp

Issue 1348503003: One AXObjectCache per frame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Send focus notifications when focus is cleared Created 5 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
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 893 matching lines...) Expand 10 before | Expand all | Expand 10 after
904 if (obj->style()->hasAppearance()) 904 if (obj->style()->hasAppearance())
905 LayoutTheme::theme().addVisualOverflow(*obj, r); 905 LayoutTheme::theme().addVisualOverflow(*obj, r);
906 result.unite(r); 906 result.unite(r);
907 } 907 }
908 } 908 }
909 return result; 909 return result;
910 } 910 }
911 911
912 AXObject* AXObject::elementAccessibilityHitTest(const IntPoint& point) const 912 AXObject* AXObject::elementAccessibilityHitTest(const IntPoint& point) const
913 { 913 {
914 // Send the hit test back into the sub-frame if necessary.
915 if (isAttachment()) {
916 Widget* widget = widgetForAttachmentView();
917 // Normalize the point for the widget's bounds.
918 if (widget && widget->isFrameView())
919 return axObjectCache().getOrCreate(widget)->accessibilityHitTest(Int Point(point - widget->frameRect().location()));
920 }
921
922 // Check if there are any mock elements that need to be handled. 914 // Check if there are any mock elements that need to be handled.
923 for (const auto& child : m_children) { 915 for (const auto& child : m_children) {
924 if (child->isMockObject() && child->elementRect().contains(point)) 916 if (child->isMockObject() && child->elementRect().contains(point))
925 return child->elementAccessibilityHitTest(point); 917 return child->elementAccessibilityHitTest(point);
926 } 918 }
927 919
928 return const_cast<AXObject*>(this); 920 return const_cast<AXObject*>(this);
929 } 921 }
930 922
931 const AXObject::AccessibilityChildrenVector& AXObject::children() 923 const AXObject::AccessibilityChildrenVector& AXObject::children()
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 void AXObject::clearChildren() 970 void AXObject::clearChildren()
979 { 971 {
980 // Detach all weak pointers from objects to their parents. 972 // Detach all weak pointers from objects to their parents.
981 for (const auto& child : m_children) 973 for (const auto& child : m_children)
982 child->detachFromParent(); 974 child->detachFromParent();
983 975
984 m_children.clear(); 976 m_children.clear();
985 m_haveChildren = false; 977 m_haveChildren = false;
986 } 978 }
987 979
988 AXObject* AXObject::focusedUIElement() const
989 {
990 Document* doc = document();
991 if (!doc)
992 return 0;
993
994 Page* page = doc->page();
995 if (!page)
996 return 0;
997
998 return axObjectCache().focusedUIElementForPage(page);
999 }
1000
1001 Document* AXObject::document() const 980 Document* AXObject::document() const
1002 { 981 {
1003 FrameView* frameView = documentFrameView(); 982 FrameView* frameView = documentFrameView();
1004 if (!frameView) 983 if (!frameView)
1005 return 0; 984 return 0;
1006 985
1007 return frameView->frame().document(); 986 return frameView->frame().document();
1008 } 987 }
1009 988
1010 FrameView* AXObject::documentFrameView() const 989 FrameView* AXObject::documentFrameView() const
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
1501 1480
1502 DEFINE_TRACE(AXObject) 1481 DEFINE_TRACE(AXObject)
1503 { 1482 {
1504 visitor->trace(m_children); 1483 visitor->trace(m_children);
1505 visitor->trace(m_parent); 1484 visitor->trace(m_parent);
1506 visitor->trace(m_cachedLiveRegionRoot); 1485 visitor->trace(m_cachedLiveRegionRoot);
1507 visitor->trace(m_axObjectCache); 1486 visitor->trace(m_axObjectCache);
1508 } 1487 }
1509 1488
1510 } // namespace blink 1489 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698