Re: [css3-page] empty margin boxes

On 08/10/2010 04:32 AM, Håkon Wium Lie wrote:
> I have a use case for margin boxes that I'd like to ensure is
> supported.
>
> In the top-center margin box, I'd like to have the page number with a
> line underneath it. E.g.:
>
>
>                                   46
>                                 ______
>
> To achieve this, I'm using this code:
>
>    @page {
>      @top-center {
>        content: counter(page);
>        width: 4em;
>        border-bottom: thin solid black;
>      }
>    }

That should work.

> However, one reading of the spec is that the width is not honored. In
> 6.2 [1] one reads:
>
>    "A margin box is instantiated if and only if the computed value of
>    its 'content' property does not match that of its initial value."
>
>    [1] http://dev.w3.org/csswg/css3-page/#populating-margin-boxes
>
> A non-instatiated box cannot have widths, borders, margins, right?
>
> But, in 6.3.2 one reads:
>
>    If a box is empty and its computed width is ‘auto’, then the used
>    values of its left and right padding width and left and right border
>    width are all 0.
>
> which seems to indicate that the box is there, albeit invisible.

It says "If a box is empty", and in this case, it's not empty.

> I do think the draft should be changed to not talk about boxes being
> "instantiated". Instead, we can think of them as being there, but
> invisible in most cases.

I think the intention is to treat them like :before/:after -- they
exist if they have content != none.

~fantasai

Received on Tuesday, 12 June 2012 01:53:23 UTC