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

Unified Diff: Source/modules/accessibility/AXObjectCacheImpl.cpp

Issue 1061063004: Revert of Don't keep recreating AXMenuListPopup (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@suppress_extra_events
Patch Set: Created 5 years, 8 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 | « Source/modules/accessibility/AXMenuListPopup.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXObjectCacheImpl.cpp
diff --git a/Source/modules/accessibility/AXObjectCacheImpl.cpp b/Source/modules/accessibility/AXObjectCacheImpl.cpp
index c2fc4eb428fb37276e71ef6aeba470cd71afbca5..a70a16ea3b0420532e71bb8a1c3df47f56d8772b 100644
--- a/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -203,19 +203,6 @@
return m_objects.get(axID);
}
-// Returns true if |node| is an <option> element and its parent <select>
-// is a menu list (not a list box).
-static bool isMenuListOption(Node* node)
-{
- if (!isHTMLOptionElement(node))
- return false;
- Element* parent = node->parentElement();
- if (!isHTMLSelectElement(parent))
- return false;
- LayoutObject* layoutObject = toHTMLSelectElement(node->parentElement())->layoutObject();
- return layoutObject && layoutObject->isMenuList();
-}
-
AXObject* AXObjectCacheImpl::get(Node* node)
{
if (!node)
@@ -227,7 +214,7 @@
AXID nodeID = m_nodeObjectMapping.get(node);
ASSERT(!HashTraits<AXID>::isDeletedValue(nodeID));
- if (node->layoutObject() && nodeID && !layoutID && !isMenuListOption(node)) {
+ if (node->layoutObject() && nodeID && !layoutID) {
// This can happen if an AXNodeObject is created for a node that's not
// laid out, but later something changes and it gets a layoutObject (like if it's
// reparented).
@@ -325,9 +312,6 @@
PassRefPtr<AXObject> AXObjectCacheImpl::createFromNode(Node* node)
{
- if (isMenuListOption(node))
- return AXMenuListOption::create(toHTMLOptionElement(node), this);
-
return AXNodeObject::create(node, this);
}
@@ -384,7 +368,7 @@
// Or if it's a hidden element, but we still want to expose it because of other ARIA attributes.
bool inCanvasSubtree = node->parentElement()->isInCanvasSubtree();
bool isHidden = !node->layoutObject() && isNodeAriaVisible(node);
- if (!inCanvasSubtree && !isHidden && !isMenuListOption(node))
+ if (!inCanvasSubtree && !isHidden)
return 0;
RefPtr<AXObject> newObj = createFromNode(node);
@@ -476,6 +460,9 @@
break;
case MenuListPopupRole:
obj = AXMenuListPopup::create(this);
+ break;
+ case MenuListOptionRole:
+ obj = AXMenuListOption::create(this);
break;
case SpinButtonRole:
obj = AXSpinButton::create(this);
« no previous file with comments | « Source/modules/accessibility/AXMenuListPopup.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698