Skip to content

[css-transforms-2] Serialization of the computed value of translate property. #2124

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
CJKu opened this issue Dec 21, 2017 · 4 comments · Fixed by #6146
Closed

[css-transforms-2] Serialization of the computed value of translate property. #2124

CJKu opened this issue Dec 21, 2017 · 4 comments · Fixed by #6146

Comments

@CJKu
Copy link

CJKu commented Dec 21, 2017

I can not find a definition of serialization of individual transform's computed value in the spec[1]

When serializing a 'translate' property with percentage value, such as 'translate: 50%', should we resolve it to px or keep it unresolved?

PS: Currently, both edge and chromium resolve percentage to px.

[1] https://drafts.csswg.org/css-transforms-2/#individual-transforms

@Nadya678
Copy link

Nadya678 commented Dec 21, 2017

transform:translate(50% 0%) is also by firefox translated to px.

btw. translate:50% and scale:2 2 and other "styles" from transform shall be removed.

Example:

transform:scale(-1) translate(50px,50px);
transform:translate(50px,50px) scale(-1);

THERE ARE TWO DIFFERENT TRANSFORMS. It cannot be separated to scale and translate.
Living demo: https://jsfiddle.net/p7sb1o6h/

The scale, translate, rotate etc. styles (not transforms) shall be removed from all drafts.

@Loirooriol
Copy link
Contributor

@Nadya678 Of course it's not commutative, but it's well-defined if the spec specifies the order, and it does: https://drafts.csswg.org/css-transforms-2/#ctm

I suspect these new properties were added precisely because some people without linear algebra notions assume transform is commutative and then they are confused by the results.

@Nadya678
Copy link

commutative and then they are confused by the results.

But I need the commutative effect. People without knowledge of algebra also doesn't describe the
rotation: 0,1,1,60deg;. The vectors and matrices are "black magic" for them,

For me the hardly is imagine 3D effects. Not by knowledge of algebra - if I calculate, the values are correct but imagine without seeing it. 2D without any problem.

BTW. Shall be rotation instead of rotate and translation instead of translate if you don't use them as values but as properties (a noun).

@css-meeting-bot
Copy link
Member

The Working Group just discussed [css-transforms-2] Serialization of the computed value of `translate` property, and agreed to the following resolutions:

  • RESOLVED: % values of translate are serialized as percent for computed values. Add note making the behavior explicit.
The full IRC log of that discussion <dael> Topic: [css-transforms-2] Serialization of the computed value of `translate` property
<dael> github: https://github.com//issues/2124
<dael> TabAtkins: It's if translate 50% serialized to pixel or %. it depnds on layout info. Has to stay as a % right?
<dael> AmeliaBR: Because % are resolved against transform box which are usually width and height of css box and is more complex for svg
<dael> Rossen_: I'm in favor to keep them as % so we don't rely on layout.
<dael> TabAtkins: And this is by default in the spec [reads]
<dael> Rossen_: So it's editorial making it explicit?
<dael> TabAtkins: At best we could match what translate function says. No need to do anything different.
<dael> AmeliaBR: It's for impl
<dael> ericwilligers: Perhaps it was blink making it absolute for lack of works?
<dael> ??: The FF impl wanted ot align with chromium but I said spec said % so I wanted to clairyf
<dael> ericwilligers: I think we'd got a wpt that says % so we have to fix blink and edge
<dael> Rossen_: % is easier, less work. I'm willing to make that change.
<dael> Rossen_: Is blink okay?
<dael> smfr: Yeah.
<dael> Rossen_: Webkit?
<dael> ericwilligers: I don't think they impl the prop
<dael> Rossen_: objections?
<birtles> s/??/birtles/
<Rossen_> RESOLVED: % values of translate are serialized as percent for computed values. Add note making the behavior explicit.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 10, 2018
The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 11, 2018
The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
aarongable pushed a commit to chromium/chromium that referenced this issue Feb 11, 2018
The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536010}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 11, 2018
The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536010}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Feb 11, 2018
The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536010}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Apr 1, 2018
… computed values, a=testonly

Automatic update from web-platform-testsCSS translate: serialize % as percent for computed values

The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#536010}

wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469
wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 2, 2019
… computed values, a=testonly

Automatic update from web-platform-testsCSS translate: serialize % as percent for computed values

The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligerschromium.org>
Reviewed-by: Fredrik Söderquist <fsopera.com>
Cr-Commit-Position: refs/heads/master{#536010}

wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469
wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469

UltraBlame original commit: e5dba25f95e33d5e559556d78d704c2121141012
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 2, 2019
… computed values, a=testonly

Automatic update from web-platform-testsCSS translate: serialize % as percent for computed values

The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligerschromium.org>
Reviewed-by: Fredrik Söderquist <fsopera.com>
Cr-Commit-Position: refs/heads/master{#536010}

wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469
wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469

UltraBlame original commit: e5dba25f95e33d5e559556d78d704c2121141012
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 2, 2019
… computed values, a=testonly

Automatic update from web-platform-testsCSS translate: serialize % as percent for computed values

The CSS translate property no longer resolves percentages
in getComputedStyle results.

CSS WG Resolution:
RESOLVED: % values of translate are serialized as percent for
computed values. Add note making the behavior explicit.

w3c/csswg-drafts#2124

BUG=811027

Change-Id: I6f9b60c285d1eccc2e13ff0e806794df5cce5151
Reviewed-on: https://chromium-review.googlesource.com/912052
Commit-Queue: Eric Willigers <ericwilligerschromium.org>
Reviewed-by: Fredrik Söderquist <fsopera.com>
Cr-Commit-Position: refs/heads/master{#536010}

wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469
wpt-commits: 9b23a0cbf6476d3f1d0b25b9bda8e5249725b00b
wpt-pr: 9469

UltraBlame original commit: e5dba25f95e33d5e559556d78d704c2121141012
dbaron added a commit to dbaron/csswg-drafts that referenced this issue Mar 25, 2021
…entages.

While the premise of w3c#2124 was that this was not already defined, I
believe this is already the straightforward result of the definition in
cssom-1.  Thus this adds a note rather than additional normative text.

Fixes w3c#2124.
tabatkins pushed a commit that referenced this issue Mar 25, 2021
…entages (#6146)

While the premise of #2124 was that this was not already defined, I
believe this is already the straightforward result of the definition in
cssom-1.  Thus this adds a note rather than additional normative text.

Fixes #2124.
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.

7 participants