Bug 1463603 - Ensure modified_reset is set when {mutate,take}_reset_struct is called. r?heycam draft
authorXidorn Quan <me@upsuper.org>
Wed, 23 May 2018 13:58:38 +1000
changeset 798587 0987504f363d9e723da9700362ba4046ddeec9d8
parent 798586 3833bbfdd7fe4981a740bc4798b3e6756cb9e130
push id110798
push userxquan@mozilla.com
push dateWed, 23 May 2018 03:59:20 +0000
reviewersheycam
bugs1463603
milestone62.0a1
Bug 1463603 - Ensure modified_reset is set when {mutate,take}_reset_struct is called. r?heycam MozReview-Commit-ID: 8mqVb7kl0ok
servo/components/style/properties/properties.mako.rs
--- a/servo/components/style/properties/properties.mako.rs
+++ b/servo/components/style/properties/properties.mako.rs
@@ -3194,16 +3194,17 @@ impl<'a> StyleBuilder<'a> {
                 % elif product == "gecko" and property.ident in props_need_device:
                 self.device,
                 % endif
             );
     }
     % endif
     % endif
     % endfor
+    <% del property %>
 
     /// Inherits style from the parent element, accounting for the default
     /// computed values that need to be provided as well.
     pub fn for_inheritance(
         device: &'a Device,
         parent: Option<<&'a ComputedValues>,
         pseudo: Option<<&'a PseudoElement>,
     ) -> Self {
@@ -3251,25 +3252,25 @@ impl<'a> StyleBuilder<'a> {
     % for style_struct in data.active_style_structs():
         /// Gets an immutable view of the current `${style_struct.name}` style.
         pub fn get_${style_struct.name_lower}(&self) -> &style_structs::${style_struct.name} {
             &self.${style_struct.ident}
         }
 
         /// Gets a mutable view of the current `${style_struct.name}` style.
         pub fn mutate_${style_struct.name_lower}(&mut self) -> &mut style_structs::${style_struct.name} {
-            % if not property.style_struct.inherited:
+            % if not style_struct.inherited:
             self.modified_reset = true;
             % endif
             self.${style_struct.ident}.mutate()
         }
 
         /// Gets a mutable view of the current `${style_struct.name}` style.
         pub fn take_${style_struct.name_lower}(&mut self) -> UniqueArc<style_structs::${style_struct.name}> {
-            % if not property.style_struct.inherited:
+            % if not style_struct.inherited:
             self.modified_reset = true;
             % endif
             self.${style_struct.ident}.take()
         }
 
         /// Gets a mutable view of the current `${style_struct.name}` style.
         pub fn put_${style_struct.name_lower}(&mut self, s: UniqueArc<style_structs::${style_struct.name}>) {
             self.${style_struct.ident}.put(s)
@@ -3283,16 +3284,17 @@ impl<'a> StyleBuilder<'a> {
         }
 
         /// Reset the current `${style_struct.name}` style to its default value.
         pub fn reset_${style_struct.name_lower}_struct(&mut self) {
             self.${style_struct.ident} =
                 StyleStructRef::Borrowed(self.reset_style.${style_struct.name_lower}_arc());
         }
     % endfor
+    <% del style_struct %>
 
     /// Returns whether this computed style represents a floated object.
     pub fn floated(&self) -> bool {
         self.get_box().clone_float() != longhands::float::computed_value::T::None
     }
 
     /// Returns whether this computed style represents an out of flow-positioned
     /// object.