aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnthony Ramine <n.oxyde@gmail.com>2017-05-01 13:18:29 +0200
committerAnthony Ramine <n.oxyde@gmail.com>2017-05-01 15:00:23 +0200
commit2c9a2f61f42a2927346ec83a8bd700ff07054a8f (patch)
tree23b93328552430591b8d6bfb7c76f548da249e7b
parentecc818165f4a3367eb5b5174766a2f4c0fc04063 (diff)
downloadservo-2c9a2f61f42a2927346ec83a8bd700ff07054a8f.tar.gz
servo-2c9a2f61f42a2927346ec83a8bd700ff07054a8f.zip
Implement -moz-force-broken-image-icon in geckolib
-rw-r--r--components/style/properties/gecko.mako.rs9
-rw-r--r--components/style/properties/longhand/ui.mako.rs47
2 files changed, 56 insertions, 0 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs
index f3d4d229cec..aa362da1724 100644
--- a/components/style/properties/gecko.mako.rs
+++ b/components/style/properties/gecko.mako.rs
@@ -4041,6 +4041,15 @@ clip-path
% endfor
</%self:impl_trait>
+<%self:impl_trait style_struct_name="UI" skip_longhands="-moz-force-broken-image-icon">
+ #[allow(non_snake_case)]
+ pub fn set__moz_force_broken_image_icon(&mut self, v: longhands::_moz_force_broken_image_icon::computed_value::T) {
+ self.gecko.mForceBrokenImageIcon = v.0 as u8;
+ }
+
+ ${impl_simple_copy("_moz_force_broken_image_icon", "mForceBrokenImageIcon")}
+</%self:impl_trait>
+
<%self:impl_trait style_struct_name="XUL"
skip_longhands="-moz-stack-sizing -moz-box-ordinal-group">
diff --git a/components/style/properties/longhand/ui.mako.rs b/components/style/properties/longhand/ui.mako.rs
index dff6e846050..05808307635 100644
--- a/components/style/properties/longhand/ui.mako.rs
+++ b/components/style/properties/longhand/ui.mako.rs
@@ -30,3 +30,50 @@ ${helpers.single_keyword("-moz-window-dragging", "default drag no-drag", product
gecko_enum_prefix="StyleWindowDragging",
animation_value_type="none",
spec="None (Nonstandard Firefox-only property)")}
+
+<%helpers:longhand name="-moz-force-broken-image-icon"
+ products="gecko"
+ animation_value_type="none"
+ spec="None (Nonstandard Firefox-only property)">
+ use cssparser::Token;
+ use std::fmt;
+ use style_traits::ToCss;
+ use values::HasViewportPercentage;
+ use values::computed::ComputedValueAsSpecified;
+
+ no_viewport_percentage!(SpecifiedValue);
+
+ pub mod computed_value {
+ #[derive(Debug, Clone, Copy, PartialEq)]
+ #[cfg_attr(feature = "servo", derive(HeapSizeOf))]
+ pub struct T(pub bool);
+ }
+
+ pub use self::computed_value::T as SpecifiedValue;
+
+ impl ToCss for computed_value::T {
+ fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
+ dest.write_str(if self.0 { "1" } else { "0" })
+ }
+ }
+
+ #[inline]
+ pub fn get_initial_value() -> computed_value::T {
+ computed_value::T(false)
+ }
+
+ #[inline]
+ pub fn get_initial_specified_value() -> SpecifiedValue {
+ computed_value::T(false)
+ }
+
+ impl ComputedValueAsSpecified for SpecifiedValue {}
+
+ pub fn parse(_context: &ParserContext, input: &mut Parser) -> Result<SpecifiedValue, ()> {
+ match try!(input.expect_integer()) {
+ 0 => Ok(computed_value::T(false)),
+ 1 => Ok(computed_value::T(true)),
+ _ => Err(()),
+ }
+ }
+</%helpers:longhand>