You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[css-logical-1] Order of inheritance vs. mapping in logical properties #3029
It's clear that margin-right inherits 20px from the computed margin-right value on the parent. What about margin-inline-start, though? Does it inherit 10px or 20px?
In other words, does inherit inherit the computed physical value from the parent (always), or does it inherit from whichever of physical or logical was specified?
I would hope, at least, that those two examples produce the same results (respectively) as these two:
since the outer div always has the same computed values for all properties (the difference in that in these last two, it got those values through logical properties rather than physical ones).
I would hope, at least, that those two examples produce the same results (respectively) as these two.
Yes, they would have to: inheritance uses the parent’s computed value, and pairs of corresponding logical/physical properties are required to have the same computed value.
What about margin-inline-start, though? Does it inherit 10px or 20px?
Chromium, WebKit and Firefox are interoperable, it inherits 10px. So if margin-inline-start resolves to margin-left, it inherits the margin-left of the parent, even if that's the margin-inline-end of the parent.
fwiw, last Friday i had created about 100 tests for css-logical, including the various directional permutations. It's geek week now, so i may upload the tests with results this week, or it may have to wait until next week. I might be able to add a test for this scenario, too.
The results are indeed interoperable across Firefox, Chrome, and Safari browsers.
However, i wrote the assertions following the logic that seemed sensible to me: that is that the margin-inline-start for a LTR block (ie. on the left) would inherit the value for the margin on the right (ie. at the start) of a parent RTL block. Under that criterion, all the tests fail.
It seems somewhat illogical, as it were, that what is being inherited by a logical value is not the start (ie. logical) value of the parent. It would mean that a content author has to do some mental gymnastics to decide whether or not to use inherit explicitly.
So these are the two operations under considerations:
Blue Line: Child’s margin-inline-start maps to margin-right which then inherits from parent’s margin-right (which is the parent’s margin-inline-end). This is what browsers currently do.
Red Line: Child’s margin-inline-start (which is the child’s margin-right) inherits from parent’s margin-inline-start (which is matched with parent’s margin-left). This is what @r12a expects.
Keep in mind that properties are first cascaded (all together, logical and physical mixed and mapped by writing mode, latest declaration of a conflicting set winning), and then computed (which causes each matching pair to share a single computed value).
Well, margin already exists. When not including the non-stable logical keyword, should it only expand to the physical properties only, or should it also reset the logical ones beforehand? From @fantasai's explanation the spec seems to want the latter, but I'm not sure if this is web compatible.
The CSS Working Group just discussed [css-logical-1] Order of inheritance vs. mapping in logical properties, and agreed to the following:
RESOLVED: specify inheritance works on physical properties
The full IRC log of that discussion
<iank_> yeah https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=14309 looks broken on FF.
<noamr> oriol: we resolved on this 5 years ago. when you have an inherit on a logic property, it would inherit from the same logical property, even if the physical mode is different
<emilio> q+
<noamr> oriol: no browser is doing this. everyone resolves logical to physical first and only then applies inheritance
<noamr> ack kizu
<astearns> ack kizu
<astearns> ack fantasai
<kbabbitt> q+
<astearns> ack emilio
<noamr> fantasai: I can see the argument. I also think it was the right behavior to do. the properties that this affect are not inherited property. not a lot of people do this. I am somewhat inclined to leave current resolution
<noamr> emilio: strong disagree. it's weird that some css wide keywords you affect some properties but not others
<noamr> emilio: in implementations conversion to physical happens before inheritence
<noamr> emilio: I don't see this as being terribly useful
<astearns> ack kbabbitt
<noamr> emilio: not sure it's worth it
<noamr> kbabbitt: agree with emilio. the resolution was sitting for 5 years. there is additional compat risk. lets spec the current behavior
<noamr> fantasai: ok if we are going with that direction
<noamr> q+
<astearns> ack noamr
<fantasai> fantasai: but disagree there's a compat risk
<fantasai> fantasai: super unlikely to use inherit in a logical property across direction changes even if usage was 90%
<fantasai> noamr: logical properties are complicated enough already, let's keep it simple
<noamr> PROPOSED RESOLUTION: specify inheritance works on physical properties
<florian> q?
<noamr> emilio: if this affected inherited properties the inherited one would be the physical one
<fantasai> PROPOSED: Logical properties inherit from the parent using physical correspondance
<noamr> florian: how mad are i18n going to be on this
<noamr> fantasai: not a big deal I think? you can also, depending on what you're doing, you *want* the physical prop
<noamr> astearns: let's resolve and find out
<noamr> RESOLVED: specify inheritance works on physical properties
Activity
dbaron commentedon Aug 17, 2018
It might even be clearer with the following two slightly simpler examples:
In other words, does
inheritinherit the computed physical value from the parent (always), or does it inherit from whichever of physical or logical was specified?I would hope, at least, that those two examples produce the same results (respectively) as these two:
since the outer
divalways has the same computed values for all properties (the difference in that in these last two, it got those values through logical properties rather than physical ones).fantasai commentedon Aug 18, 2018
Just wanted to note here that the possible solutions to #3030 depend on what happens here.
fantasai commentedon Aug 18, 2018
Yes, they would have to: inheritance uses the parent’s computed value, and pairs of corresponding logical/physical properties are required to have the same computed value.
Loirooriol commentedon Sep 15, 2020
Chromium, WebKit and Firefox are interoperable, it inherits 10px. So if
margin-inline-startresolves tomargin-left, it inherits themargin-leftof the parent, even if that's themargin-inline-endof the parent.fantasai commentedon Sep 15, 2020
@Loirooriol Thanks! We should probably check with i18n that it's acceptable behavior, but as long as it is, speccing interop sounds reasonable to me.
r12a commentedon Sep 15, 2020
fwiw, last Friday i had created about 100 tests for css-logical, including the various directional permutations. It's geek week now, so i may upload the tests with results this week, or it may have to wait until next week. I might be able to add a test for this scenario, too.
r12a commentedon Sep 30, 2020
So the main body of tests and results is at https://w3c.github.io/i18n-tests/results/css-logical
I didn't yet integrate the tests for inheritance into that page, because i'm not sure about the result. You can find 2 tests at
The results are indeed interoperable across Firefox, Chrome, and Safari browsers.
However, i wrote the assertions following the logic that seemed sensible to me: that is that the margin-inline-start for a LTR block (ie. on the left) would inherit the value for the margin on the right (ie. at the start) of a parent RTL block. Under that criterion, all the tests fail.
It seems somewhat illogical, as it were, that what is being inherited by a logical value is not the start (ie. logical) value of the parent. It would mean that a content author has to do some mental gymnastics to decide whether or not to use inherit explicitly.
astearns commentedon Oct 19, 2020
@r12a would you be available for any of our remaining meetings this week to discuss this issue?
https://wiki.csswg.org/planning/tpac-2020#schedule
fantasai commentedon Oct 20, 2020
So these are the two operations under considerations:
margin-inline-startmaps tomargin-rightwhich then inherits from parent’smargin-right(which is the parent’smargin-inline-end). This is what browsers currently do.margin-inline-start(which is the child’smargin-right) inherits from parent’smargin-inline-start(which is matched with parent’smargin-left). This is what @r12a expects.Keep in mind that properties are first cascaded (all together, logical and physical mixed and mapped by writing mode, latest declaration of a conflicting set winning), and then computed (which causes each matching pair to share a single computed value).
14 remaining items
FremyCompany commentedon Oct 30, 2020
My understanding is 4, the logical properties only. But this is understable since such property doesn't exist yet...
Loirooriol commentedon Oct 30, 2020
Well,
marginalready exists. When not including the non-stablelogicalkeyword, should it only expand to the physical properties only, or should it also reset the logical ones beforehand? From @fantasai's explanation the spec seems to want the latter, but I'm not sure if this is web compatible.Loirooriol commentedon Jul 26, 2025
5 years later, nobody has implemented this resolution, and I'm not sure it would even be web compatible at this point.
Agenda+ to re-evaluate.
css-meeting-bot commentedon Nov 14, 2025
The CSS Working Group just discussed
[css-logical-1] Order of inheritance vs. mapping in logical properties, and agreed to the following:RESOLVED: specify inheritance works on physical propertiesThe full IRC log of that discussion
<iank_> yeah https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=14309 looks broken on FF.<noamr> oriol: we resolved on this 5 years ago. when you have an inherit on a logic property, it would inherit from the same logical property, even if the physical mode is different
<emilio> q+
<noamr> oriol: no browser is doing this. everyone resolves logical to physical first and only then applies inheritance
<noamr> ack kizu
<astearns> ack kizu
<astearns> ack fantasai
<kbabbitt> q+
<astearns> ack emilio
<noamr> fantasai: I can see the argument. I also think it was the right behavior to do. the properties that this affect are not inherited property. not a lot of people do this. I am somewhat inclined to leave current resolution
<noamr> emilio: strong disagree. it's weird that some css wide keywords you affect some properties but not others
<noamr> emilio: in implementations conversion to physical happens before inheritence
<noamr> emilio: I don't see this as being terribly useful
<astearns> ack kbabbitt
<noamr> emilio: not sure it's worth it
<noamr> kbabbitt: agree with emilio. the resolution was sitting for 5 years. there is additional compat risk. lets spec the current behavior
<noamr> fantasai: ok if we are going with that direction
<noamr> q+
<astearns> ack noamr
<fantasai> fantasai: but disagree there's a compat risk
<fantasai> fantasai: super unlikely to use inherit in a logical property across direction changes even if usage was 90%
<fantasai> noamr: logical properties are complicated enough already, let's keep it simple
<noamr> PROPOSED RESOLUTION: specify inheritance works on physical properties
<florian> q?
<noamr> emilio: if this affected inherited properties the inherited one would be the physical one
<fantasai> PROPOSED: Logical properties inherit from the parent using physical correspondance
<noamr> florian: how mad are i18n going to be on this
<noamr> fantasai: not a big deal I think? you can also, depending on what you're doing, you *want* the physical prop
<noamr> astearns: let's resolve and find out
<noamr> RESOLVED: specify inheritance works on physical properties