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

Unified Diff: chrome/common/extensions/api/automation.idl

Issue 655273005: Implement AutomationNode.querySelector(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Fix heap-use-after-free issue by not keeping a scoped_ptr to automation_api_helper in extension_hel… Created 6 years, 1 month 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
Index: chrome/common/extensions/api/automation.idl
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl
index 015af4b583ad57322ae4c3d807a01cb13a3f60e5..9da10e0121c2b7066c00e612286a4b1aa88d265b 100644
--- a/chrome/common/extensions/api/automation.idl
+++ b/chrome/common/extensions/api/automation.idl
@@ -220,6 +220,9 @@
long height;
};
+ // Called when the result for a <code>query</code> is available.
+ callback QueryCallback = void(AutomationNode node);
+
// An event in the Automation tree.
[nocompile, noinline_doc] dictionary AutomationEvent {
// The $(ref:automation.AutomationNode) to which the event was targeted.
@@ -289,6 +292,22 @@
// Removes a listener for the given event type and event phase.
static void removeEventListener(
EventType eventType, AutomationListener listener, boolean capture);
+
+ // Gets the first node in this node's subtree which matches the given CSS
+ // selector and is within the same DOM context.
+ //
+ // If this node doesn't correspond directly with an HTML node in the DOM,
+ // querySelector will be run on this node's nearest HTML node ancestor. Note
+ // that this may result in the query returning a node which is not a
+ // descendant of this node.
+ //
+ // If the selector matches a node which doesn't directly correspond to an
+ // automation node (for example an element within an ARIA widget, where the
+ // ARIA widget forms one node of the automation tree, or an element which
+ // is hidden from accessibility via hiding it using CSS or using
+ // aria-hidden), this will return the nearest ancestor which does correspond
+ // to an automation node.
+ static void querySelector(DOMString selector, QueryCallback callback);
};
// Called when the <code>AutomationNode</code> for the page is available.

Powered by Google App Engine
This is Rietveld 408576698