Bug 1367635 - Part 2: Set writing mode dependency and uncacheable state only for non-inherited properties. r=emilio
MozReview-Commit-ID: LDwEV4g4q8v
--- 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
}
}
}