mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Have a concrete SelectorImpl type everywhere in the style crate.
It is conditionally compiled to one implementation or the other (Gecko or Servo) with `#[cfg(…)]`.
This commit is contained in:
parent
4b7060554b
commit
5c70dfab01
16 changed files with 236 additions and 232 deletions
|
@ -144,18 +144,15 @@ pub trait TNode : Sized + Copy + Clone {
|
|||
|
||||
/// Borrows the PrivateStyleData without checks.
|
||||
#[inline(always)]
|
||||
unsafe fn borrow_data_unchecked(&self)
|
||||
-> Option<*const PrivateStyleData<<Self::ConcreteElement as Element>::Impl>>;
|
||||
unsafe fn borrow_data_unchecked(&self) -> Option<*const PrivateStyleData>;
|
||||
|
||||
/// Borrows the PrivateStyleData immutably. Fails on a conflicting borrow.
|
||||
#[inline(always)]
|
||||
fn borrow_data(&self)
|
||||
-> Option<Ref<PrivateStyleData<<Self::ConcreteElement as Element>::Impl>>>;
|
||||
fn borrow_data(&self) -> Option<Ref<PrivateStyleData>>;
|
||||
|
||||
/// Borrows the PrivateStyleData mutably. Fails on a conflicting borrow.
|
||||
#[inline(always)]
|
||||
fn mutate_data(&self)
|
||||
-> Option<RefMut<PrivateStyleData<<Self::ConcreteElement as Element>::Impl>>>;
|
||||
fn mutate_data(&self) -> Option<RefMut<PrivateStyleData>>;
|
||||
|
||||
/// Get the description of how to account for recent style changes.
|
||||
fn restyle_damage(self) -> Self::ConcreteRestyleDamage;
|
||||
|
@ -176,9 +173,7 @@ pub trait TNode : Sized + Copy + Clone {
|
|||
|
||||
/// Returns the style results for the given node. If CSS selector matching
|
||||
/// has not yet been performed, fails.
|
||||
fn style(&self,
|
||||
_context: &SharedStyleContext<<Self::ConcreteElement as Element>::Impl>)
|
||||
-> Ref<Arc<ComputedValues>>
|
||||
fn style(&self, _context: &SharedStyleContext) -> Ref<Arc<ComputedValues>>
|
||||
where <Self::ConcreteElement as Element>::Impl: SelectorImplExt {
|
||||
Ref::map(self.borrow_data().unwrap(), |data| data.style.as_ref().unwrap())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue