mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
stylo: We have an Atom back-end now.
This commit is contained in:
parent
d612d9f5ef
commit
010bce128b
2 changed files with 10 additions and 39 deletions
|
@ -26,6 +26,9 @@ pub struct GeckoSelectorImpl;
|
|||
///
|
||||
/// This should allow us to avoid random FFI overhead when cloning/dropping
|
||||
/// pseudos.
|
||||
///
|
||||
/// Also, we can further optimize PartialEq and hash comparing/hashing only the
|
||||
/// atoms.
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub struct PseudoElement(Atom, bool);
|
||||
|
||||
|
@ -41,8 +44,9 @@ impl PseudoElement {
|
|||
}
|
||||
|
||||
#[inline]
|
||||
fn from_atom_unchecked(atom: Atom, is_anon_box: bool) -> Self {
|
||||
pub fn from_atom_unchecked(atom: Atom, is_anon_box: bool) -> Self {
|
||||
if cfg!(debug_assertions) {
|
||||
// Do the check on debug regardless.
|
||||
match Self::from_atom(&*atom, true) {
|
||||
Some(pseudo) => {
|
||||
assert_eq!(pseudo.is_anon_box(), is_anon_box);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue