Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix serialization of timing-function #14899

Merged
merged 4 commits into from Jan 8, 2017
Merged

Conversation

@canova
Copy link
Member

canova commented Jan 6, 2017

transition-timing-function and animation-timing-function properties corrected to reflect the spec. It was converting function keywords to cubic-bezier or steps functions directly. But we needed to store it to use in the serialization step.


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #14822 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Jan 6, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/longhand/box.mako.rs, components/style/properties/shorthand/box.mako.rs
  • @emilio: components/style/properties/longhand/box.mako.rs, components/style/properties/shorthand/box.mako.rs
@highfive
Copy link

highfive commented Jan 6, 2017

warning Warning warning

  • These commits modify style code, but no tests are modified. Please consider adding a test!
@canova
Copy link
Member Author

canova commented Jan 6, 2017

@highfive highfive assigned Manishearth and unassigned glennw Jan 6, 2017
@Manishearth
Copy link
Member

Manishearth commented Jan 6, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 6, 2017

Trying commit 22b7b9b with merge 7c1f6c9...

bors-servo added a commit that referenced this pull request Jan 6, 2017
Fix serialization of timing-function

<!-- Please describe your changes on the following line: -->
`transition-timing-function` and `animation-timing-function` properties corrected to reflect [the spec](https://drafts.csswg.org/css-transitions/#serializing-a-timing-function). It was converting function keywords to `cubic-bezier` or `steps` functions directly. But we needed to store it to use in the serialization step.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14822 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14899)
<!-- Reviewable:end -->
@Manishearth
Copy link
Member

Manishearth commented Jan 6, 2017

(please add a test if try doesn't turn up anything)

You can add it to WPT or add it to CSS (if CSS, add it under mozilla and submit upstream directly)

Copy link
Member

Manishearth left a comment

r=me with nits

"step-end" => Ok(super::STEP_END),
_ => Err(())
}
impl TransitionTimingFunction {

This comment has been minimized.

@Manishearth

Manishearth Jan 6, 2017

Member

This impl need not exist anymore. computed values don't need parse functions

try!(dest.write_str(", "));
try!(start_end.to_css(dest));
dest.write_str(")")
let is_start = if let StartEnd::Start = start_end { true } else { false };

This comment has been minimized.

@Manishearth

Manishearth Jan 6, 2017

Member

let is_start = StartEnd::Start == start_end.

Though you can just pass start_end directly to serialize_steps and deal with it there.

#[inline]
fn to_computed_value(&self, context: &Context) -> computed_value::T {
let mut computed = vec![];
for timing_function in self.0.iter() {

This comment has been minimized.

@Manishearth

Manishearth Jan 6, 2017

Member

computed_value::T(self.0.iter().map(|f| f.to_computed_value(context)).collect())

This comment has been minimized.

@Manishearth

Manishearth Jan 6, 2017

Member

Any reason why we can't use vector_longhand here (with allow_empty=True)? Then you only need to write code dealing with TTF, not with the vec of TTF.

This comment has been minimized.

@canova

canova Jan 6, 2017

Author Member

I don't think there is a reason not to. But there are another properties to change too. Do you prefer to doing it in this pr or another one?

@canova canova force-pushed the canova:transition-timing branch from cc064ad to 106b61d Jan 6, 2017
@canova
Copy link
Member Author

canova commented Jan 6, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 6, 2017

Trying commit 106b61d with merge a190401...

bors-servo added a commit that referenced this pull request Jan 6, 2017
Fix serialization of timing-function

<!-- Please describe your changes on the following line: -->
`transition-timing-function` and `animation-timing-function` properties corrected to reflect [the spec](https://drafts.csswg.org/css-transitions/#serializing-a-timing-function). It was converting function keywords to `cubic-bezier` or `steps` functions directly. But we needed to store it to use in the serialization step.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14822 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14899)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 6, 2017

💔 Test failed - linux-dev

@canova canova force-pushed the canova:transition-timing branch from 106b61d to 9f0d065 Jan 6, 2017
@highfive highfive removed the S-tests-failed label Jan 6, 2017
@canova
Copy link
Member Author

canova commented Jan 6, 2017

@bors-servo try
(oops, I forgot to push last changes)

@bors-servo
Copy link
Contributor

bors-servo commented Jan 6, 2017

Trying commit 9f0d065 with merge 6d295ab...

bors-servo added a commit that referenced this pull request Jan 6, 2017
Fix serialization of timing-function

<!-- Please describe your changes on the following line: -->
`transition-timing-function` and `animation-timing-function` properties corrected to reflect [the spec](https://drafts.csswg.org/css-transitions/#serializing-a-timing-function). It was converting function keywords to `cubic-bezier` or `steps` functions directly. But we needed to store it to use in the serialization step.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14822 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14899)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 6, 2017

💔 Test failed - linux-dev

@Manishearth
Copy link
Member

Manishearth commented Jan 6, 2017

./mach test-unit -p style needs fixing

   Compiling style v0.0.1 (file:///home/servo/buildbot/slave/linux-dev/build/components/style)
   Compiling style_tests v0.0.1 (file:///home/servo/buildbot/slave/linux-dev/build/tests/unit/style)
error[E0308]: mismatched types
   --> /home/servo/buildbot/slave/linux-dev/build/tests/unit/style/properties/serialization.rs:586:71
    |
586 |         properties.push(PropertyDeclaration::TransitionTimingFunction(timing_function));
    |                                                                       ^^^^^^^^^^^^^^^ expected struct `style::properties::longhands::transition_timing_function::SpecifiedValue`, found struct `style::computed_values::computed_value::T`
    |
    = note: expected type `style::properties::DeclaredValue<style::properties::longhands::transition_timing_function::SpecifiedValue>`
    = note:    found type `style::properties::DeclaredValue<style::computed_values::computed_value::T>`

error: aborting due to previous erro
@highfive highfive removed the S-tests-failed label Jan 7, 2017
@canova
Copy link
Member Author

canova commented Jan 7, 2017

Some tests were wrong and updated the test expectations as fail until they're merged into servo (See here). Also added a new test to cover all cases.

@canova
Copy link
Member Author

canova commented Jan 7, 2017

I don't now the best place for the new test so I placed it in cssom folder again :) I'm open to suggestions.

@bors-servo
Copy link
Contributor

bors-servo commented Jan 7, 2017

📌 Commit 0d07980 has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jan 7, 2017

Testing commit 0d07980 with merge 365c067...

bors-servo added a commit that referenced this pull request Jan 7, 2017
Fix serialization of timing-function

<!-- Please describe your changes on the following line: -->
`transition-timing-function` and `animation-timing-function` properties corrected to reflect [the spec](https://drafts.csswg.org/css-transitions/#serializing-a-timing-function). It was converting function keywords to `cubic-bezier` or `steps` functions directly. But we needed to store it to use in the serialization step.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14822 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14899)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jan 7, 2017

💔 Test failed - android

@canova
Copy link
Member Author

canova commented Jan 7, 2017

@bors-servo retry

  • Infra
@bors-servo
Copy link
Contributor

bors-servo commented Jan 7, 2017

The latest upstream changes (presumably #14893) made this pull request unmergeable. Please resolve the merge conflicts.

@canova canova force-pushed the canova:transition-timing branch from 0d07980 to 8d90aa0 Jan 7, 2017
@canova
Copy link
Member Author

canova commented Jan 7, 2017

@bors-servo r=Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jan 7, 2017

📌 Commit 8d90aa0 has been approved by Manishearth

@bors-servo
Copy link
Contributor

bors-servo commented Jan 8, 2017

Testing commit 8d90aa0 with merge 496447a...

bors-servo added a commit that referenced this pull request Jan 8, 2017
Fix serialization of timing-function

<!-- Please describe your changes on the following line: -->
`transition-timing-function` and `animation-timing-function` properties corrected to reflect [the spec](https://drafts.csswg.org/css-transitions/#serializing-a-timing-function). It was converting function keywords to `cubic-bezier` or `steps` functions directly. But we needed to store it to use in the serialization step.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #14822 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/14899)
<!-- Reviewable:end -->
@bors-servo bors-servo merged commit 8d90aa0 into servo:master Jan 8, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@canova canova deleted the canova:transition-timing branch Jan 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

5 participants
You can’t perform that action at this time.