Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFix serialization of timing-function #14899
Conversation
highfive
commented
Jan 6, 2017
highfive
commented
Jan 6, 2017
|
r? @Manishearth |
|
@bors-servo try |
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 -->
|
(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) |
|
r=me with nits |
| "step-end" => Ok(super::STEP_END), | ||
| _ => Err(()) | ||
| } | ||
| impl TransitionTimingFunction { |
This comment has been minimized.
This comment has been minimized.
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.
This comment has been minimized.
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.
This comment has been minimized.
Manishearth
Jan 6, 2017
Member
computed_value::T(self.0.iter().map(|f| f.to_computed_value(context)).collect())
This comment has been minimized.
This comment has been minimized.
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.
This comment has been minimized.
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?
|
@bors-servo try |
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 try |
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 -->
|
|
|
|
|
ongoing wpt / css builds are at http://build.servo.org/builders/linux-rel-wpt/builds/1752 http://build.servo.org/builders/linux-rel-css/builds/1744 |
|
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. |
|
I don't now the best place for the new test so I placed it in cssom folder again :) I'm open to suggestions. |
|
|
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 retry
|
|
|
|
@bors-servo r=Manishearth |
|
|
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 -->
|
|
canova commentedJan 6, 2017
•
edited by larsbergstrom
transition-timing-functionandanimation-timing-functionproperties corrected to reflect the spec. It was converting function keywords tocubic-bezierorstepsfunctions directly. But we needed to store it to use in the serialization step../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is