Re: Generated content

Ian Hickson wrote:
> On Wed, 26 Jan 2000, Matthew Brealey wrote:
> > This fails to define the rendering of
> >    P.note:before { content: "Note: "; display: block; }
> >    P.note        { border: solid green }
> > - does the border cover the block before.
> >
> > The spec does not say whether it does. Clearly the best answer is
> > no, [...]
> 
> (Clearly?)
> 
> The answer is actually yes. 
Spec reference please - I don't think it is possible to say for certain
either way.

> In the case above, you get pseudo markup
> equivalent to:
> 
>    <p>
>       <p:before>
>          <anonymous-inline>Note: </anonymous-inline>
>       </p:before>
>       <anonymous-block>
>          <anonymous-inline>....</anonymous-inline>
>       </anonymous-block>
>    </p>
> 
> Thus the border surrounds the :before as well as the element's 'real'
> content.
The reason I think you are wrong is because given
P.note:before { content: "Note: "; display: marker}
P.note        { border: solid green }

the border doesn't cover the marker box (the spec is very explicit on
this), so there is certainly is an indication that this result is
possible at least for some generated content.

In addition, it tends to give better results - you cannot set the
margins of the anonymous block with the interpretation that you take. 

Some normative statement would be nice though...

Received on Monday, 31 January 2000 07:59:15 UTC