W3C home > Mailing lists > Public > www-style@w3.org > April 2009

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

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Sun, 12 Apr 2009 10:35:48 +0200
Message-ID: <C8990E9217DD44D19D0BF0986CC7AB6D@FREMYCOMPANY>
To: "Giovanni Campagna" <scampa.giovanni@gmail.com>, "CSS 3 W3C Group" <www-style@w3.org>
::outside can be useful in other case that you
don't have mentioned.

You look at ::outside only from the border/margin
point of view, but it can have many other useful
things.

With ::outside, you can perform a break outside the
element (useful if you want to have an element on a
new line but doesn't contains the line break).

* First sample :
    <myElem>Hello</myElem>
    myElem::outside::before { content: '\A'; }

Is rendered like :
    <br/><myElem>Hello</myElem>

* Second sample :
    <myElem>Hello</myElem>
    myElem::before { content: '\A'; }

Is rendered like :
    <myElem><br/>Hello</myElem>

* Last sample :
    <myElem>Hello</myElem>
    myElem::inside::before { content: '\A'; }

Is rendered like :
    <myElem><br/>Hello</myElem>

If you have something like that :

    <box display-model="ab">
        <div display-role="a"></div>
        <div display-role="b"></div>
    </box>

And a CSS like that :
    div[display-role="a"]::outside {
        margin: 10px;
    }

It's rendered the same way as :

    <box display-model="ab">
        <div display="block"><div display-role="a"></div></div>
        <div display-role="b"></div>
    </box>

The display role of the 'inner' div is no more applyable (I think), so it's 
not in the display-model of the box element.
But it seems the spec of display-model is unclear about how the UA must 
react if an element in a display-model'ed
element contains elements that does'nt enter in the model. But it's not a 
problem of '::outside'.

Regards,
Fremy

--------------------------------------------------
From: "Giovanni Campagna" <scampa.giovanni@gmail.com>
Sent: Saturday, April 11, 2009 7:39 PM
To: "www-style" <www-style@w3.org>
Subject: [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 Sunday, 12 April 2009 08:36:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT