Skip to content

Move text-decoration-line out of mako - #19211

Merged
bors-servo merged 1 commit into
servo:masterfrom
KiChjang:text-decoration-line
Nov 14, 2017
Merged

bors-servo merged 1 commit into
servo:masterfrom
KiChjang:text-decoration-line

Conversation

@KiChjang

@KiChjang KiChjang commented Nov 14, 2017 •

Copy link
Copy Markdown
Contributor

Part of #19015.


This change is Reviewable

@emilio emilio mentioned this pull request Nov 14, 2017
48 of 49 tasks
@KiChjang

Copy link
Copy Markdown
Contributor Author

r? @emilio

@emilio emilio left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, only some nits :)

Thanks for doing this @KiChjang!

${helpers.predefined_type("text-decoration-line",
"TextDecorationLine",
"specified::TextDecorationLine::get_initial_value()",
initial_specified_value="specified::TextDecorationLine::get_initial_value()",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's call this none() instead?

</%helpers:longhand>
${helpers.predefined_type("text-decoration-line",
"TextDecorationLine",
"specified::TextDecorationLine::get_initial_value()",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call this none() instead of get_initial_value()?

impl_bitflags_conversions!(SpecifiedValue);
</%helpers:longhand>
${helpers.predefined_type("text-decoration-line",
"TextDecorationLine",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Indentation looks off.

"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,
    // ...
}

Comment thread ports/geckolib/glue.rs Outdated
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();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, I think it's clearer to just call the method ::none(), so it's obvious from the caller what it is.

@highfive highfive assigned Manishearth and unassigned emilio Nov 14, 2017
@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/values/computed/text.rs, ports/geckolib/glue.rs, components/style/properties/data.py, components/style/values/specified/mod.rs, components/style/lib.rs and 4 more
  • @canaltinova: components/style/values/computed/text.rs, components/style/properties/data.py, components/style/values/specified/mod.rs, components/style/lib.rs, components/style/values/computed/mod.rs and 3 more
  • @emilio: components/style/values/computed/text.rs, ports/geckolib/glue.rs, components/style/properties/data.py, components/style/values/specified/mod.rs, components/style/lib.rs and 4 more

@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 14, 2017
@highfive highfive assigned emilio and unassigned Manishearth Nov 14, 2017
@KiChjang
KiChjang force-pushed the text-decoration-line branch from 2de2d89 to 9728232 Compare November 14, 2017 19:59
@KiChjang
KiChjang force-pushed the text-decoration-line branch from 9728232 to 6f59a45 Compare November 14, 2017 21:13
@KiChjang

Copy link
Copy Markdown
Contributor Author

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 6f59a45 has been approved by emilio

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Nov 14, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6f59a45 with merge 6f1d9a1...

bors-servo pushed a commit that referenced this pull request Nov 14, 2017
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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ 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
Approved by: emilio
Pushing 6f1d9a1 to master...

@bors-servo
bors-servo merged commit 6f59a45 into servo:master Nov 14, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 14, 2017
@KiChjang
KiChjang deleted the text-decoration-line branch November 14, 2017 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants