stylo: Use the improved version of Gecko_GetStyleContext()

This commit is contained in:
Emilio Cobos Álvarez 2016-08-11 22:00:22 -07:00
parent ad5fb58e07
commit d85a60e366
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
3 changed files with 5 additions and 10 deletions

View file

@ -34,7 +34,7 @@ pub struct PseudoElement(Atom, bool);
impl PseudoElement {
#[inline]
fn as_atom(&self) -> &Atom {
pub fn as_atom(&self) -> &Atom {
&self.0
}

View file

@ -455,7 +455,7 @@ impl Clone for ${style_struct.gecko_struct_name} {
impl Debug for ${style_struct.gecko_struct_name} {
// FIXME(bholley): Generate this.
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "GECKO STYLE STRUCT")
write!(f, "Gecko style struct: ${style_struct.gecko_struct_name}")
}
}
%else:

View file

@ -319,15 +319,10 @@ impl<'ln> TNode for GeckoNode<'ln> {
return None;
}
if pseudo.is_some() {
// FIXME(emilio): This makes us reconstruct frame for pseudos every
// restyle, add a FFI call to get the style context associated with
// a PE.
return None;
}
unsafe {
let context_ptr = Gecko_GetStyleContext(self.node);
let atom_ptr = pseudo.map(|p| p.as_atom().as_ptr())
.unwrap_or(ptr::null_mut());
let context_ptr = Gecko_GetStyleContext(self.node, atom_ptr);
context_ptr.as_ref()
}
}