diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /servo/components/style/gecko/snapshot.rs | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'servo/components/style/gecko/snapshot.rs')
-rw-r--r-- | servo/components/style/gecko/snapshot.rs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/servo/components/style/gecko/snapshot.rs b/servo/components/style/gecko/snapshot.rs index 2ff04406ac..8f6eb120d5 100644 --- a/servo/components/style/gecko/snapshot.rs +++ b/servo/components/style/gecko/snapshot.rs @@ -171,4 +171,33 @@ impl ElementSnapshot for GeckoElementSnapshot { Some(AtomString(unsafe { Atom::from_addrefed(ptr) })) } } + + /// Returns true if the snapshot has stored state for custom states + #[inline] + fn has_custom_states(&self) -> bool { + self.has_any(Flags::CustomState) + } + + /// Returns true if the snapshot has a given CustomState + #[inline] + fn has_custom_state(&self, state: &AtomIdent) -> bool { + unsafe { + self.mCustomStates.iter().any(|setstate| { + AtomIdent::with(setstate.mRawPtr, |setstate| state == setstate) + }) + } + } + + #[inline] + fn each_custom_state<F>(&self, mut callback: F) + where + F: FnMut(&AtomIdent), + { + unsafe { + for atom in self.mCustomStates.iter() { + AtomIdent::with(atom.mRawPtr, &mut callback) + } + } + } + } |