Don't serialize initial text-decoration-style #15790

This commit is contained in:
projektir 2017-03-07 23:53:22 -05:00
parent b11847d86c
commit b4c50de31e
7 changed files with 97 additions and 32 deletions

View file

@ -1247,23 +1247,22 @@ pub mod style_structs {
self.outline_width != ::app_units::Au(0)
}
% elif style_struct.name == "Text":
<% text_decoration_field = 'text_decoration' if product == 'servo' else 'text_decoration_line' %>
/// Whether the text decoration has an underline.
#[inline]
pub fn has_underline(&self) -> bool {
self.${text_decoration_field}.contains(longhands::${text_decoration_field}::UNDERLINE)
self.text_decoration_line.contains(longhands::text_decoration_line::UNDERLINE)
}
/// Whether the text decoration has an overline.
#[inline]
pub fn has_overline(&self) -> bool {
self.${text_decoration_field}.contains(longhands::${text_decoration_field}::OVERLINE)
self.text_decoration_line.contains(longhands::text_decoration_line::OVERLINE)
}
/// Whether the text decoration has a line through.
#[inline]
pub fn has_line_through(&self) -> bool {
self.${text_decoration_field}.contains(longhands::${text_decoration_field}::LINE_THROUGH)
self.text_decoration_line.contains(longhands::text_decoration_line::LINE_THROUGH)
}
% endif
}
@ -1894,7 +1893,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
PropertyDeclaration::Color(_) |
PropertyDeclaration::Position(_) |
PropertyDeclaration::Float(_) |
PropertyDeclaration::TextDecoration${'' if product == 'servo' else 'Line'}(_) |
PropertyDeclaration::TextDecorationLine(_) |
PropertyDeclaration::WritingMode(_) |
PropertyDeclaration::Direction(_)
% if product == 'gecko':