W3C home > Mailing lists > Public > public-css-archive@w3.org > January 2017

[csswg-drafts] [cssom]getComputedStyle(element) and actual transform functions

From: GibboK via GitHub <sysbot+gh@w3.org>
Date: Thu, 12 Jan 2017 09:01:18 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-200310669-1484211677-sysbot+gh@w3.org>
gibbok has just created a new issue for 
https://github.com/w3c/csswg-drafts:

== [cssom]getComputedStyle(element) and actual transform functions ==
I would like to suggest having `getComputedStyle(element).transform` 
function returning the actual transform functions and serialized 
matrix instead serialized matrix only.

Or alternative having a new function returning the actual transform 
functions.

Example:
https://jsfiddle.net/gibbok/pruyh2ns/

````html
<div id="target"></div>
````
````css
div {
  transform: translate(0, 0) rotate(45deg);
  width: 50px;
  height:100px;
  background-color:red;
}
````
````js
var elem1 = document.getElementById("target");
var style = window.getComputedStyle(elem1, null);
console.log(style.transform);
// now returns matrix(0.707107, 0.707107, -0.707107, 0.707107, 0, 0)
// would be interesting having also the actual transform functions 
returned as translate(0, 0) rotate(45deg)
````

Related documentation:
https://drafts.csswg.org/css-transforms/#serialization-of-the-computed-value

Others:
https://bugs.chromium.org/p/chromium/issues/detail?id=680111


Please view or discuss this issue at 
https://github.com/w3c/csswg-drafts/issues/891 using your GitHub 
account
Received on Thursday, 12 January 2017 09:01:24 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:28 UTC