Discussion:
[css-logical-props] logical property values on computed style objects
(too old to reply)
Cameron McCormack
2014-12-31 01:13:47 UTC
Permalink
Raw Message
The spec should talk about how logical properties are exposed on
computed style objects. I think it would make sense to expose their
logical values based on the direction/text-orientation/writing-mode
values, for example:

<style>
div { direction: rtl; margin-right: 10px; }
</style>
<div></div>
<script>
var cs = getComputedStyle(document.querySelector("div"));
alert(cs.getPropertyValue("margin-inline-start")); // "10px"
</script>
fantasai
2017-06-20 19:56:52 UTC
Permalink
Raw Message
The spec should talk about how logical properties are exposed on computed style objects. I think it would make sense to
<style>
div { direction: rtl; margin-right: 10px; }
</style>
<div></div>
<script>
var cs = getComputedStyle(document.querySelector("div"));
alert(cs.getPropertyValue("margin-inline-start")); // "10px"
</script>
Hi Cameron!
The CSSWG resolved to do as you recommended:
https://lists.w3.org/Archives/Public/www-style/2017Feb/0060.html
The prose is here:
https://www.w3.org/TR/css-logical-1/#box
# APIs that return computed values (such as getComputedStyle()) must
# return the same value for equivalent pairs of such properties.

Please let me know if this adequately addresses the issue.

Thanks~
~fantasai
Philip Taylor (RHBNC)
2017-06-20 20:07:31 UTC
Permalink
Raw Message
Post by fantasai
https://www.w3.org/TR/css-logical-1/#box
"discussiona" is probably a typo. in " see for example this discussiona
<https://www.w3.org/mid/***@mail.internode.on.net>"

Philip Taylor
fantasai
2017-06-20 21:31:34 UTC
Permalink
Raw Message
Post by Philip Taylor (RHBNC)
Post by fantasai
https://www.w3.org/TR/css-logical-1/#box
"discussiona" is probably a typo. in " see for example this discussiona
Fixed.

~fantasai
Cameron McCormack
2017-06-21 02:15:35 UTC
Permalink
Raw Message
Post by fantasai
https://www.w3.org/TR/css-logical-1/#box
# APIs that return computed values (such as getComputedStyle()) must
# return the same value for equivalent pairs of such properties.
Please let me know if this adequately addresses the issue.
I think my original comment was asking that it be clear whether logical
properties are exposed on computed style objects at all, but probably
that's more of a question for CSSOM. The added sentence does imply that
they are though, so this does address the issue, thank you. (Although
the CSSOM spec link at the start of the sentence appears to be broken.)
Loading...