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

Support parsing moz-specific matrix functions in prefixed transform property #16003

Closed
upsuper opened this issue Mar 17, 2017 · 0 comments
Closed
Assignees
Labels

Comments

@upsuper
Copy link
Member

@upsuper upsuper commented Mar 17, 2017

Gecko supports a different syntax for matrix and matrix3d function in -moz-transform property. Specifically, when the property is prefixed, it accepts <length> in addition to <number> for transition parts of the matrix functions.

That says, this kind of syntax are valid for -moz-transform:

-moz-transform: matrix(1 0 0 1 5px -5px);
-moz-transform: matrix2d(1 0 0 0
                         0 1 0 0
                         0 0 1 0
                         1px 2px 3px 1);

while in transform, only <number>s are allowed.

@upsuper upsuper added the A-stylo label Mar 17, 2017
@canova canova mentioned this issue Apr 2, 2017
3 of 3 tasks complete
@canova canova self-assigned this Apr 2, 2017
bors-servo added a commit that referenced this issue Apr 19, 2017
stylo: Implement -moz-transform property

-moz-transform property is an alias shorthand property. It has transform as sub-property but their parsing is different in some cases(matrix/matrix3d). -moz-transform also accepts LengthOrPercentage in the nondiagonal homogeneous components of matrix and matrix3d.

It looks like length and percentage values are getting computed to number directly. For example 120px converts into 120 and calc(120px + 20%) converts into 140. So I did like this. But we need to check this behavior again to be sure, I guess.

Also I spent half day investigating why matrices are not serializing after this change and found out their ToCss functions is not completely implemented yet 😄 I was going to implement them but there is an easy issue about it(#15194) so I left it that way. Probably all tests won't pass without it.

---
<!-- 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 #16003 and [Bug 1351356](https://bugzilla.mozilla.org/show_bug.cgi?id=1351356)

<!-- 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/16231)
<!-- Reviewable:end -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

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