stylo: We have an Atom back-end now.

This commit is contained in:
Emilio Cobos Álvarez 2016-08-10 01:25:42 -07:00
parent d612d9f5ef
commit 010bce128b
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 10 additions and 39 deletions

View file

@ -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);