From fc6c4e0091d5b257a3869a468fca144a1453cebc Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Sun, 27 Aug 2023 04:44:16 -0500 Subject: [PATCH] fix!: Drop `Tree::root_scroller` (#279) --- bindings/c/src/common.rs | 7 +------ common/src/lib.rs | 10 +--------- consumer/src/tree.rs | 3 --- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/bindings/c/src/common.rs b/bindings/c/src/common.rs index e6278a51..fc766c86 100644 --- a/bindings/c/src/common.rs +++ b/bindings/c/src/common.rs @@ -873,16 +873,12 @@ impl node_builder { #[repr(C)] pub struct tree { pub root: node_id, - pub root_scroller: opt_node_id, } impl tree { #[no_mangle] pub extern "C" fn accesskit_tree_new(root: node_id) -> tree { - tree { - root, - root_scroller: opt_node_id::default(), - } + tree { root } } } @@ -890,7 +886,6 @@ impl From for Tree { fn from(tree: tree) -> Self { Self { root: tree.root.into(), - root_scroller: tree.root_scroller.into(), } } } diff --git a/common/src/lib.rs b/common/src/lib.rs index 5919e943..0efc705e 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -2336,20 +2336,12 @@ impl JsonSchema for Node { #[cfg_attr(feature = "serde", serde(rename_all = "camelCase"))] pub struct Tree { pub root: NodeId, - - /// The node that's used as the root scroller, if any. On some platforms - /// like Android we need to ignore accessibility scroll offsets for - /// that node and get them from the viewport instead. - pub root_scroller: Option, } impl Tree { #[inline] pub fn new(root: NodeId) -> Tree { - Tree { - root, - root_scroller: None, - } + Tree { root } } } diff --git a/consumer/src/tree.rs b/consumer/src/tree.rs index ad05edf4..19c7845c 100644 --- a/consumer/src/tree.rs +++ b/consumer/src/tree.rs @@ -33,9 +33,6 @@ impl State { fn validate_global(&self) { assert!(self.nodes.contains_key(&self.data.root)); assert!(self.nodes.contains_key(&self.focus)); - if let Some(id) = self.data.root_scroller { - assert!(self.nodes.contains_key(&id)); - } } fn update(