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

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

Issue 2670023002: Correctly compute parent of AXMenuListOption (Closed)
Patch Set: Rebaseline Created 3 years, 10 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/modules/accessibility/InspectorAccessibilityAgent.h ('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/InspectorAccessibilityAgent.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
index 7e91b0f4ff522bd176e5efabaf6ce7985424dcb3..4ef4a5fa86e2a93091d1a13905c5583b8fcd0837 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -470,14 +470,13 @@ Response InspectorAccessibilityAgent::getPartialAXTree(
(*nodes)->addItem(buildObjectForIgnoredNode(domNode, inspectedAXObject,
fetchRelatives.fromMaybe(true),
*nodes, *cache));
- return Response::OK();
} else {
(*nodes)->addItem(
buildProtocolAXObject(*inspectedAXObject, inspectedAXObject,
fetchRelatives.fromMaybe(true), *nodes, *cache));
}
- if (!inspectedAXObject)
+ if (!inspectedAXObject || !inspectedAXObject->isAXLayoutObject())
return Response::OK();
AXObject* parent = inspectedAXObject->parentObjectUnignored();
@@ -698,6 +697,19 @@ void InspectorAccessibilityAgent::populateRelatives(
nodeObject.setChildIds(std::move(childIds));
}
+void InspectorAccessibilityAgent::addChild(
+ std::unique_ptr<protocol::Array<AXNodeId>>& childIds,
+ AXObject& childAXObject,
+ AXObject* inspectedAXObject,
+ std::unique_ptr<protocol::Array<AXNode>>& nodes,
+ AXObjectCacheImpl& cache) const {
+ childIds->addItem(String::number(childAXObject.axObjectID()));
+ if (&childAXObject == inspectedAXObject)
+ return;
+ nodes->addItem(buildProtocolAXObject(childAXObject, inspectedAXObject, true,
+ nodes, cache));
+}
+
void InspectorAccessibilityAgent::addChildren(
AXObject& axObject,
AXObject* inspectedAXObject,
@@ -716,14 +728,14 @@ void InspectorAccessibilityAgent::addChildren(
childIds->addItem(String::number(childAXObject.axObjectID()));
if (&childAXObject == inspectedAXObject)
continue;
- if (&axObject != inspectedAXObject &&
- (axObject.getNode() ||
- axObject.parentObjectUnignored() != inspectedAXObject)) {
- continue;
+ if (&axObject != inspectedAXObject) {
+ if (!inspectedAXObject)
+ continue;
+ if (&axObject != inspectedAXObject->parentObjectUnignored())
+ continue;
}
- // Only add children of inspected node (or un-inspectable children of
- // inspected node) to returned nodes.
+ // Only add children/siblings of inspected node to returned nodes.
std::unique_ptr<AXNode> childNode = buildProtocolAXObject(
childAXObject, inspectedAXObject, true, nodes, cache);
nodes->addItem(std::move(childNode));
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698