Skip to content

Implement individual CSS transform properties: translate, rotate, scale - #19859

Merged
bors-servo merged 6 commits into
servo:masterfrom
birtles:individual-transforms
Jan 31, 2018
Merged

bors-servo merged 6 commits into
servo:masterfrom
birtles:individual-transforms

Conversation

@birtles

@birtles birtles commented Jan 25, 2018 •

Copy link
Copy Markdown
Contributor

These are the servo-side changes for Gecko bug 1207734.

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix Gecko bug 1207734
  • There are tests for these changes on the Gecko side including web-platform-tests

This change is Reviewable

@highfive highfive assigned ghost Jan 25, 2018
@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @bholley: components/style/gecko/generated/structs.rs, components/style/gecko/generated/bindings.rs, components/style/values/specified/transform.rs, components/style/values/specified/mod.rs, components/style/properties/gecko.mako.rs and 5 more
  • @canaltinova: components/style/gecko/generated/structs.rs, components/style/gecko/generated/bindings.rs, components/style/values/specified/transform.rs, components/style/values/specified/mod.rs, components/style/properties/gecko.mako.rs and 5 more
  • @emilio: components/style/gecko/generated/structs.rs, components/style/gecko/generated/bindings.rs, components/style/values/specified/transform.rs, components/style/values/specified/mod.rs, components/style/properties/gecko.mako.rs and 5 more
  • @fitzgen: components/script/dom/webidls/CSSStyleDeclaration.webidl
  • @KiChjang: components/script/dom/webidls/CSSStyleDeclaration.webidl
  • @asajeffrey: components/script/dom/webidls/CSSStyleDeclaration.webidl

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jan 25, 2018
@highfive

Copy link
Copy Markdown

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style and script code, but no tests are modified. Please consider adding a test!

@birtles

birtles commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

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.

@birtles

birtles commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 1fb6ec1 with merge 094bafb...

bors-servo pushed a commit that referenced this pull request Jan 25, 2018
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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - arm32

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jan 25, 2018
@birtles

birtles commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

Failure was:

error: failed to execute compile
caused by: error reading compile response from server
caused by: Failed to read response header
caused by: failed to fill whole buffer
error: Could not compile script.

@birtles

birtles commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo retry

  • infra

bors-servo pushed a commit that referenced this pull request Jan 25, 2018
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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 1fb6ec1 with merge 5d7c24f...

@birtles

birtles commented Jan 25, 2018

Copy link
Copy Markdown
Contributor Author

As for the Taskcluster failure, the log just has:

It looks like rustup is not installed. See instructions at https://github.com/servo/servo/#setting-up-your-environment

?

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - arm32

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jan 25, 2018
@emilio

emilio commented Jan 25, 2018 via email

Copy link
Copy Markdown
Member

@jdm

jdm commented Jan 25, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 1fb6ec1 with merge f3c049c...

bors-servo pushed a commit that referenced this pull request Jan 25, 2018
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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jan 25, 2018
@jdm

jdm commented Jan 25, 2018

Copy link
Copy Markdown
Member
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['translate'] = \"100deg\" should not set the property value", "test": "/css/css-transforms/parsing/translate-parsing-invalid.html", "line": 127937, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['translate'] = \"100px 200px 300%\" should not set the property value", "test": "/css/css-transforms/parsing/translate-parsing-invalid.html", "line": 127938, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['translate'] = \"100px 200px calc(30px + 30%)\" should not set the property value", "test": "/css/css-transforms/parsing/translate-parsing-invalid.html", "line": 127939, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['scale'] = \"100px\" should not set the property value", "test": "/css/css-transforms/parsing/scale-parsing-invalid.html", "line": 135858, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['scale'] = \"100 200 300 400\" should not set the property value", "test": "/css/css-transforms/parsing/scale-parsing-invalid.html", "line": 135859, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"100deg\" and \"180deg\" are valid rotate values", "test": "/css/css-transforms/animation/rotate-interpolation.html", "line": 139961, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"45deg\" and \"-1 1 0 60deg\" are valid rotate values", "test": "/css/css-transforms/animation/rotate-interpolation.html", "line": 139968, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"7 -8 9 400grad\" are valid rotate values", "test": "/css/css-transforms/animation/rotate-interpolation.html", "line": 139975, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"none\" are valid rotate values", "test": "/css/css-transforms/animation/rotate-interpolation.html", "line": 139982, "action": "test_result", "expected": "FAIL"}
{"status": "FAIL", "group": "default", "message": "assert_equals: expected \"calc(10px + 10%) calc(20px + 20%) calc(30px + 30em)\" but got \"calc(10% + 10px) calc(20% + 20px) calc(30em + 30px)\"", "stack": "test_valid_value/<@http://web-platform.test:8000/css/css-transforms/parsing/resources/parsing-testcommon.js:19:9\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1494:20\ntest@http://web-platform.test:8000/resources/testharness.js:511:9\ntest_valid_value@http://web-platform.test:8000/css/css-transforms/parsing/resources/parsing-testcommon.js:15:5\n@http://web-platform.test:8000/css/css-transforms/parsing/translate-parsing-valid.html:26:1\n", "subtest": "Serialization should round-trip after setting e.style['translate'] = \"calc(10px + 10%) calc(20px + 20%) calc(30px + 30em)\"", "test": "/css/css-transforms/parsing/translate-parsing-valid.html", "line": 140039, "action": "test_result", "expected": "PASS"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "Serialization should round-trip after setting e.style['translate'] = \"0\"", "test": "/css/css-transforms/parsing/translate-parsing-valid.html", "line": 140041, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "Serialization should round-trip after setting e.style['translate'] = \"1px 2px 0\"", "test": "/css/css-transforms/parsing/translate-parsing-valid.html", "line": 140043, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['rotate'] = \"100px\" should not set the property value", "test": "/css/css-transforms/parsing/rotate-parsing-invalid.html", "line": 143951, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['rotate'] = \"100 400deg\" should not set the property value", "test": "/css/css-transforms/parsing/rotate-parsing-invalid.html", "line": 143952, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['rotate'] = \"100 200 400deg\" should not set the property value", "test": "/css/css-transforms/parsing/rotate-parsing-invalid.html", "line": 143953, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "e.style['rotate'] = \"100 200 300 500 400deg\" should not set the property value", "test": "/css/css-transforms/parsing/rotate-parsing-invalid.html", "line": 143954, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"2 30 400\" and \"10 110 1200\" are valid scale values", "test": "/css/css-transforms/animation/scale-interpolation.html", "line": 149210, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"26 17 9\" and \"2\" are valid scale values", "test": "/css/css-transforms/animation/scale-interpolation.html", "line": 149217, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"4 3 2\" are valid scale values", "test": "/css/css-transforms/animation/scale-interpolation.html", "line": 149224, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"none\" are valid scale values", "test": "/css/css-transforms/animation/scale-interpolation.html", "line": 149231, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"220px 240px 260px\" and \"300px 400px 500px\" are valid translate values", "test": "/css/css-transforms/animation/translate-interpolation.html", "line": 149256, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"480px 400px 320px\" and \"240% 160%\" are valid translate values", "test": "/css/css-transforms/animation/translate-interpolation.html", "line": 149263, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"8px 80% 800px\" are valid translate values", "test": "/css/css-transforms/animation/translate-interpolation.html", "line": 149270, "action": "test_result", "expected": "FAIL"}
{"status": "PASS", "group": "default", "message": null, "stack": null, "subtest": "\"none\" and \"none\" are valid translate values", "test": "/css/css-transforms/animation/translate-interpolation.html", "line": 149277, "action": "test_result", "expected": "FAIL"}

@birtles
birtles force-pushed the individual-transforms branch from 1fb6ec1 to 8711efe Compare January 26, 2018 08:32
@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jan 26, 2018
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Indentation is broken. Spacing is broken.

pub fn set_${ident}(&mut self, other: values::computed::${type}) {
unsafe { self.gecko.${gecko_ffi_name}.clear() };

match other.to_transform_operation() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: if let makes for more readable code here.

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Make this an implementation of Animatable for Quaternion instead of keeping it on MatrixDecomposed3D .


/// <https://drafts.csswg.org/css-transforms/#interpolation-of-transforms>
impl ComputedRotate {
fn fill_unspecified(rotate: &ComputedRotate)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: it's more readable to instead dereference the matched value *translate and not prefix every pattern with &.

@birtles

birtles commented Jan 26, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the review!
Please bear in mind these are not my patches -- I'm just landing them so I can't answer all the questions. I'll make requested changes next week though.

@nox

nox commented Jan 26, 2018

Copy link
Copy Markdown
Contributor

@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.

@birtles

birtles commented Jan 26, 2018 •

Copy link
Copy Markdown
Contributor Author

Thanks! I'll try to get to it. I think there were some test failures that I need to look into anyway.

@highfive highfive assigned emilio and unassigned ghost Jan 31, 2018
@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. S-needs-rebase There are merge conflict errors. labels Jan 31, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4bcf284 with merge 319707a...

bors-servo pushed a commit that referenced this pull request Jan 31, 2018
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 -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel-wpt

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jan 31, 2018
@birtles

birtles commented Jan 31, 2018

Copy link
Copy Markdown
Contributor Author

Oh, I didn't realize the PASSes that @jdm originally quoted were actually failures!
I guess there is an expectations file somewhere I need to update.

@birtles
birtles force-pushed the individual-transforms branch from 4bcf284 to 8a4661b Compare January 31, 2018 22:15
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Jan 31, 2018
@birtles

birtles commented Jan 31, 2018

Copy link
Copy Markdown
Contributor Author

@bors-servo r=emilio

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 8a4661b 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 Jan 31, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 8a4661b with merge 3e27459...

bors-servo pushed a commit that referenced this pull request Jan 31, 2018
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 -->
@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 3e27459 to master...

@bors-servo
bors-servo merged commit 8a4661b into servo:master Jan 31, 2018
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jan 31, 2018
@birtles
birtles deleted the individual-transforms branch February 1, 2018 00:05
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.

6 participants