style: Match :lang() using snapshots correctly.

This commit is contained in:
Cameron McCormack 2017-06-07 12:30:10 +08:00
parent c7e2500311
commit f492c8fe6e
6 changed files with 134 additions and 11 deletions

View file

@ -181,4 +181,14 @@ impl ElementSnapshot for GeckoElementSnapshot {
callback,
bindings::Gecko_SnapshotClassOrClassList)
}
#[inline]
fn lang_attr(&self) -> Option<Atom> {
let ptr = unsafe { bindings::Gecko_SnapshotLangValue(self) };
if ptr.is_null() {
None
} else {
Some(unsafe { Atom::from_addrefed(ptr) })
}
}
}