Support text-decoration-line and the text-decoration shorthand in geckolib.

This commit is contained in:
Cameron McCormack 2016-05-25 18:21:54 +10:00
parent 53a9defa9f
commit 0580e1854e
4 changed files with 74 additions and 9 deletions

View file

@ -130,6 +130,7 @@ pub mod shorthands {
<%include file="/shorthand/margin.mako.rs" />
<%include file="/shorthand/outline.mako.rs" />
<%include file="/shorthand/padding.mako.rs" />
<%include file="/shorthand/text.mako.rs" />
}
@ -815,14 +816,15 @@ pub mod style_structs {
self.outline_width != ::app_units::Au(0)
}
% elif style_struct.trait_name == "Text":
<% text_decoration_field = 'text_decoration' if product == 'servo' else 'text_decoration_line' %>
fn has_underline(&self) -> bool {
self.text_decoration.underline
self.${text_decoration_field}.underline
}
fn has_overline(&self) -> bool {
self.text_decoration.overline
self.${text_decoration_field}.overline
}
fn has_line_through(&self) -> bool {
self.text_decoration.line_through
self.${text_decoration_field}.line_through
}
% endif
}
@ -1463,7 +1465,7 @@ pub fn cascade<C: ComputedValues>(
PropertyDeclaration::Color(_) |
PropertyDeclaration::Position(_) |
PropertyDeclaration::Float(_) |
PropertyDeclaration::TextDecoration(_)
PropertyDeclaration::TextDecoration${'' if product == 'servo' else 'Line'}(_)
);
if
% if category_to_cascade_now == "early":