struct AccessibilityNode {
id: NodeId,
accesskit_node: Node,
opaque_node: Option<OpaqueNode>,
updated: bool,
}Fields§
§id: NodeIdThe unique ID for the node. This is used both as a key in AccessibilityTree’s cache of
nodes, and as an identifier in accesskit datastructures: accesskit::Nodes,
accesskit::TreeUpdates and accesskit::ActionRequests.
accesskit_node: NodeThe computed accesskit::Node data. This will be copied and serialized into a
accesskit::TreeUpdate whenever it is changed during an update.
opaque_node: Option<OpaqueNode>The OpaqueNode for the DOM node which corresponds to this accessibility node, if any.
An accessibility node may not correspond to a DOM node if it corresponds to a
pseudo-element, or in a test.
updated: boolWhether this node has been updated in the current tree update. This is reset to false
when the node is added to the AccessibilityUpdate - see AccessibilityUpdate::add().
Implementations§
Source§impl AccessibilityNode
impl AccessibilityNode
fn new(id: NodeId) -> Self
fn new_with_role(id: NodeId, role: Role) -> Self
fn update_descendants<'dom>( &mut self, dom_node: &ServoLayoutNode<'dom>, tree: &mut AccessibilityTree, update: &mut AccessibilityUpdate, ) -> bool
Sourcefn set_subtree_state_change(
&self,
change: TreeChange,
tree: &mut AccessibilityTree,
update: &mut AccessibilityUpdate,
)
fn set_subtree_state_change( &self, change: TreeChange, tree: &mut AccessibilityTree, update: &mut AccessibilityUpdate, )
Recursively mark this subtree as having the given TreeChange .
This is used when a node is Moved or Removed, since its entire subtree will also need to
be marked accordingly. When a node is New, it’s marked as such when it is created. We
shouldn’t call this method in that case, since it may have descendants which are not being
created in this update and shouldn’t have a New state. Any descendants which are new will
already have their New state set when they are created.
Note: if a node is moved, the requested change must always be Moved(Pending): the logic
in this method will determine whether the move is Complete and set the stored value
accordingly.
fn update_node( &mut self, dom_node: &ServoLayoutNode<'_>, tree: &mut AccessibilityTree, any_descendant_updated: bool, )
fn label_from_descendants(&self, tree: &AccessibilityTree) -> Option<String>
fn print(&self, tree: &AccessibilityTree, print_tree: &mut PrintTree)
fn children(&self) -> &[NodeId]
fn set_children(&mut self, children: Vec<NodeId>)
fn role(&self) -> Role
fn set_role(&mut self, role: Role)
fn label(&self) -> Option<&str>
fn set_label(&mut self, label: &str)
fn html_tag(&self) -> Option<&str>
fn set_html_tag(&mut self, html_tag: &str)
fn value(&self) -> Option<&str>
fn set_value(&mut self, value: &str)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AccessibilityNode
impl RefUnwindSafe for AccessibilityNode
impl Send for AccessibilityNode
impl Sync for AccessibilityNode
impl Unpin for AccessibilityNode
impl UnsafeUnpin for AccessibilityNode
impl UnwindSafe for AccessibilityNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more