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

Stylo - support image-orientation property #16334

Merged
merged 2 commits into from Apr 11, 2017

Conversation

@chenpighead
Copy link
Contributor

chenpighead commented Apr 10, 2017

First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once w3c/csswg-drafts#1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (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 Apr 10, 2017

Heads up! This PR modifies the following files:

  • @bholley: components/style/properties/gecko.mako.rs, components/style/properties/longhand/box.mako.rs, components/style/values/specified/mod.rs, components/style/properties/longhand/inherited_box.mako.rs
  • @emilio: components/style/properties/gecko.mako.rs, components/style/properties/longhand/box.mako.rs, components/style/values/specified/mod.rs, components/style/properties/longhand/inherited_box.mako.rs
@highfive
Copy link

highfive commented Apr 10, 2017

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify style code, but no tests are modified. Please consider adding a test!
@chenpighead chenpighead force-pushed the chenpighead:stylo-image-orientation-support branch from 354e3e5 to e554254 Apr 10, 2017
@wafflespeanut
Copy link
Member

wafflespeanut commented Apr 10, 2017

Unit tests need to be updated. Oh, you just did 😄

@chenpighead
Copy link
Contributor Author

chenpighead commented Apr 10, 2017

Yeah, just noticed that and updated the PR.
I wonder why this only happens on Windows....

@wafflespeanut
Copy link
Member

wafflespeanut commented Apr 10, 2017

Oh, we've disabled some stuff in Travis since it has previously caused problems (#15076, #14723)

@emilio
Copy link
Member

emilio commented Apr 11, 2017

@bors-servo r+

Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

📌 Commit e554254 has been approved by emilio

}
}

pub fn copy_image_orientation_from(&mut self, other: &Self) {

This comment has been minimized.

@nox

nox Apr 11, 2017

Member

This would be better as Clone::clone_from, IMO. Nevermind.

This comment has been minimized.

@emilio

emilio Apr 11, 2017

Member

We'd need to change all the implementations in the style system though.

This comment has been minimized.

@emilio

emilio Apr 11, 2017

Member

And this only copies a property, which isn't what that trait is meant to represent, right?

This comment has been minimized.

@nox

nox Apr 11, 2017

Member

Err yes, forgot on which type this method is, with the mako stuff. :)

This comment has been minimized.

@chenpighead

chenpighead Apr 11, 2017

Author Contributor

No idea what Clone::clone_from is...
Is this related to the clone_xxx_from()? I thought we need clone only for animatable properties, no?

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

Testing commit e554254 with merge a3bcbb7...

bors-servo added a commit that referenced this pull request Apr 11, 2017
…=emilio

Stylo - support image-orientation property

First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once w3c/csswg-drafts#1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

bors-servo commented Apr 11, 2017

💔 Test failed - windows-msvc-dev

@bholley
Copy link
Contributor

bholley commented Apr 11, 2017

Needs a bindings.rs update. You can grab them as an artifact from your try push.

@chenpighead
Copy link
Contributor Author

chenpighead commented Apr 11, 2017

Ok, I grab the bindings update from try. Hopefully we could pass the tests now.
@bholley, thanks for the help. :)

@bholley
Copy link
Contributor

bholley commented Apr 11, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

📌 Commit 9a1a9d8 has been approved by bholley

@highfive highfive assigned bholley and unassigned emilio Apr 11, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

Testing commit 9a1a9d8 with merge 9d8f120...

@nox
Copy link
Member

nox commented Apr 11, 2017

These 2 commits should be squashed together.

@nox
Copy link
Member

nox commented Apr 11, 2017

Actually no, but the commit that updates the bindings should be first in the PR.

chenpighead added 2 commits Apr 11, 2017
First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once w3c/csswg-drafts#1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758
@chenpighead
Copy link
Contributor Author

chenpighead commented Apr 11, 2017

Ok, update on the way.

@chenpighead chenpighead force-pushed the chenpighead:stylo-image-orientation-support branch from 9a1a9d8 to 5332d4b Apr 11, 2017
@nox
Copy link
Member

nox commented Apr 11, 2017

@bors-servo r=bholley

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

📌 Commit 5332d4b has been approved by bholley

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

Testing commit 5332d4b with merge fcce57f...

bors-servo added a commit that referenced this pull request Apr 11, 2017
…=bholley

Stylo - support image-orientation property

First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once w3c/csswg-drafts#1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

bors-servo commented Apr 11, 2017

💔 Test failed - linux-rel-css

@chenpighead
Copy link
Contributor Author

chenpighead commented Apr 11, 2017

Looks like just a timeout thing....:/
@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

@chenpighead: 🔑 Insufficient privileges: and not in try users

@nox
Copy link
Member

nox commented Apr 11, 2017

@chenpighead What is "a timeout thing"? We usually don't retry PR without filing an intermittent issue for the failing tests, if we consider them intermittent.

@emilio
Copy link
Member

emilio commented Apr 11, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 11, 2017

Testing commit 5332d4b with merge 2544c08...

bors-servo added a commit that referenced this pull request Apr 11, 2017
…=bholley

Stylo - support image-orientation property

First, we need to make Servo's image-orientation parser to be agreed with Gecko's.
Numbers without any AngleUnit, including unitless 0 angle, should be invalid
for image-orientation. However, rotate() and skew() for transform properties
accept unitless 0 angle. In order to make all these properties work properly,
I fixed Angle::parse() to match Gecko. For the existing users of Angle::parse(),
I create Angle::parse_with_unitless() and use it as an alternative for them.
Once w3c/csswg-drafts#1162 is resolved, we shall be
able to use an unified version of Angle::parse() then.

The parser of image-orientation is also fixed to report parsing errors on
empty string.

Then, with the newly added binding functions support in Gecko side, we shall
reuse the same methods from Gecko to pass the computed value from Servo to Gecko.

Gecko bug: Bug 1341758

<!-- Please describe your changes on the following line: -->

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

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

bors-servo commented Apr 11, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: bholley
Pushing 2544c08 to master...

@bors-servo bors-servo merged commit 5332d4b into servo:master Apr 11, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
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.

None yet

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