mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Add ToShmem impl for URLValueSource.
Differential Revision: https://phabricator.services.mozilla.com/D17194
This commit is contained in:
parent
b8506e4a55
commit
41f6e67893
1 changed files with 11 additions and 0 deletions
|
@ -19,8 +19,10 @@ use nsstring::nsCString;
|
||||||
use servo_arc::Arc;
|
use servo_arc::Arc;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt::{self, Write};
|
use std::fmt::{self, Write};
|
||||||
|
use std::mem::ManuallyDrop;
|
||||||
use std::sync::RwLock;
|
use std::sync::RwLock;
|
||||||
use style_traits::{CssWriter, ParseError, ToCss};
|
use style_traits::{CssWriter, ParseError, ToCss};
|
||||||
|
use to_shmem::{SharedMemoryBuilder, ToShmem};
|
||||||
|
|
||||||
/// A CSS url() value for gecko.
|
/// A CSS url() value for gecko.
|
||||||
#[css(function = "url")]
|
#[css(function = "url")]
|
||||||
|
@ -138,6 +140,15 @@ pub enum URLValueSource {
|
||||||
CORSMode(CORSMode),
|
CORSMode(CORSMode),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ToShmem for URLValueSource {
|
||||||
|
fn to_shmem(&self, _builder: &mut SharedMemoryBuilder) -> ManuallyDrop<Self> {
|
||||||
|
ManuallyDrop::new(match self {
|
||||||
|
URLValueSource::URLValue(r) => URLValueSource::CORSMode(r.mCORSMode),
|
||||||
|
URLValueSource::CORSMode(c) => URLValueSource::CORSMode(*c),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A specified non-image `url()` value.
|
/// A specified non-image `url()` value.
|
||||||
#[derive(Clone, Debug, SpecifiedValueInfo, ToCss)]
|
#[derive(Clone, Debug, SpecifiedValueInfo, ToCss)]
|
||||||
pub struct SpecifiedUrl {
|
pub struct SpecifiedUrl {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue