Auto merge of #19749 - gootorov:move_-moz-context-properties_from_mako, r=emilio

style: Move -moz-context-properties outside of mako.

<!-- Please describe your changes on the following line: -->
Sub-PR of #19015

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #19742  (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19749)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-01-15 06:04:30 -06:00 committed by GitHub
commit 2ff3e119fa
6 changed files with 34 additions and 26 deletions

View file

@ -5255,16 +5255,16 @@ clip-path
self.gecko.mContextPropsBits = 0; self.gecko.mContextPropsBits = 0;
for (gecko, servo) in self.gecko.mContextProps.iter_mut().zip(v) { 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; 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; 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; 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; 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

@ -136,24 +136,11 @@ ${helpers.predefined_type("paint-order", "SVGPaintOrder", "computed::SVGPaintOrd
gecko_pref="svg.paint-order.enabled", gecko_pref="svg.paint-order.enabled",
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder")} spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder")}
<%helpers:vector_longhand name="-moz-context-properties" ${helpers.predefined_type("-moz-context-properties",
animation_value_type="none" "MozContextProperties",
products="gecko" initial_value=None,
spec="Nonstandard (Internal-only)" vector=True,
allow_empty="True"> animation_value_type="none",
use values::CustomIdent; products="gecko",
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)",
pub type SpecifiedValue = CustomIdent; allow_empty=True)}
pub mod computed_value {
pub type T = super::SpecifiedValue;
}
pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<SpecifiedValue, ParseError<'i>> {
let location = input.current_source_location();
let i = input.expect_ident()?;
CustomIdent::from_ident(location, i, &["all", "none", "auto"])
}
</%helpers:vector_longhand>

View file

@ -63,6 +63,7 @@ pub use self::percentage::Percentage;
pub use self::position::{Position, GridAutoFlow, GridTemplateAreas}; pub use self::position::{Position, GridAutoFlow, GridTemplateAreas};
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind}; pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth}; pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::svg::MozContextProperties;
pub use self::table::XSpan; pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextAlign, TextOverflow, WordSpacing}; pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextAlign, TextOverflow, WordSpacing};
pub use self::time::Time; pub use self::time::Time;

View file

@ -13,6 +13,8 @@ use values::generics::svg as generic;
pub use values::specified::SVGPaintOrder; pub use values::specified::SVGPaintOrder;
pub use values::specified::MozContextProperties;
/// Computed SVG Paint value /// Computed SVG Paint value
pub type SVGPaint = generic::SVGPaint<RGBA, ComputedUrl>; pub type SVGPaint = generic::SVGPaint<RGBA, ComputedUrl>;
/// Computed SVG Paint Kind value /// Computed SVG Paint Kind value

View file

@ -59,6 +59,7 @@ pub use self::percentage::Percentage;
pub use self::position::{Position, PositionComponent, GridAutoFlow, GridTemplateAreas}; pub use self::position::{Position, PositionComponent, GridAutoFlow, GridTemplateAreas};
pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind}; pub use self::svg::{SVGLength, SVGOpacity, SVGPaint, SVGPaintKind};
pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth}; pub use self::svg::{SVGPaintOrder, SVGStrokeDashArray, SVGWidth};
pub use self::svg::MozContextProperties;
pub use self::table::XSpan; pub use self::table::XSpan;
pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextDecorationLine}; pub use self::text::{InitialLetter, LetterSpacing, LineHeight, TextDecorationLine};
pub use self::text::{TextAlign, TextAlignKeyword, TextOverflow, WordSpacing}; pub use self::text::{TextAlign, TextAlignKeyword, TextOverflow, WordSpacing};

View file

@ -8,6 +8,7 @@ use cssparser::Parser;
use parser::{Parse, ParserContext}; use parser::{Parse, ParserContext};
use std::fmt; use std::fmt;
use style_traits::{CommaWithSpace, ParseError, Separator, StyleParseErrorKind, ToCss}; use style_traits::{CommaWithSpace, ParseError, Separator, StyleParseErrorKind, ToCss};
use values::CustomIdent;
use values::generics::svg as generic; use values::generics::svg as generic;
use values::specified::{LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber}; use values::specified::{LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber};
use values::specified::{Number, Opacity, SpecifiedUrl}; use values::specified::{Number, Opacity, SpecifiedUrl};
@ -260,3 +261,19 @@ impl ToCss for SVGPaintOrder {
Ok(()) Ok(())
} }
} }
/// Specified MozContextProperties value.
/// Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-context-properties)
#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToComputedValue, ToCss)]
pub struct MozContextProperties(pub CustomIdent);
impl Parse for MozContextProperties {
fn parse<'i, 't>(
_context: &ParserContext,
input: &mut Parser<'i, 't>
) -> Result<MozContextProperties, ParseError<'i>> {
let location = input.current_source_location();
let i = input.expect_ident()?;
Ok(MozContextProperties(CustomIdent::from_ident(location, i, &["all", "none", "auto"])?))
}
}