mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Auto merge of #15861 - projektir:make-text-decoration-testable, r=Wafflespeanut
Make text decoration testable and do not serialize initial text-decoration-style Servo now uses the same name for the text-decoration-line longhand property as Gecko. This was done to enable testing of the text-decoration shorthand. The text-decoration shorthand has been fixed to not serialize initial text-decoration-style. --- - [x ] `./mach build -d` does not report any errors - [x ] `./mach test-tidy` does not report any errors - [x ] These changes fix #15790 --- - [x ] There are tests for these changes <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15861) <!-- Reviewable:end -->
This commit is contained in:
commit
dc3b32c853
7 changed files with 97 additions and 32 deletions
|
@ -1306,23 +1306,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
|
||||
}
|
||||
|
@ -1953,7 +1952,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':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue