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 upImplement individual CSS transform properties: translate, rotate, scale #19859
Conversation
highfive
commented
Jan 25, 2018
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jan 25, 2018
|
These patches were written by @CJKu. I am just landing them on his behalf. They have been reviewed by @emilio and myself. I'll wait for the first part of the Gecko-side patches to be landed and merged to autoland before landing this (and I'll update the Gecko bindings at that time). I'm opening this for now so others can have a look and in case the automated tests pick up anything. |
|
@bors-servo try |
Implement individual CSS transform properties: translate, rotate, scale These are the servo-side changes for [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734). - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734) - [X] There are tests for these changes on the Gecko side including web-platform-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/19859) <!-- Reviewable:end -->
|
|
|
Failure was:
|
|
@bors-servo retry
|
Implement individual CSS transform properties: translate, rotate, scale These are the servo-side changes for [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734). - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734) - [X] There are tests for these changes on the Gecko side including web-platform-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/19859) <!-- Reviewable:end -->
|
As for the Taskcluster failure, the log just has:
? |
|
|
|
On 01/25/2018 07:45 AM, Brian Birtles wrote:
As for the Taskcluster failure, the log
<https://public-artifacts.taskcluster.net/EP2crE3RRIadSc_5scuT5A/0/public/logs/live_backing.log>
just has:
It looks like rustup is not installed. See instructions at
https://github.com/servo/servo/#setting-up-your-environment
?
Yeah, taskcluster doesn't block landing yet, just ignore that.
See:
https://groups.google.com/d/msg/mozilla.dev.servo/lttaOHEMzes/SYTcTk88AAAJ
|
|
@bors-servo retry |
Implement individual CSS transform properties: translate, rotate, scale These are the servo-side changes for [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734). - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734) - [X] There are tests for these changes on the Gecko side including web-platform-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/19859) <!-- Reviewable:end -->
|
|
|
| sum.scale = self.scale.animate(&other.scale, procedure)?; | ||
| sum.skew = self.skew.animate(&other.skew, procedure)?; | ||
| sum.perspective = self.perspective.animate(&other.perspective, procedure)?; | ||
| sum.quaternion = MatrixDecomposed3D::slerp(&self.quaternion, |
This comment has been minimized.
This comment has been minimized.
nox
Jan 26, 2018
Member
Why is this call not like the others? Can't the type of self.quaternion implement Animate and use MatrixDecomposed3D::slerp there? That would make this implementation for MatrixDecomposed3D derivable.
| /// <https://drafts.csswg.org/css-transforms/#interpolation-of-transforms> | ||
| impl ComputedRotate { | ||
| fn fill_unspecified(rotate: &ComputedRotate) | ||
| -> Result<(Number, Number, Number, Angle), ()>{ |
This comment has been minimized.
This comment has been minimized.
| pub fn set_${ident}(&mut self, other: values::computed::${type}) { | ||
| unsafe { self.gecko.${gecko_ffi_name}.clear() }; | ||
|
|
||
| match other.to_transform_operation() { |
This comment has been minimized.
This comment has been minimized.
| /// <https://drafts.csswg.org/css-transforms/#interpolation-of-decomposed-3d-matrix-values> | ||
| fn animate(&self, other: &Self, procedure: Procedure) -> Result<Self, ()> { | ||
| impl MatrixDecomposed3D { | ||
| fn slerp(from: &Quaternion, to: &Quaternion, procedure: Procedure) -> Result<Quaternion, ()> { |
This comment has been minimized.
This comment has been minimized.
nox
Jan 26, 2018
Member
Make this an implementation of Animatable for Quaternion instead of keeping it on MatrixDecomposed3D .
| @@ -2280,6 +2290,130 @@ impl Matrix3D { | |||
| } | |||
| } | |||
|
|
|||
| /// <https://drafts.csswg.org/css-transforms/#interpolation-of-transforms> | |||
| impl ComputedRotate { | |||
| fn fill_unspecified(rotate: &ComputedRotate) | |||
This comment has been minimized.
This comment has been minimized.
nox
Jan 26, 2018
Member
I don't understand the relation between that method name and the spec link just above.
| // | ||
| // Unspecified translations default to 0px | ||
| match translate { | ||
| &Translate::None => { |
This comment has been minimized.
This comment has been minimized.
nox
Jan 26, 2018
Member
Nit: it's more readable to instead dereference the matched value *translate and not prefix every pattern with &.
|
Thanks for the review! |
|
@birtles ACK, didn't realise that! I think we can do follow-up issues if you don't have the bandwidth to make the changes. |
|
Thanks! I'll try to get to it. I think there were some test failures that I need to look into anyway. |
Implement individual CSS transform properties: translate, rotate, scale These are the servo-side changes for [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734). - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734) - [X] There are tests for these changes on the Gecko side including web-platform-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/19859) <!-- Reviewable:end -->
|
|
|
Oh, I didn't realize the PASSes that @jdm originally quoted were actually failures! |
|
@bors-servo r=emilio |
|
|
Implement individual CSS transform properties: translate, rotate, scale These are the servo-side changes for [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734). - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix [Gecko bug 1207734](https://bugzilla.mozilla.org/show_bug.cgi?id=1207734) - [X] There are tests for these changes on the Gecko side including web-platform-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/19859) <!-- Reviewable:end -->
|
|
birtles commentedJan 25, 2018
•
edited by SimonSapin
These are the servo-side changes for Gecko bug 1207734.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is