mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Remove ServoStyleSheet usage.
Bug: 1457920 Reviewed-by: xidorn MozReview-Commit-ID: LIBkovuQ6MB
This commit is contained in:
parent
9ed48952f5
commit
9d721072f5
5 changed files with 39 additions and 35 deletions
|
@ -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 }
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue