Skip to content

style: Move will-change outside of mako - #19583

Merged
bors-servo merged 2 commits into
servo:masterfrom
CYBAI:move-will-change-out-of-mako
Dec 16, 2017
Merged

bors-servo merged 2 commits into
servo:masterfrom
CYBAI:move-will-change-out-of-mako

Conversation

@CYBAI

@CYBAI CYBAI commented Dec 16, 2017 •

Copy link
Copy Markdown
Member

This is a sub-PR of #19015
r? emilio



This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/values/specified/box.rs, components/style/properties/longhand/box.mako.rs, components/style/values/computed/box.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs
  • @canaltinova: components/style/values/specified/box.rs, components/style/properties/longhand/box.mako.rs, components/style/values/computed/box.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs
  • @emilio: components/style/values/specified/box.rs, components/style/properties/longhand/box.mako.rs, components/style/values/computed/box.rs, components/style/values/specified/mod.rs, components/style/values/computed/mod.rs

@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 Dec 16, 2017

@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 great! r=me with that.

pub enum WillChange {
/// Expresses no particular intent
Auto,
/// scroll-position | contents | <custom-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.

You can derive(ToCss) and use #[css(iterable, comma)] in this variant.

I'd remove the scroll-position | contents productions since we don't use them, but it's not a big deal anyway.

@CYBAI CYBAI Dec 16, 2017 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let me try to use derive(ToCss) for it! Thanks!

I'd remove the scroll-position | contents productions since we don't use them

Got it. I add them after reading the spec but I think it might be better to remove them due to not using anymore.

input: &mut Parser<'i, 't>
) -> Result<WillChange, ParseError<'i>> {
if input.try(|input| input.expect_ident_matching("auto")).is_ok() {
Ok(WillChange::Auto)

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: I'd early-return here and deindent the rest, but your call.

/// Expresses no particular intent
Auto,
/// scroll-position | contents | <custom-ident>
AnimateableFeatures(Vec<CustomIdent>),

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.

You may want to also use Box<[CustomIdent]> to save some memory, but again, completely optional :)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let me try to use Box again!

@CYBAI
CYBAI force-pushed the move-will-change-out-of-mako branch from 6f5a078 to f3cf265 Compare December 16, 2017 17:35
@CYBAI

CYBAI commented Dec 16, 2017

Copy link
Copy Markdown
Member Author

@emilio Updated!

r=me with that.

I don't have the permission to ask bors to run test 😂

@KiChjang

Copy link
Copy Markdown
Contributor

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f3cf265 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 Dec 16, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f3cf265 with merge da49e24...

bors-servo pushed a commit that referenced this pull request Dec 16, 2017
style: Move will-change outside of mako

This is a sub-PR of #19015
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19582
- [x] These changes do not require tests

<!-- 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/19583)
<!-- Reviewable:end -->
pub enum WillChange {
/// Expresses no particular intent
Auto,
#[css(comma, function, iterable)]

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.

This shouldn't have function, otherwise it'd serialize as animatable-features(foo, bar) instead of just foo, bar.

@emilio

emilio commented Dec 16, 2017

Copy link
Copy Markdown
Member

@bors-servo r-

Sorry, that needs to be addressed :)

@emilio
emilio force-pushed the move-will-change-out-of-mako branch from f3cf265 to 2eb3966 Compare December 16, 2017 20:50
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 16, 2017
@emilio

emilio commented Dec 16, 2017

Copy link
Copy Markdown
Member

@bors-servo r+

I just did that since it's 5AM in Taipei, and there was a simple patch that was required to make it build. Manish reviewed that one-liner :)

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 2eb3966 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 Dec 16, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 2eb3966 with merge 1412cb2...

bors-servo pushed a commit that referenced this pull request Dec 16, 2017
style: Move will-change outside of mako

This is a sub-PR of #19015
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19582
- [x] These changes do not require tests

<!-- 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/19583)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-css

@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 16, 2017
@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 16, 2017
@emilio

emilio commented Dec 16, 2017

Copy link
Copy Markdown
Member

@bors-servo retry

{"status": "TIMEOUT", "group": "default", "message": null, "stack": null, "subtest": null, "test": "/_mozilla/mozilla/css-paint-api/paint2d-rects.html", "line": 24864, "action": "test_result", "expected": "PASS"}

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 2eb3966 with merge 8aba41d...

bors-servo pushed a commit that referenced this pull request Dec 16, 2017
style: Move will-change outside of mako

This is a sub-PR of #19015
r? emilio

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #19582
- [x] These changes do not require tests

<!-- 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/19583)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Dec 16, 2017
@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 8aba41d to master...

@bors-servo
bors-servo merged commit 2eb3966 into servo:master Dec 16, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Dec 16, 2017
@CYBAI
CYBAI deleted the move-will-change-out-of-mako branch December 17, 2017 01:39
@CYBAI

CYBAI commented Dec 17, 2017

Copy link
Copy Markdown
Member Author

@emilio Thanks for the patch! Sorry for that I didn't notice how exactly #[css(function)] works.

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.

Move will-change outside of mako.

5 participants