Discussion:
[css-logical-props] resolving against parent's writing mode properties
(too old to reply)
Cameron McCormack
2015-01-29 00:09:54 UTC
Permalink
Raw Message
I don’t understand the reasoning behind resolving the margin-* and
padding-* logical properties against the writing mode properties of the
parent, rather than the element itself. Can someone explain, and
perhaps add that explanation to the spec as a note?

Also, the spec should define what happens when you use one of these
logical properties on the root element.
--
Cameron McCormack ≝ http://mcc.id.au/
fantasai
2015-01-30 21:35:27 UTC
Permalink
Raw Message
Post by Cameron McCormack
I don’t understand the reasoning behind resolving the margin-* and
padding-* logical properties against the writing mode properties of the
parent, rather than the element itself. Can someone explain, and
perhaps add that explanation to the spec as a note?
I think Rossen and I were discussing this during a coffee break last year
and concluded to leave them to resolve against the element itself, for
simplicity. I'd start with that as the implementation and think about if
it should be something different.

Ideally, I think you'd want to compute margins and borders against the
containing block, since an English article and a Japanese article in
the exact same location in a layout should have the same margins and
borders; whether you have top/bottom borders or right/left borders
(if you picked only a pair) would usually depend on the context, not
the contents. Certainly the abspos offsets would depend on the context,
not the contents, of the abspos element.

But I'm not sure what's ideal for padding, and containing block relations
are maybe not so clear when you're in the middle of cascading, and it's
probably easier for people to remember to just only check the element's
own properties. It will mean that many use cases will involve wrapper
elements, though.
Post by Cameron McCormack
Also, the spec should define what happens when you use one of these
logical properties on the root element.
The root element propagates direction/writing-mode to the initial
containing block.

~fantasai
Cameron McCormack
2015-01-30 23:15:11 UTC
Permalink
Raw Message
Post by fantasai
Ideally, I think you'd want to compute margins and borders against the
containing block, since an English article and a Japanese article in
the exact same location in a layout should have the same margins and
borders; whether you have top/bottom borders or right/left borders
(if you picked only a pair) would usually depend on the context, not
the contents. Certainly the abspos offsets would depend on the context,
not the contents, of the abspos element.
I also was thinking that it would make more sense – at least for the
offset-* properties, if you’re placing an element in a position:absolute
context – for them to be relative to the containing block.
Post by fantasai
But I'm not sure what's ideal for padding, and containing block relations
are maybe not so clear when you're in the middle of cascading, and it's
probably easier for people to remember to just only check the element's
own properties. It will mean that many use cases will involve wrapper
elements, though.
I agree; let’s leave this simpler rule.
Post by fantasai
Post by Cameron McCormack
Also, the spec should define what happens when you use one of these
logical properties on the root element.
The root element propagates direction/writing-mode to the initial
containing block.
[Moot now, but:] So this means that the root element would end up using
the initial containing block’s writing mode property values to its
logical properties (i.e., it would use the same writing mode values that
are on the root element itself).
--
Cameron McCormack ≝ http://mcc.id.au/
fantasai
2017-06-20 20:33:06 UTC
Permalink
Raw Message
Post by Cameron McCormack
Post by fantasai
Ideally, I think you'd want to compute margins and borders against the
containing block, since an English article and a Japanese article in
the exact same location in a layout should have the same margins and
borders; whether you have top/bottom borders or right/left borders
(if you picked only a pair) would usually depend on the context, not
the contents. Certainly the abspos offsets would depend on the context,
not the contents, of the abspos element.
I also was thinking that it would make more sense – at least for the
offset-* properties, if you’re placing an element in a position:absolute
context – for them to be relative to the containing block.
Post by fantasai
But I'm not sure what's ideal for padding, and containing block relations
are maybe not so clear when you're in the middle of cascading, and it's
probably easier for people to remember to just only check the element's
own properties. It will mean that many use cases will involve wrapper
elements, though.
I agree; let’s leave this simpler rule.
Post by fantasai
Post by Cameron McCormack
Also, the spec should define what happens when you use one of these
logical properties on the root element.
The root element propagates direction/writing-mode to the initial
containing block.
[Moot now, but:] So this means that the root element would end up using
the initial containing block’s writing mode property values to its
logical properties (i.e., it would use the same writing mode values that
are on the root element itself).
Just to follow up, there was another thread from zcorpan here:
https://lists.w3.org/Archives/Public/www-style/2016May/0098.html
which resulted in the following CSSWG resolution to map only using
the element's own writing mode (as in this thread, above):
https://lists.w3.org/Archives/Public/www-style/2016Jun/0019.html
(A key argument was that this is how lists behave today in the default
UA style sheet.) This is now folded into the spec.

~fantasai

Loading...