Repository navigation
Move text-decoration-line out of mako - #19211
Conversation
|
r? @emilio |
69cc166 to
2de2d89
Compare
| ${helpers.predefined_type("text-decoration-line", | ||
| "TextDecorationLine", | ||
| "specified::TextDecorationLine::get_initial_value()", | ||
| initial_specified_value="specified::TextDecorationLine::get_initial_value()", |
| </%helpers:longhand> | ||
| ${helpers.predefined_type("text-decoration-line", | ||
| "TextDecorationLine", | ||
| "specified::TextDecorationLine::get_initial_value()", |
There was a problem hiding this comment.
Let's call this none() instead of get_initial_value()?
| impl_bitflags_conversions!(SpecifiedValue); | ||
| </%helpers:longhand> | ||
| ${helpers.predefined_type("text-decoration-line", | ||
| "TextDecorationLine", |
| "specified::TextDecorationLine::get_initial_value()", | ||
| initial_specified_value="specified::TextDecorationLine::get_initial_value()", | ||
| custom_cascade= product == 'servo', | ||
| cascade_property_custom="specified::TextDecorationLine::cascade_property_custom", |
There was a problem hiding this comment.
what do you think about custom_cascade_function instead? The cascade_property_custom name looks kinda weird.
| #[inline] | ||
| /// Returns the initial value of text-decoration-line | ||
| pub fn get_initial_value() -> Self { | ||
| TextDecorationLine { |
There was a problem hiding this comment.
no need to do this manually, right? just NONE should do it.
| if input.try(|input| input.expect_ident_matching("none")).is_ok() { | ||
| return Ok(result) | ||
| } | ||
| let mut empty = true; |
There was a problem hiding this comment.
Let's get rid of this variable and use result.is_empty() instead.
| let location = input.current_source_location(); | ||
| match input.expect_ident() { | ||
| Ok(ident) => { | ||
| (match_ignore_ascii_case! { &ident, |
There was a problem hiding this comment.
I believe the funky parens shouldn't be needed anymore (this was due to the generics in error types, which were removed).
| loop { | ||
| let result: Result<_, ParseError> = input.try(|input| { | ||
| let location = input.current_source_location(); | ||
| match input.expect_ident() { |
There was a problem hiding this comment.
Given the only thing we do with the error from here is returning it, this can just be match input.expect_ident()?, I think.
And that means that the whole match can become:
try_match_ident_ignore_ascii_case! { input,
// ...
}| use style::properties::longhands::text_decoration_line; | ||
|
|
||
| let mut decoration = text_decoration_line::computed_value::none; | ||
| let mut decoration = text_decoration_line::get_initial_value(); |
There was a problem hiding this comment.
Again, I think it's clearer to just call the method ::none(), so it's obvious from the caller what it is.
|
Heads up! This PR modifies the following files:
|
2de2d89 to
9728232
Compare
9728232 to
6f59a45
Compare
|
@bors-servo r=emilio |
|
📌 Commit 6f59a45 has been approved by |
Move text-decoration-line out of mako Part of #19015. <!-- 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/19211) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css1, mac-rel-css2, mac-rel-wpt1, mac-rel-wpt2, mac-rel-wpt3, mac-rel-wpt4, windows-msvc-dev |
Part of #19015.
This change is