Skip to main content

layout/accessibility/
mod.rs

1/* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
5use layout_api::AccessibilityDamage;
6use rustc_hash::{FxHashMap, FxHashSet};
7use script::layout_dom::ServoLayoutNode;
8use style::dom::OpaqueNode;
9
10use crate::display_list::StackingContextTree;
11use crate::layout_impl::LayoutThread;
12
13mod accessibility_node;
14mod accessibility_tree;
15
16pub use accessibility_tree::AccessibilityTree;
17
18/// Everything the accessibility tree needs from layout in order to compute node bounds during an
19/// update.
20pub(crate) struct AccessibilityContext<'update> {
21    pub(crate) layout_thread: &'update LayoutThread,
22    pub(crate) stacking_context_tree: &'update StackingContextTree,
23    pub(crate) focused_element: Option<OpaqueNode>,
24    pub(crate) rooted_nodes_for_integrity_check: Option<FxHashSet<OpaqueNode>>,
25}
26
27/// All the [`AccessibilityDamage`] which comes from outside the accessibility tree itself.
28pub(crate) type AccessibilityDamageMap<'a> =
29    FxHashMap<OpaqueNode, (ServoLayoutNode<'a>, AccessibilityDamage)>;