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

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

Issue 2713453002: Revert of Correctly compute parent of AXMenuListOption (Closed)
Patch Set: 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 4ef4a5fa86e2a93091d1a13905c5583b8fcd0837..7e91b0f4ff522bd176e5efabaf6ce7985424dcb3 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -470,13 +470,14 @@
(*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 || !inspectedAXObject->isAXLayoutObject())
+ if (!inspectedAXObject)
return Response::OK();
AXObject* parent = inspectedAXObject->parentObjectUnignored();
@@ -697,19 +698,6 @@
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,
@@ -728,14 +716,14 @@
childIds->addItem(String::number(childAXObject.axObjectID()));
if (&childAXObject == inspectedAXObject)
continue;
- if (&axObject != inspectedAXObject) {
- if (!inspectedAXObject)
- continue;
- if (&axObject != inspectedAXObject->parentObjectUnignored())
- continue;
- }
-
- // Only add children/siblings of inspected node to returned nodes.
+ if (&axObject != inspectedAXObject &&
+ (axObject.getNode() ||
+ axObject.parentObjectUnignored() != inspectedAXObject)) {
+ continue;
+ }
+
+ // Only add children of inspected node (or un-inspectable children 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