Flutter Engine
The Flutter Engine
ax_node.h
Go to the documentation of this file.
1// Copyright 2013 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_ACCESSIBILITY_AX_NODE_H_
6#define UI_ACCESSIBILITY_AX_NODE_H_
7
8#include <cstdint>
9#include <memory>
10#include <optional>
11#include <ostream>
12#include <string>
13#include <vector>
14
16#include "ax_export.h"
17#include "ax_node_data.h"
18#include "ax_tree_id.h"
19#include "base/logging.h"
20#include "gfx/geometry/rect.h"
21#include "gfx/transform.h"
22
23#ifdef _WIN32
24// windowx.h defines GetNextSibling as a macro.
25#undef GetNextSibling
26#endif
27
28namespace ui {
29
30class AXTableInfo;
31
32// One node in an AXTree.
33class AX_EXPORT AXNode final {
34 public:
35 // Defines the type used for AXNode IDs.
36 using AXID = int32_t;
37
38 // TODO(chunhtai): I modified this to be -1 so it can work with flutter.
39 // If a node is not yet or no longer valid, its ID should have a value of
40 // kInvalidAXID.
41 static constexpr AXID kInvalidAXID = -1;
42
43 // Interface to the tree class that owns an AXNode. We use this instead
44 // of letting AXNode have a pointer to its AXTree directly so that we're
45 // forced to think twice before calling an AXTree interface that might not
46 // be necessary.
47 class OwnerTree {
48 public:
49 struct Selection {
57 };
58
59 // See AXTree::GetAXTreeID.
60 virtual AXTreeID GetAXTreeID() const = 0;
61 // See AXTree::GetTableInfo.
62 virtual AXTableInfo* GetTableInfo(const AXNode* table_node) const = 0;
63 // See AXTree::GetFromId.
64 virtual AXNode* GetFromId(int32_t id) const = 0;
65
66 virtual std::optional<int> GetPosInSet(const AXNode& node) = 0;
67 virtual std::optional<int> GetSetSize(const AXNode& node) = 0;
68
69 virtual Selection GetUnignoredSelection() const = 0;
70 virtual bool GetTreeUpdateInProgressState() const = 0;
71 virtual bool HasPaginationSupport() const = 0;
72 };
73
74 template <typename NodeType,
75 NodeType* (NodeType::*NextSibling)() const,
76 NodeType* (NodeType::*PreviousSibling)() const,
77 NodeType* (NodeType::*FirstChild)() const,
78 NodeType* (NodeType::*LastChild)() const>
80 public:
81 ChildIteratorBase(const NodeType* parent, NodeType* child);
84 bool operator==(const ChildIteratorBase& rhs) const;
85 bool operator!=(const ChildIteratorBase& rhs) const;
86 ChildIteratorBase& operator++();
87 ChildIteratorBase& operator--();
88 NodeType* get() const;
89 NodeType& operator*() const;
90 NodeType* operator->() const;
91
92 protected:
93 const NodeType* parent_;
94 NodeType* child_;
95 };
96
97 // The constructor requires a parent, id, and index in parent, but
98 // the data is not required. After initialization, only index_in_parent
99 // and unignored_index_in_parent is allowed to change, the others are
100 // guaranteed to never change.
101 AXNode(OwnerTree* tree,
102 AXNode* parent,
103 int32_t id,
104 size_t index_in_parent,
105 size_t unignored_index_in_parent = 0);
106 virtual ~AXNode();
107
108 // Accessors.
109 OwnerTree* tree() const { return tree_; }
110 AXID id() const { return data_.id; }
111 AXNode* parent() const { return parent_; }
112 const AXNodeData& data() const { return data_; }
113 const std::vector<AXNode*>& children() const { return children_; }
114 size_t index_in_parent() const { return index_in_parent_; }
115
116 // Returns ownership of |data_| to the caller; effectively clearing |data_|.
117 AXNodeData&& TakeData();
118
119 // Walking the tree skipping ignored nodes.
120 size_t GetUnignoredChildCount() const;
121 AXNode* GetUnignoredChildAtIndex(size_t index) const;
122 AXNode* GetUnignoredParent() const;
123 // Gets the unignored selection from the accessibility tree, meaning the
124 // selection whose endpoints are on unignored nodes. (An "ignored" node is a
125 // node that is not exposed to platform APIs: See `IsIgnored`.)
126 OwnerTree::Selection GetUnignoredSelection() const;
127 size_t GetUnignoredIndexInParent() const;
128 size_t GetIndexInParent() const;
129 AXNode* GetFirstUnignoredChild() const;
130 AXNode* GetLastUnignoredChild() const;
131 AXNode* GetDeepestFirstUnignoredChild() const;
132 AXNode* GetDeepestLastUnignoredChild() const;
133 AXNode* GetNextUnignoredSibling() const;
134 AXNode* GetPreviousUnignoredSibling() const;
135 AXNode* GetNextUnignoredInTreeOrder() const;
136 AXNode* GetPreviousUnignoredInTreeOrder() const;
137
144 UnignoredChildIterator UnignoredChildrenBegin() const;
145 UnignoredChildIterator UnignoredChildrenEnd() const;
146
147 // Walking the tree including both ignored and unignored nodes.
148 // These methods consider only the direct children or siblings of a node.
149 AXNode* GetFirstChild() const;
150 AXNode* GetLastChild() const;
151 AXNode* GetPreviousSibling() const;
152 AXNode* GetNextSibling() const;
153
154 // Returns true if the node has any of the text related roles, including
155 // kStaticText, kInlineTextBox and kListMarker (for Legacy Layout). Does not
156 // include any text field roles.
157 bool IsText() const;
158
159 // Returns true if the node has any line break related roles or is the child
160 // of a node with line break related roles.
161 bool IsLineBreak() const;
162
163 // Set the node's accessibility data. This may be done during initialization
164 // or later when the node data changes.
165 void SetData(const AXNodeData& src);
166
167 // Update this node's location. This is separate from |SetData| just because
168 // changing only the location is common and should be more efficient than
169 // re-copying all of the data.
170 //
171 // The node's location is stored as a relative bounding box, the ID of
172 // the element it's relative to, and an optional transformation matrix.
173 // See ax_node_data.h for details.
174 void SetLocation(int32_t offset_container_id,
175 const gfx::RectF& location,
177
178 // Set the index in parent, for example if siblings were inserted or deleted.
179 void SetIndexInParent(size_t index_in_parent);
180
181 // Update the unignored index in parent for unignored children.
182 void UpdateUnignoredCachedValues();
183
184 // Swap the internal children vector with |children|. This instance
185 // now owns all of the passed children.
186 void SwapChildren(std::vector<AXNode*>* children);
187
188 // This is called when the AXTree no longer includes this node in the
189 // tree. Reference counting is used on some platforms because the
190 // operating system may hold onto a reference to an AXNode
191 // object even after we're through with it, so this may decrement the
192 // reference count and clear out the object's data.
193 void Destroy();
194
195 // Return true if this object is equal to or a descendant of |ancestor|.
196 bool IsDescendantOf(const AXNode* ancestor) const;
197
198 bool IsDescendantOfCrossingTreeBoundary(const AXNode* ancestor) const;
199 AXNode* GetParentCrossingTreeBoundary() const;
200
201 // Gets the text offsets where new lines start either from the node's data or
202 // by computing them and caching the result.
203 std::vector<int> GetOrComputeLineStartOffsets();
204
205 // Accessing accessibility attributes.
206 // See |AXNodeData| for more information.
207
209 return data().HasBoolAttribute(attribute);
210 }
212 return data().GetBoolAttribute(attribute);
213 }
214 bool GetBoolAttribute(ax::mojom::BoolAttribute attribute, bool* value) const {
215 return data().GetBoolAttribute(attribute, value);
216 }
217
219 return data().HasFloatAttribute(attribute);
220 }
222 return data().GetFloatAttribute(attribute);
223 }
225 float* value) const {
226 return data().GetFloatAttribute(attribute, value);
227 }
228
230 return data().HasIntAttribute(attribute);
231 }
233 return data().GetIntAttribute(attribute);
234 }
235 bool GetIntAttribute(ax::mojom::IntAttribute attribute, int* value) const {
236 return data().GetIntAttribute(attribute, value);
237 }
238
240 return data().HasStringAttribute(attribute);
241 }
242 const std::string& GetStringAttribute(
243 ax::mojom::StringAttribute attribute) const {
244 return data().GetStringAttribute(attribute);
245 }
247 std::string* value) const {
248 return data().GetStringAttribute(attribute, value);
249 }
250
252 std::u16string* value) const {
253 return data().GetString16Attribute(attribute, value);
254 }
255 std::u16string GetString16Attribute(
256 ax::mojom::StringAttribute attribute) const {
257 return data().GetString16Attribute(attribute);
258 }
259
261 return data().HasIntListAttribute(attribute);
262 }
263 const std::vector<int32_t>& GetIntListAttribute(
264 ax::mojom::IntListAttribute attribute) const {
265 return data().GetIntListAttribute(attribute);
266 }
268 std::vector<int32_t>* value) const {
269 return data().GetIntListAttribute(attribute, value);
270 }
271
273 return data().HasStringListAttribute(attribute);
274 }
275 const std::vector<std::string>& GetStringListAttribute(
276 ax::mojom::StringListAttribute attribute) const {
277 return data().GetStringListAttribute(attribute);
278 }
280 std::vector<std::string>* value) const {
281 return data().GetStringListAttribute(attribute, value);
282 }
283
284 bool GetHtmlAttribute(const char* attribute, std::u16string* value) const {
285 return data().GetHtmlAttribute(attribute, value);
286 }
287 bool GetHtmlAttribute(const char* attribute, std::string* value) const {
288 return data().GetHtmlAttribute(attribute, value);
289 }
290
291 // Return the hierarchical level if supported.
292 std::optional<int> GetHierarchicalLevel() const;
293
294 // PosInSet and SetSize public methods.
295 bool IsOrderedSetItem() const;
296 bool IsOrderedSet() const;
297 std::optional<int> GetPosInSet();
298 std::optional<int> GetSetSize();
299
300 // Helpers for GetPosInSet and GetSetSize.
301 // Returns true if the role of ordered set matches the role of item.
302 // Returns false otherwise.
303 bool SetRoleMatchesItemRole(const AXNode* ordered_set) const;
304
305 // Container objects that should be ignored for computing PosInSet and SetSize
306 // for ordered sets.
307 bool IsIgnoredContainerForOrderedSet() const;
308
309 const std::string& GetInheritedStringAttribute(
310 ax::mojom::StringAttribute attribute) const;
311 std::u16string GetInheritedString16Attribute(
312 ax::mojom::StringAttribute attribute) const;
313 // Returns the text of this node and all descendant nodes; including text
314 // found in embedded objects.
315 //
316 // Only text displayed on screen is included. Text from ARIA and HTML
317 // attributes that is either not displayed on screen, or outside this node, is
318 // not returned.
319 std::string GetInnerText() const;
320
321 // Return a string representing the language code.
322 //
323 // This will consider the language declared in the DOM, and may eventually
324 // attempt to automatically detect the language from the text.
325 //
326 // This language code will be BCP 47.
327 //
328 // Returns empty string if no appropriate language was found.
329 std::string GetLanguage() const;
330
331 // Helper functions for tables, table rows, and table cells.
332 // Most of these functions construct and cache an AXTableInfo behind
333 // the scenes to infer many properties of tables.
334 //
335 // These interfaces use attributes provided by the source of the
336 // AX tree where possible, but fills in missing details and ignores
337 // specified attributes when they're bad or inconsistent. That way
338 // you're guaranteed to get a valid, consistent table when using these
339 // interfaces.
340 //
341
342 // Table-like nodes (including grids). All indices are 0-based except
343 // ARIA indices are all 1-based. In other words, the top-left corner
344 // of the table is row 0, column 0, cell index 0 - but that same cell
345 // has a minimum ARIA row index of 1 and column index of 1.
346 //
347 // The below methods return std::nullopt if the AXNode they are called on is
348 // not inside a table.
349 bool IsTable() const;
350 std::optional<int> GetTableColCount() const;
351 std::optional<int> GetTableRowCount() const;
352 std::optional<int> GetTableAriaColCount() const;
353 std::optional<int> GetTableAriaRowCount() const;
354 std::optional<int> GetTableCellCount() const;
355 std::optional<bool> GetTableHasColumnOrRowHeaderNode() const;
356 AXNode* GetTableCaption() const;
357 AXNode* GetTableCellFromIndex(int index) const;
358 AXNode* GetTableCellFromCoords(int row_index, int col_index) const;
359 // Get all the column header node ids of the table.
360 std::vector<AXNode::AXID> GetTableColHeaderNodeIds() const;
361 // Get the column header node ids associated with |col_index|.
362 std::vector<AXNode::AXID> GetTableColHeaderNodeIds(int col_index) const;
363 // Get the row header node ids associated with |row_index|.
364 std::vector<AXNode::AXID> GetTableRowHeaderNodeIds(int row_index) const;
365 std::vector<AXNode::AXID> GetTableUniqueCellIds() const;
366 // Extra computed nodes for the accessibility tree for macOS:
367 // one column node for each table column, followed by one
368 // table header container node, or nullptr if not applicable.
369 const std::vector<AXNode*>* GetExtraMacNodes() const;
370
371 // Table row-like nodes.
372 bool IsTableRow() const;
373 std::optional<int> GetTableRowRowIndex() const;
374 // Get the node ids that represent rows in a table.
375 std::vector<AXNode::AXID> GetTableRowNodeIds() const;
376
377#if defined(OS_APPLE)
378 // Table column-like nodes. These nodes are only present on macOS.
379 bool IsTableColumn() const;
380 std::optional<int> GetTableColColIndex() const;
381#endif // defined(OS_APPLE)
382
383 // Table cell-like nodes.
384 bool IsTableCellOrHeader() const;
385 std::optional<int> GetTableCellIndex() const;
386 std::optional<int> GetTableCellColIndex() const;
387 std::optional<int> GetTableCellRowIndex() const;
388 std::optional<int> GetTableCellColSpan() const;
389 std::optional<int> GetTableCellRowSpan() const;
390 std::optional<int> GetTableCellAriaColIndex() const;
391 std::optional<int> GetTableCellAriaRowIndex() const;
392 std::vector<AXNode::AXID> GetTableCellColHeaderNodeIds() const;
393 std::vector<AXNode::AXID> GetTableCellRowHeaderNodeIds() const;
394 void GetTableCellColHeaders(std::vector<AXNode*>* col_headers) const;
395 void GetTableCellRowHeaders(std::vector<AXNode*>* row_headers) const;
396
397 // Helper methods to check if a cell is an ARIA-1.1+ 'cell' or 'gridcell'
398 bool IsCellOrHeaderOfARIATable() const;
399 bool IsCellOrHeaderOfARIAGrid() const;
400
401 // Returns true if node is a group and is a direct descendant of a set-like
402 // element.
403 bool IsEmbeddedGroup() const;
404
405 // Returns true if node has ignored state or ignored role.
406 bool IsIgnored() const;
407
408 // Returns true if an ancestor of this node (not including itself) is a
409 // leaf node, meaning that this node is not actually exposed to any
410 // platform's accessibility layer.
411 bool IsChildOfLeaf() const;
412
413 // Returns true if this is a leaf node, meaning all its
414 // children should not be exposed to any platform's native accessibility
415 // layer.
416 //
417 // The definition of a leaf includes nodes with children that are exclusively
418 // an internal renderer implementation, such as the children of an HTML native
419 // text field, as well as nodes with presentational children according to the
420 // ARIA and HTML5 Specs. Also returns true if all of the node's descendants
421 // are ignored.
422 //
423 // A leaf node should never have children that are focusable or
424 // that might send notifications.
425 bool IsLeaf() const;
426
427 // Returns true if this node is a list marker or if it's a descendant
428 // of a list marker node. Returns false otherwise.
429 bool IsInListMarker() const;
430
431 // Returns true if this node is a collapsed popup button that is parent to a
432 // menu list popup.
433 bool IsCollapsedMenuListPopUpButton() const;
434
435 // Returns the popup button ancestor of this current node if any. The popup
436 // button needs to be the parent of a menu list popup and needs to be
437 // collapsed.
438 AXNode* GetCollapsedMenuListPopUpButtonAncestor() const;
439
440 // Returns the text field ancestor of this current node if any.
441 AXNode* GetTextFieldAncestor() const;
442
443 // Finds and returns a pointer to ordered set containing node.
444 AXNode* GetOrderedSet() const;
445
446 // If this node is exposed to the platform's accessibility layer, returns this
447 // node. Otherwise, returns the lowest ancestor that is exposed to the
448 // platform. (See `IsLeaf` and `IsIgnored` for information on what is
449 // exposed to platform APIs.)
450 AXNode* GetLowestPlatformAncestor() const;
451
452 private:
453 // Computes the text offset where each line starts by traversing all child
454 // leaf nodes.
455 void ComputeLineStartOffsets(std::vector<int>* line_offsets,
456 int* start_offset) const;
457 AXTableInfo* GetAncestorTableInfo() const;
458 void IdVectorToNodeVector(const std::vector<int32_t>& ids,
459 std::vector<AXNode*>* nodes) const;
460
461 int UpdateUnignoredCachedValuesRecursive(int startIndex);
462 AXNode* ComputeLastUnignoredChildRecursive() const;
463 AXNode* ComputeFirstUnignoredChildRecursive() const;
464
465 OwnerTree* const tree_; // Owns this.
466 size_t index_in_parent_;
467 size_t unignored_index_in_parent_;
468 size_t unignored_child_count_ = 0;
469 AXNode* const parent_;
470 std::vector<AXNode*> children_;
471 AXNodeData data_;
472};
473
474AX_EXPORT std::ostream& operator<<(std::ostream& stream, const AXNode& node);
475
476template <typename NodeType,
477 NodeType* (NodeType::*NextSibling)() const,
478 NodeType* (NodeType::*PreviousSibling)() const,
479 NodeType* (NodeType::*FirstChild)() const,
480 NodeType* (NodeType::*LastChild)() const>
481AXNode::ChildIteratorBase<NodeType,
482 NextSibling,
483 PreviousSibling,
484 FirstChild,
485 LastChild>::ChildIteratorBase(const NodeType* parent,
486 NodeType* child)
487 : parent_(parent), child_(child) {}
488
489template <typename NodeType,
490 NodeType* (NodeType::*NextSibling)() const,
491 NodeType* (NodeType::*PreviousSibling)() const,
492 NodeType* (NodeType::*FirstChild)() const,
493 NodeType* (NodeType::*LastChild)() const>
494AXNode::ChildIteratorBase<NodeType,
495 NextSibling,
496 PreviousSibling,
497 FirstChild,
499 it)
500 : parent_(it.parent_), child_(it.child_) {}
501
502template <typename NodeType,
503 NodeType* (NodeType::*NextSibling)() const,
504 NodeType* (NodeType::*PreviousSibling)() const,
505 NodeType* (NodeType::*FirstChild)() const,
506 NodeType* (NodeType::*LastChild)() const>
507bool AXNode::ChildIteratorBase<NodeType,
508 NextSibling,
509 PreviousSibling,
510 FirstChild,
511 LastChild>::operator==(const ChildIteratorBase&
512 rhs) const {
513 return parent_ == rhs.parent_ && child_ == rhs.child_;
514}
515
516template <typename NodeType,
517 NodeType* (NodeType::*NextSibling)() const,
518 NodeType* (NodeType::*PreviousSibling)() const,
519 NodeType* (NodeType::*FirstChild)() const,
520 NodeType* (NodeType::*LastChild)() const>
521bool AXNode::ChildIteratorBase<NodeType,
522 NextSibling,
523 PreviousSibling,
524 FirstChild,
525 LastChild>::operator!=(const ChildIteratorBase&
526 rhs) const {
527 return parent_ != rhs.parent_ || child_ != rhs.child_;
528}
529
530template <typename NodeType,
531 NodeType* (NodeType::*NextSibling)() const,
532 NodeType* (NodeType::*PreviousSibling)() const,
533 NodeType* (NodeType::*FirstChild)() const,
534 NodeType* (NodeType::*LastChild)() const>
535AXNode::ChildIteratorBase<NodeType,
536 NextSibling,
537 PreviousSibling,
538 FirstChild,
539 LastChild>&
540AXNode::ChildIteratorBase<NodeType,
541 NextSibling,
542 PreviousSibling,
543 FirstChild,
544 LastChild>::operator++() {
545 // |child_ = nullptr| denotes the iterator's past-the-end condition. When we
546 // increment the iterator past the end, we remain at the past-the-end iterator
547 // condition.
548 if (child_ && parent_) {
549 if (child_ == (parent_->*LastChild)())
550 child_ = nullptr;
551 else
552 child_ = (child_->*NextSibling)();
553 }
554
555 return *this;
556}
557
558template <typename NodeType,
559 NodeType* (NodeType::*NextSibling)() const,
560 NodeType* (NodeType::*PreviousSibling)() const,
561 NodeType* (NodeType::*FirstChild)() const,
562 NodeType* (NodeType::*LastChild)() const>
563AXNode::ChildIteratorBase<NodeType,
564 NextSibling,
565 PreviousSibling,
566 FirstChild,
567 LastChild>&
568AXNode::ChildIteratorBase<NodeType,
569 NextSibling,
570 PreviousSibling,
571 FirstChild,
572 LastChild>::operator--() {
573 if (parent_) {
574 // If the iterator is past the end, |child_=nullptr|, decrement the iterator
575 // gives us the last iterator element.
576 if (!child_)
577 child_ = (parent_->*LastChild)();
578 // Decrement the iterator gives us the previous element, except when the
579 // iterator is at the beginning; in which case, decrementing the iterator
580 // remains at the beginning.
581 else if (child_ != (parent_->*FirstChild)())
582 child_ = (child_->*PreviousSibling)();
583 }
584
585 return *this;
586}
587
588template <typename NodeType,
589 NodeType* (NodeType::*NextSibling)() const,
590 NodeType* (NodeType::*PreviousSibling)() const,
591 NodeType* (NodeType::*FirstChild)() const,
592 NodeType* (NodeType::*LastChild)() const>
593NodeType* AXNode::ChildIteratorBase<NodeType,
594 NextSibling,
595 PreviousSibling,
596 FirstChild,
597 LastChild>::get() const {
598 BASE_DCHECK(child_);
599 return child_;
600}
601
602template <typename NodeType,
603 NodeType* (NodeType::*NextSibling)() const,
604 NodeType* (NodeType::*PreviousSibling)() const,
605 NodeType* (NodeType::*FirstChild)() const,
606 NodeType* (NodeType::*LastChild)() const>
607NodeType& AXNode::ChildIteratorBase<NodeType,
608 NextSibling,
609 PreviousSibling,
610 FirstChild,
611 LastChild>::operator*() const {
612 BASE_DCHECK(child_);
613 return *child_;
614}
615
616template <typename NodeType,
617 NodeType* (NodeType::*NextSibling)() const,
618 NodeType* (NodeType::*PreviousSibling)() const,
619 NodeType* (NodeType::*FirstChild)() const,
620 NodeType* (NodeType::*LastChild)() const>
621NodeType* AXNode::ChildIteratorBase<NodeType,
622 NextSibling,
623 PreviousSibling,
624 FirstChild,
625 LastChild>::operator->() const {
626 BASE_DCHECK(child_);
627 return child_;
628}
629
630} // namespace ui
631
632#endif // UI_ACCESSIBILITY_AX_NODE_H_
#define AX_EXPORT
Definition: ax_export.h:29
const NodeType * parent_
Definition: ax_node.h:93
virtual AXTableInfo * GetTableInfo(const AXNode *table_node) const =0
virtual bool GetTreeUpdateInProgressState() const =0
virtual std::optional< int > GetSetSize(const AXNode &node)=0
virtual AXNode * GetFromId(int32_t id) const =0
virtual bool HasPaginationSupport() const =0
virtual AXTreeID GetAXTreeID() const =0
virtual std::optional< int > GetPosInSet(const AXNode &node)=0
virtual Selection GetUnignoredSelection() const =0
bool GetString16Attribute(ax::mojom::StringAttribute attribute, std::u16string *value) const
Definition: ax_node.h:251
bool HasFloatAttribute(ax::mojom::FloatAttribute attribute) const
Definition: ax_node.h:218
bool HasStringAttribute(ax::mojom::StringAttribute attribute) const
Definition: ax_node.h:239
std::u16string GetString16Attribute(ax::mojom::StringAttribute attribute) const
Definition: ax_node.h:255
bool GetBoolAttribute(ax::mojom::BoolAttribute attribute) const
Definition: ax_node.h:211
AXID id() const
Definition: ax_node.h:110
bool HasIntAttribute(ax::mojom::IntAttribute attribute) const
Definition: ax_node.h:229
AXNode * GetLastUnignoredChild() const
Definition: ax_node.cc:81
OwnerTree * tree() const
Definition: ax_node.h:109
int32_t AXID
Definition: ax_node.h:36
bool GetBoolAttribute(ax::mojom::BoolAttribute attribute, bool *value) const
Definition: ax_node.h:214
const std::string & GetStringAttribute(ax::mojom::StringAttribute attribute) const
Definition: ax_node.h:242
AXNode * GetFirstUnignoredChild() const
Definition: ax_node.cc:76
virtual ~AXNode()
const std::vector< int32_t > & GetIntListAttribute(ax::mojom::IntListAttribute attribute) const
Definition: ax_node.h:263
bool GetIntListAttribute(ax::mojom::IntListAttribute attribute, std::vector< int32_t > *value) const
Definition: ax_node.h:267
bool HasStringListAttribute(ax::mojom::StringListAttribute attribute) const
Definition: ax_node.h:272
bool GetHtmlAttribute(const char *attribute, std::string *value) const
Definition: ax_node.h:287
bool GetHtmlAttribute(const char *attribute, std::u16string *value) const
Definition: ax_node.h:284
const std::vector< AXNode * > & children() const
Definition: ax_node.h:113
bool GetStringListAttribute(ax::mojom::StringListAttribute attribute, std::vector< std::string > *value) const
Definition: ax_node.h:279
bool GetFloatAttribute(ax::mojom::FloatAttribute attribute, float *value) const
Definition: ax_node.h:224
AXNode * GetPreviousUnignoredSibling() const
Definition: ax_node.cc:224
AXNode * parent() const
Definition: ax_node.h:111
const std::vector< std::string > & GetStringListAttribute(ax::mojom::StringListAttribute attribute) const
Definition: ax_node.h:275
bool GetStringAttribute(ax::mojom::StringAttribute attribute, std::string *value) const
Definition: ax_node.h:246
bool GetIntAttribute(ax::mojom::IntAttribute attribute, int *value) const
Definition: ax_node.h:235
bool HasBoolAttribute(ax::mojom::BoolAttribute attribute) const
Definition: ax_node.h:208
bool HasIntListAttribute(ax::mojom::IntListAttribute attribute) const
Definition: ax_node.h:260
int GetIntAttribute(ax::mojom::IntAttribute attribute) const
Definition: ax_node.h:232
float GetFloatAttribute(ax::mojom::FloatAttribute attribute) const
Definition: ax_node.h:221
AXNode * GetNextUnignoredSibling() const
Definition: ax_node.cc:155
size_t index_in_parent() const
Definition: ax_node.h:114
const AXNodeData & data() const
Definition: ax_node.h:112
uint8_t value
StringListAttribute
Definition: ax_enums.h:850
StringAttribute
Definition: ax_enums.h:521
FloatAttribute
Definition: ax_enums.h:699
IntListAttribute
Definition: ax_enums.h:799
constexpr Color operator*(T value, const Color &c)
Definition: color.h:911
const myers::Point & get(const myers::Segment &)
bool IsTableColumn(ax::mojom::Role role)
bool operator==(const AXEventIntent &a, const AXEventIntent &b)
bool IsTableRow(ax::mojom::Role role)
std::ostream & operator<<(std::ostream &os, AXEventGenerator::Event event)
bool operator!=(const AXEventIntent &a, const AXEventIntent &b)
bool IsText(ax::mojom::Role role)
static SkColor4f transform(SkColor4f c, SkColorSpace *src, SkColorSpace *dst)
Definition: p3.cpp:47
ax::mojom::TextAffinity focus_affinity
Definition: ax_node.h:56
ax::mojom::TextAffinity anchor_affinity
Definition: ax_node.h:53
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
#define BASE_DCHECK(condition)
Definition: logging.h:63