- elem.style.WebKitTransform
It is difficult to tell from reading the spec why the browser implementations behave the way the do. Outside of the standards process, human decisions around not supporting unstandardized browser functionality and behavior drove the usage of -webkit-* and -moz-*. digging through the mailing lists will no doubt turn up the exact reasons.
For now, the techical reasons are found in code.
In Gecko there is a CSS property alias for WebkitTransform here: http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSPropAliasList.h#234
- elem.style[-webkit-transform]
A reference to -moz-transform is in a list of CSS properties (-webkit-transform is not included), here: http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSPropList.h#4207 but alas, not corresponding -webkit-transform.
I would love to know exactly why - not the "techical why" but I fear this will take too much of my day away.
- Here is the changeset for WebKit supporting un-prefixed transform: https://trac.webkit.org/changeset/181832
- Bug: https://bugs.webkit.org/show_bug.cgi?id=142927
Naturally, the original implementation was probably completed before the spec was adopted by vendors. The latest W3C spec appears to still be A working draft. Whuck?
- I remember when Henri posted this, it was widely discussed: https://hsivonen.fi/vendor-prefixes/
- Inside of this thread[1] it would seem that unprefixing has been discussed for some time, but due to the spec being in WD form, no one wanted to for the longest time, sigh.
- [1] http://lists.w3.org/Archives/Public/www-style/2011Nov/0322.html
- w3c spec: https://www.w3.org/TR/css-transforms-1/#transform-property
- whatwg references w3c spec: https://compat.spec.whatwg.org/#-webkit-transform
It looks like Mozilla did some research into prefixes to help determine which -webkit prefixixes might warrant support. transform is talked about a lot here: https://bugzilla.mozilla.org/show_bug.cgi?id=708406#c6 It would seem that getting it unprefixed was the goal, however, I am unsure what the final result was - at that time. A few questions for dbaron or jet might help me understand better.
But
elem.style[-moz-transform]
doesn't work either. So it's not really a question of aliases, but more about why a CSSStyleDeclaration setter works for one form and not the other.The "technical" why this doesn't work is found here: http://mxr.mozilla.org/mozilla-central/source/dom/bindings/GenerateCSS2PropertiesWebIDL.py#36
The "spec" why is https://www.w3.org/Bugs/Public/show_bug.cgi?id=29440, in that it's not actually (unabiguously) defined in the CSSOM spec yet. But Chrome and Edge support that... just because?
https://bugzilla.mozilla.org/show_bug.cgi?id=1246796 has some more context and webcompat/web-bugs#1039 (comment) is the original bug that inspired this exercise. ^_^