Skip to content

[css-transforms-2] The reference box for resolving percentage on translate #4193

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

Closed
BorisChiou opened this issue Aug 13, 2019 · 2 comments · Fixed by #4194
Closed

[css-transforms-2] The reference box for resolving percentage on translate #4193

BorisChiou opened this issue Aug 13, 2019 · 2 comments · Fixed by #4194

Comments

@BorisChiou
Copy link
Contributor

BorisChiou commented Aug 13, 2019

Per the spec definition of translate, we resolve its percentage by containing block:

relative to the width of the containing block (for the first value) or the height (for the second value)

Here, we use containing block. However, for transform property, we use its reference box to resolve the percentage:

refer to the size of reference box

The containing block has a special meaning, I think, based on the spec of visual formatting model. It may refer to the content edge or padding edge, based on its position value. I checked the implmentation of Blink and Gecko, and it seems both use transform-box (default: view-box) as the reference box for both transform and translate. So my suggestion is to update how we resolve the percentage for translate. i.e. Use reference box, instead of containing block.

@BorisChiou
Copy link
Contributor Author

cc @tabatkins

@ewilligers
Copy link
Contributor

Thanks for the PR. Yes we should be consistent with transform.

@BorisChiou BorisChiou changed the title [css-transforms-2] the reference box for resolving percentage on translate [css-transforms-2] The reference box for resolving percentage on translate Aug 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants