W3C home > Mailing lists > Public > www-style@w3.org > November 2016

[css-logical-props] self vs ancestor. (Wrong solution ?)

From: Peter Moulder <pjrm@mail.internode.on.net>
Date: Wed, 9 Nov 2016 07:26:34 +1100
To: www-style@w3.org
Message-ID: <20161108202634.GA7235@mail.internode.on.net>
Consider the following document:

  <body>
    horizontal parent
    <div style="writing-mode:vertical-rl; float:inline-end">
     vertical float
    </div>
  <body>

According to the current spec, float:inline-end here means float:bottom.
Which doesn't make sense here, because it participates in a horizontal BFC.

To serve their intended purpose in this example, logical directions for
'float' would need to be defined wrt some box guaranteed to have the same
'writing-mode' dimension as the BFC in which the float participates, such
as the containing block.  Similarly for 'clear'.  (Whereas logical
directions for 'text-align' need to continue to be defined wrt self, for
similar reasons.)

However, once one does that, how does one add a margin between the float
and the shortened line boxes?  The obvious answer would be:

  margin-inline-start: 1em

until one realizes that here again, we want "inline-start" to be
interpreted relative to the same box as used for 'float', rather
than relative to itself.

Indeed, it seems like containing block would be the right choice for
most uses of logical margin properties.

Cf the approach described in css-writing-modes:

  # [...] calculating the width and height of the box [...] are performed
  # accordingly using the writing mode of the box [...]
  #
  # [...] calculating the positioning offsets, margins, borders, and
  # padding [...] are performed according to the writing mode of the
  # containing block of the box [...]

That would certainly be one model to consider copying when deciding which
properties mentioned in css-logical-props should be defined according to
self and which go by containing block.  (It's certainly not the only option
to consider, and I'd be concerned that this one would do the wrong thing
for padding in particular.)

However, I'm concerned that merely making a choice for each property as to
whether logical directions refer to self or containing block would leave us
with some degree of unpredictabilitity to authors, and/or that there would
be significant use cases that would want a different choice of referent
from what we choose.  I lack authoring experience; what do others think?

pjrm.
Received on Tuesday, 8 November 2016 20:27:31 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 8 November 2016 20:27:32 UTC