style: Remove ServoStyleSheet usage.

Bug: 1457920
Reviewed-by: xidorn
MozReview-Commit-ID: LIBkovuQ6MB
This commit is contained in:
Emilio Cobos Álvarez 2018-04-30 19:23:14 +02:00
parent 9ed48952f5
commit 9d721072f5
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
5 changed files with 39 additions and 35 deletions

View file

@ -8,7 +8,7 @@ use atomic_refcell::{AtomicRef, AtomicRefCell, AtomicRefMut};
use context::QuirksMode;
use dom::TElement;
use gecko_bindings::bindings::{self, RawServoStyleSet};
use gecko_bindings::structs::{self, RawGeckoPresContextOwned, ServoStyleSetSizes, ServoStyleSheet};
use gecko_bindings::structs::{self, RawGeckoPresContextOwned, ServoStyleSetSizes, StyleSheet as DomStyleSheet};
use gecko_bindings::structs::{StyleSheetInfo, nsIDocument};
use gecko_bindings::sugar::ownership::{HasArcFFI, HasBoxFFI, HasFFI, HasSimpleFFI};
use invalidation::media_queries::{MediaListKey, ToMediaListKey};
@ -23,7 +23,7 @@ use stylist::Stylist;
/// Little wrapper to a Gecko style sheet.
#[derive(Debug, Eq, PartialEq)]
pub struct GeckoStyleSheet(*const ServoStyleSheet);
pub struct GeckoStyleSheet(*const DomStyleSheet);
impl ToMediaListKey for ::gecko::data::GeckoStyleSheet {
fn to_media_list_key(&self) -> MediaListKey {
@ -33,24 +33,24 @@ impl ToMediaListKey for ::gecko::data::GeckoStyleSheet {
}
impl GeckoStyleSheet {
/// Create a `GeckoStyleSheet` from a raw `ServoStyleSheet` pointer.
/// Create a `GeckoStyleSheet` from a raw `DomStyleSheet` pointer.
#[inline]
pub unsafe fn new(s: *const ServoStyleSheet) -> Self {
pub unsafe fn new(s: *const DomStyleSheet) -> Self {
debug_assert!(!s.is_null());
bindings::Gecko_StyleSheet_AddRef(s);
Self::from_addrefed(s)
}
/// Create a `GeckoStyleSheet` from a raw `ServoStyleSheet` pointer that
/// Create a `GeckoStyleSheet` from a raw `DomStyleSheet` pointer that
/// already holds a strong reference.
#[inline]
pub unsafe fn from_addrefed(s: *const ServoStyleSheet) -> Self {
pub unsafe fn from_addrefed(s: *const DomStyleSheet) -> Self {
debug_assert!(!s.is_null());
GeckoStyleSheet(s)
}
/// Get the raw `ServoStyleSheet` that we're wrapping.
pub fn raw(&self) -> &ServoStyleSheet {
/// Get the raw `StyleSheet` that we're wrapping.
pub fn raw(&self) -> &DomStyleSheet {
unsafe { &*self.0 }
}

View file

@ -237,7 +237,7 @@ pub trait ToCssWithGuard {
#[cfg(feature = "gecko")]
pub struct DeepCloneParams {
/// The new sheet we're cloning rules into.
pub reference_sheet: *const ::gecko_bindings::structs::ServoStyleSheet,
pub reference_sheet: *const ::gecko_bindings::structs::StyleSheet,
}
/// Parameters needed for deep clones.