Make MozContextProperties a different type

This commit is contained in:
Igor Gutorov 2018-01-13 22:29:52 +02:00
parent c72066af2d
commit 90978c1777
2 changed files with 8 additions and 7 deletions

View file

@ -5257,16 +5257,16 @@ clip-path
self.gecko.mContextPropsBits = 0;
for (gecko, servo) in self.gecko.mContextProps.iter_mut().zip(v) {
if servo.0 == atom!("fill") {
if (servo.0).0 == atom!("fill") {
self.gecko.mContextPropsBits |= structs::NS_STYLE_CONTEXT_PROPERTY_FILL as u8;
} else if servo.0 == atom!("stroke") {
} else if (servo.0).0 == atom!("stroke") {
self.gecko.mContextPropsBits |= structs::NS_STYLE_CONTEXT_PROPERTY_STROKE as u8;
} else if servo.0 == atom!("fill-opacity") {
} else if (servo.0).0 == atom!("fill-opacity") {
self.gecko.mContextPropsBits |= structs::NS_STYLE_CONTEXT_PROPERTY_FILL_OPACITY as u8;
} else if servo.0 == atom!("stroke-opacity") {
} else if (servo.0).0 == atom!("stroke-opacity") {
self.gecko.mContextPropsBits |= structs::NS_STYLE_CONTEXT_PROPERTY_STROKE_OPACITY as u8;
}
gecko.mRawPtr = servo.0.into_addrefed();
gecko.mRawPtr = (servo.0).0.into_addrefed();
}
}

View file

@ -264,7 +264,8 @@ impl ToCss for SVGPaintOrder {
/// Specified MozContextProperties value.
/// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)
pub type MozContextProperties = CustomIdent;
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
pub struct MozContextProperties(pub CustomIdent);
impl Parse for MozContextProperties {
fn parse<'i, 't>(
@ -273,6 +274,6 @@ impl Parse for MozContextProperties {
) -> Result<MozContextProperties, ParseError<'i>> {
let location = input.current_source_location();
let i = input.expect_ident()?;
CustomIdent::from_ident(location, i, &["all", "none", "auto"])
Ok(MozContextProperties(CustomIdent::from_ident(location, i, &["all", "none", "auto"])?))
}
}