Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 37 additions & 9 deletions accesskit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1878,20 +1878,42 @@ vec_type_methods! {
}

node_id_vec_property_methods! {
/// The ordered list of this node's direct children in the tree.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if the single word "ordered" here is enough. Maybe we should replace it by a second sentence to hammer the fact that the order must be chosen carefully as it directly influences how widgets are placed, akin to the tab index on a web page. Any idea?

(Children, children, set_children, push_child, clear_children),
/// The nodes whose contents or presence are controlled by this node. ARIA
/// equivalent: [`aria-controls`].
///
/// [`aria-controls`]: https://www.w3.org/TR/wai-aria-1.2/#aria-controls
(Controls, controls, set_controls, push_controlled, clear_controls),
/// The nodes that provide detailed, extended descriptions for this node.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this documentation is too similar to the one for described_by. ARIA explains the link between the two and maybe we should do the same.

/// ARIA equivalent: [`aria-details`].
///
/// **Difference with ARIA:** `aria-details` references a single element,
/// while this property may reference multiple nodes.
///
/// [`aria-details`]: https://www.w3.org/TR/wai-aria-1.2/#aria-details
(Details, details, set_details, push_detail, clear_details),
/// The nodes that describe this node. ARIA equivalent: [`aria-describedby`].
///
/// [`aria-describedby`]: https://www.w3.org/TR/wai-aria-1.2/#aria-describedby
(DescribedBy, described_by, set_described_by, push_described_by, clear_described_by),
/// The nodes that follow this node in an alternate reading order. ARIA
/// equivalent: [`aria-flowto`].
///
/// [`aria-flowto`]: https://www.w3.org/TR/wai-aria-1.2/#aria-flowto
(FlowTo, flow_to, set_flow_to, push_flow_to, clear_flow_to),
/// The nodes that label this node. ARIA equivalent: [`aria-labelledby`].
///
/// [`aria-labelledby`]: https://www.w3.org/TR/wai-aria-1.2/#aria-labelledby
(LabelledBy, labelled_by, set_labelled_by, push_labelled_by, clear_labelled_by),
/// As with the `aria-owns` property in ARIA, this property should be set
/// only if the nodes referenced in the property are not descendants
/// of the owning node in the AccessKit tree. In the common case, where the
/// owned nodes are direct children or indirect descendants, this property
/// is unnecessary.
/// Nodes owned by this node that are not already its descendants in the
/// tree. This property is unnecessary for direct children or other
/// descendants. ARIA equivalent: [`aria-owns`].
///
/// [`aria-owns`]: https://www.w3.org/TR/wai-aria-1.2/#aria-owns
(Owns, owns, set_owns, push_owned, clear_owns),
/// On radio buttons this should be set to a list of all of the buttons
/// in the same group as this one, including this radio button itself.
/// For a radio button, the list of all radio buttons in the same group,
/// including this node.
(RadioGroup, radio_group, set_radio_group, push_to_radio_group, clear_radio_group)
}

Expand Down Expand Up @@ -2208,13 +2230,17 @@ coord_slice_property_methods! {
}

bool_property_methods! {
/// Whether this node is expanded, collapsed, or neither.
/// Whether this node is expanded, collapsed, or neither. ARIA equivalent:
/// [`aria-expanded`].
///
/// Setting this to `false` means the node is collapsed; omitting it means this state
/// isn't applicable.
///
/// [`aria-expanded`]: https://www.w3.org/TR/wai-aria-1.2/#aria-expanded
(Expanded, is_expanded, set_expanded, clear_expanded),

/// Indicates whether this node is selected or unselected.
/// Indicates whether this node is selected or unselected. ARIA equivalent:
/// [`aria-selected`].
///
/// The absence of this flag (as opposed to a `false` setting)
/// means that the concept of "selected" doesn't apply.
Expand All @@ -2223,6 +2249,8 @@ bool_property_methods! {
/// to announce "not selected". The ambiguity of this flag
/// in platform accessibility APIs has made extraneous
/// "not selected" announcements a common annoyance.
///
/// [`aria-selected`]: https://www.w3.org/TR/wai-aria-1.2/#aria-selected
(Selected, is_selected, set_selected, clear_selected)
}

Expand Down
Loading