style: Support 'shape-image-threshold' property draft
authorTing-Yu Lin <tlin@mozilla.com>
Mon, 27 Nov 2017 18:22:41 +0800
changeset 704622 ff3e0aad3b3090eca92dbf0cc163ecbb2127a1fd
parent 704621 a5b356a5aadce4b725630d5f14cf57ce2cd130af
child 742095 7b047e7598d1e78f30f890466e86a982dc83b88f
push id91177
push userbmo:tlin@mozilla.com
push dateTue, 28 Nov 2017 17:20:51 +0000
milestone59.0a1
style: Support 'shape-image-threshold' property MozReview-Commit-ID: 14lzl3ln3Rg
servo/components/style/properties/gecko.mako.rs
servo/components/style/properties/longhand/box.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -3094,17 +3094,18 @@ fn static_assert() {
                           transition-duration transition-delay
                           transition-timing-function transition-property
                           page-break-before page-break-after
                           scroll-snap-points-x scroll-snap-points-y
                           scroll-snap-type-x scroll-snap-type-y scroll-snap-coordinate
                           perspective-origin -moz-binding will-change
                           overscroll-behavior-x overscroll-behavior-y
                           perspective-origin -moz-binding will-change
-                          shape-outside contain touch-action""" %>
+                          shape-image-threshold shape-outside
+                          contain touch-action""" %>
 <%self:impl_trait style_struct_name="Box" skip_longhands="${skip_box_longhands}">
 
     // We manually-implement the |display| property until we get general
     // infrastructure for preffing certain values.
     <% display_keyword = Keyword("display", "inline block inline-block table inline-table table-row-group " +
                                             "table-header-group table-footer-group table-row table-column-group " +
                                             "table-column table-cell table-caption list-item flex none " +
                                             "inline-flex grid inline-grid ruby ruby-base ruby-base-container " +
@@ -3617,16 +3618,19 @@ fn static_assert() {
             T::AnimateableFeatures(
                 self.gecko.mWillChange.iter().map(|gecko_atom| {
                     CustomIdent((gecko_atom.mRawPtr as *mut nsAtom).into())
                 }).collect()
             )
         }
     }
 
+    <% impl_simple_type_with_conversion("shape_image_threshold",
+                                        "mShapeImageThreshold") %>
+
     <% impl_shape_source("shape_outside", "mShapeOutside") %>
 
     pub fn set_contain(&mut self, v: longhands::contain::computed_value::T) {
         use gecko_bindings::structs::NS_STYLE_CONTAIN_NONE;
         use gecko_bindings::structs::NS_STYLE_CONTAIN_STRICT;
         use gecko_bindings::structs::NS_STYLE_CONTAIN_LAYOUT;
         use gecko_bindings::structs::NS_STYLE_CONTAIN_STYLE;
         use gecko_bindings::structs::NS_STYLE_CONTAIN_PAINT;
--- a/servo/components/style/properties/longhand/box.mako.rs
+++ b/servo/components/style/properties/longhand/box.mako.rs
@@ -907,16 +907,24 @@
                     "auto",
                 ])
             }).map(SpecifiedValue::AnimateableFeatures)
         }
     }
 </%helpers:longhand>
 
 ${helpers.predefined_type(
+    "shape-image-threshold", "Opacity", "0.0",
+    products="gecko",
+    gecko_pref="layout.css.shape-outside.enabled",
+    animation_value_type="ComputedValue",
+    spec="https://drafts.csswg.org/css-shapes/#shape-image-threshold-property",
+)}
+
+${helpers.predefined_type(
     "shape-outside",
     "basic_shape::FloatAreaShape",
     "generics::basic_shape::ShapeSource::None",
     products="gecko",
     boxed=True,
     gecko_pref="layout.css.shape-outside.enabled",
     animation_value_type="ComputedValue",
     flags="APPLIES_TO_FIRST_LETTER",