Bug 1463603 - Ensure modified_reset is set when {mutate,take}_reset_struct is called. r=heycam
authorXidorn Quan <me@upsuper.org>
Wed, 23 May 2018 13:58:38 +1000
changeset 419342 3acb2a4a30fe3899bbc7995ece7e49b20106e1f3
parent 419341 3c12d331fae53faf36e15b21d24604f69ac34959
child 419343 32baae2a838a68061b1a72bfbe980ab79c8e176a
push id64323
push userxquan@mozilla.com
push dateWed, 23 May 2018 05:56:09 +0000
treeherderautoland@3acb2a4a30fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1463603
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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.