style: Add simple ToShmem implementations.

Differential Revision: https://phabricator.services.mozilla.com/D17190
This commit is contained in:
Cameron McCormack 2019-03-30 00:16:11 +00:00 committed by Emilio Cobos Álvarez
parent f6ef35c5d3
commit 7fa7c103d6
7 changed files with 85 additions and 3 deletions

View file

@ -15,7 +15,9 @@ use crate::stylesheets::{CssRule, Origin, StylesheetInDocument};
use crate::values::CssUrl;
use cssparser::SourceLocation;
use std::fmt::{self, Write};
use std::mem::ManuallyDrop;
use style_traits::{CssWriter, ToCss};
use to_shmem::{SharedMemoryBuilder, ToShmem};
/// With asynchronous stylesheet parsing, we can't synchronously create a
/// GeckoStyleSheet. So we use this placeholder instead.
@ -180,6 +182,12 @@ pub struct ImportRule {
pub source_location: SourceLocation,
}
impl ToShmem for ImportRule {
fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> ManuallyDrop<Self> {
panic!("ToShmem failed for ImportRule: cannot handle imported style sheets")
}
}
impl DeepCloneWithLock for ImportRule {
fn deep_clone_with_lock(
&self,