[css3-content] Replacing ::outside with ::inside

-- background --
This proposal crossed my mind while talking with Tab Atkins about
::slot in Template Layout. He wanted to allow margins, and to make
those margins not collapse (sort of "box-sizing:margin-box"). I didn't
like the idea, but I did think that allowing some space between
adjacient slots and their borders may be useful. But I thought that
this kind of space is not a margin, but rather a padding (because it
is all around the box and doesn't collapse).
Ok then, how to specify an external padding? You need two boxes, one
inside the other.
I said to myself: I need the Generated Content features... but what
does ::slot()::outside mean? How shall I specify "display:slot"?
This didn't look very good to me

-- the current situation --
The Generated and Replaced Content Module introduces the ::outside
pseudo-elements, which wraps its superior parent and all its (in flow)
content. This pseudo-element is not implemented in any UA I tested. In
addition, it creates a lot of difficulty on the author side, because
the wrapping generated box still inherits (like every other
pseudo-element) from its superior parent.

-- my proposal --
Drop ::outside.
Add ::inside, a pseudo-element wrapping all superior parent's content
(but not ::before, ::after, ::alternate or other pseudo-elements). All
properties apply to this pseudo-element (but their meaning is changed,
because it is inside its superior parent like a nested <div>)
This way, to add multiple borders to an element, you say:
.multiple {
border:1px solid yellow;
}
.multiple::inside {
border:1px solid blue;
}
.multiple::inside::inside {
border:1px solid red;
}

We may introduce the syntax shorthand "::inside(n)".
Not generated ::inside elements are removed, ie if ::inside::inside is
never referenced, ::inside::inside::inside is the same as
::inside::inside.

-- use cases --
All of ::outside, plus those case when an appropriate ::outside is not
available, like for example ::slot.

Giovanni

Received on Saturday, 11 April 2009 17:39:39 UTC