mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
stylo: Use the improved version of Gecko_GetStyleContext()
This commit is contained in:
parent
ad5fb58e07
commit
d85a60e366
3 changed files with 5 additions and 10 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue