mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
style: Remove HasBoxFFI
HasBoxFFI and HasArcFFI aren't great, see bug 1831242 as for examples of why. HasArcFFI requires a bit more care, but HasBoxFFI doesn't give us much benefit. Instead use the same type in the FFI boundary. Differential Revision: https://phabricator.services.mozilla.com/D177252
This commit is contained in:
parent
1a49d8c79f
commit
19e037d921
9 changed files with 10 additions and 180 deletions
|
@ -6,8 +6,6 @@
|
|||
//! ones used for ShadowRoot.
|
||||
|
||||
use crate::dom::TElement;
|
||||
#[cfg(feature = "gecko")]
|
||||
use crate::gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
|
||||
use crate::invalidation::media_queries::ToMediaListKey;
|
||||
use crate::shared_lock::SharedRwLockReadGuard;
|
||||
use crate::stylesheet_set::AuthorStylesheetSet;
|
||||
|
@ -19,7 +17,7 @@ use servo_arc::Arc;
|
|||
/// A set of author stylesheets and their computed representation, such as the
|
||||
/// ones used for ShadowRoot.
|
||||
#[derive(MallocSizeOf)]
|
||||
pub struct AuthorStyles<S>
|
||||
pub struct GenericAuthorStyles<S>
|
||||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
|
@ -31,11 +29,13 @@ where
|
|||
pub data: Arc<CascadeData>,
|
||||
}
|
||||
|
||||
pub use self::GenericAuthorStyles as AuthorStyles;
|
||||
|
||||
lazy_static! {
|
||||
static ref EMPTY_CASCADE_DATA: Arc<CascadeData> = Arc::new_leaked(CascadeData::new());
|
||||
}
|
||||
|
||||
impl<S> AuthorStyles<S>
|
||||
impl<S> GenericAuthorStyles<S>
|
||||
where
|
||||
S: StylesheetInDocument + PartialEq + 'static,
|
||||
{
|
||||
|
@ -68,12 +68,3 @@ where
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasFFI for AuthorStyles<crate::gecko::data::GeckoStyleSheet> {
|
||||
type FFIType = crate::gecko_bindings::structs::RawServoAuthorStyles;
|
||||
}
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasSimpleFFI for AuthorStyles<crate::gecko::data::GeckoStyleSheet> {}
|
||||
#[cfg(feature = "gecko")]
|
||||
unsafe impl HasBoxFFI for AuthorStyles<crate::gecko::data::GeckoStyleSheet> {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue