Bug 1367635 - Part 2: Set writing mode dependency and uncacheable state only for non-inherited properties. r=emilio draft
authorCameron McCormack <cam@mcc.id.au>
Wed, 13 Sep 2017 15:58:49 +0800
changeset 664565 5eff987eca861f2d4275a1daebd6d8e8cc3e4cf5
parent 664564 5dc04b4b348e66b891bd4378db30eacb6dc70973
child 664566 3477fc2fabda85e946e6f639524b7df01bcca3c3
push id79725
push userbmo:cam@mcc.id.au
push dateThu, 14 Sep 2017 03:06:57 +0000
reviewersemilio
bugs1367635
milestone57.0a1
Bug 1367635 - Part 2: Set writing mode dependency and uncacheable state only for non-inherited properties. r=emilio MozReview-Commit-ID: LDwEV4g4q8v
servo/components/style/properties/helpers.mako.rs
--- a/servo/components/style/properties/helpers.mako.rs
+++ b/servo/components/style/properties/helpers.mako.rs
@@ -317,17 +317,17 @@
             % if not property.derived_from:
                 match value {
                     DeclaredValue::Value(specified_value) => {
                         % if property.ident in SYSTEM_FONT_LONGHANDS and product == "gecko":
                             if let Some(sf) = specified_value.get_system() {
                                 longhands::system_font::resolve_system_font(sf, context);
                             }
                         % endif
-                        % if property.logical:
+                        % if not property.style_struct.inherited and property.logical:
                             context.rule_cache_conditions.borrow_mut()
                                 .set_writing_mode_dependency(context.builder.writing_mode);
                         % endif
                         % if property.is_vector:
                             // In the case of a vector property we want to pass
                             // down an iterator so that this can be computed
                             // without allocation
                             //
@@ -362,27 +362,29 @@
                         % endif
                     }
                     DeclaredValue::WithVariables(_) => unreachable!(),
                     DeclaredValue::CSSWideKeyword(keyword) => match keyword {
                         % if not data.current_style_struct.inherited:
                         CSSWideKeyword::Unset |
                         % endif
                         CSSWideKeyword::Initial => {
-                            context.rule_cache_conditions.borrow_mut().set_uncacheable();
                             % if property.ident == "font_size":
                                 longhands::font_size::cascade_initial_font_size(context);
                             % else:
                                 context.builder.reset_${property.ident}();
                             % endif
                         },
                         % if data.current_style_struct.inherited:
                         CSSWideKeyword::Unset |
                         % endif
                         CSSWideKeyword::Inherit => {
+                            % if not property.style_struct.inherited:
+                                context.rule_cache_conditions.borrow_mut().set_uncacheable();
+                            % endif
                             % if property.ident == "font_size":
                                 longhands::font_size::cascade_inherit_font_size(context);
                             % else:
                                 context.builder.inherit_${property.ident}();
                             % endif
                         }
                     }
                 }