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

2009/4/12 François REMY <fremycompany_pub@yahoo.fr>:
> From: "Giovanni Campagna" <scampa.giovanni@gmail.com>
>>
>> 2009/4/12 François REMY <fremycompany_pub@yahoo.fr>:
>
> [...]
>
>>>
>>> Using myElem#specialItem::inside will result in two lines of 7pt, where
>>> with
>>> ::outside, it's the
>>> size of the font outside of the element (may be 12pt).
>>>
>>> If I want the font-size of 'outside' the myElem, how can I do with
>>> ::inside
>>> ?
>>
>> You forgot two fundamental features of CSS:
>>
>> 1) cascading: if you can locally define myElem#specialItem::inside,
>> you can also define myElem#specialItem { font-size:inherit;
>> line-heigth:inherit; }
>
> Hum, and if I want to apply the 7pt, I need to define another rule for the
> ::inside
>
> So, I need this :
>
> myElem { // Defined globaly
>   font-size: 7pt; line-height: 7pt
> }
>
> myElem#specialItem::before { // Defined localy
>   content: '\A\A';
>   font-size: inherit; line-height: inherit;
> }

not myElem#specialItem::before but myElem::specialItem. Except that, it is fine.

> myElem#specialItem::inside {  // Defined locally
>   font-size: 7pt; line-height: 7pt
> }
>
> And what happens if someone decide to change the 7pt to 8pt later ? Does
> this person
> need to look at every local page if there's no rule that was used to 'hack'
> the ::inside problem ?

myElem::inside cascades with myElem#specialItem::inside. You can
change that if you want.

>> 2) inheritance: line-heigth and font-size are inherited properties,
>> and all pseudo-elements inherit from their superior parent, regardless
>> of where they're placed: so myElem#specialItem::outside gets a
>> line-heigth and a font-size of 7pt
>
> x::outside don't herit of x's properties, because x::outside is the
> ancestror of x.
> It's x that inherits from x::outside. Wrong ?

Yeah. Pseudo-elements, regardless of where they're placed, inherit
from their superior parent.
See css3-content, section 4.3 "One difference between using elements
and using pseudo-elements is that the pseudo-elements inherit from the
elements (or pseudo-elements) that generate them, not from those they
are contained within."

>> Number 2 is the reason I want to change ::outside with ::inside
>>
>>>
>
> [...]
> .
>>
>> It is because of lack of implementation that I would like to change
>> "::outside" with "::inside". I hope that this change will make it
>> easier to implement, and thus more likely to be implemented soon.
>>
>
> Why should this be easier to implement ?

Because you append boxes to the box tree, instead that inserting them
at arbitrary points.

> Regards,
> Fremy
>

Received on Sunday, 12 April 2009 19:39:24 UTC