W3C home > Mailing lists > Public > www-style@w3.org > March 2013

Re: [css3-page] Idea for simplier page-margin boxes

From: Robert O'Callahan <robert@ocallahan.org>
Date: Mon, 25 Mar 2013 16:15:06 +1300
Message-ID: <CAOp6jLbyrnGTLHPGvZNmcbSOd9iZjQjafBATdgB8M=d7RAokEw@mail.gmail.com>
To: Håkon Wium Lie <howcome@opera.com>
Cc: Simon Sapin <simon.sapin@exyr.org>, Julian Viereck <julian.viereck@googlemail.com>, www-style@w3.org
On Mon, Mar 25, 2013 at 12:13 PM, Håkon Wium Lie <howcome@opera.com> wrote:

> How would one achieve the same in Julian's proposal [2]? I guess you
> would write something like this -- let's call it example 2:
>
>   @page { margin: 8% }
>   div.title { position: pagebox;
>      left: 12%; right: 12%; top: 3%;
>      content: string(chapter) }
>   @page :left { position: pagebox:
>      left: 8%; right: 88%; top: 3%;
>      text-align: left;
>      content: counter(page) }
>
  @page :right { position: pagebox:
>      left: 88%; right: 8%; top: 3%;
>      text-align: right;
>      content: counter(page) }
>

I believe this would be more like
@page :left div.pagenum { position: pagebox:
     left: 8%; top: 3%;
     content: counter(page) }
@page :right div.pagenum { position: pagebox:
     right: 8%; top: 3%;
     content: counter(page) }
Using positioning, you can get rid of the need to set text-align.

Using abspos also creates some dependencies. In the code above, I'm
> guessing that the page number will fit in a box with a with of 4%
> (100-88-8). For page numbers, that's a reasonable guess. For other
> types of content, using abspos may cause overflow/overlap.
>

CSS3 Paged Media solves this by introducing what is really a new layout
model just for margin boxes. That is not simple. We propose to render
actual elements in the margin boxes, so one could use flexbox to position
the page number and chapter title instead of the pseudo-flexbox features in
CSS3 Paged Media.

I'm not against adding abspos margin boxes for marginalia. However,
> I've used the current css3-page model to publish real-world books [3]
> and I find it simple & powerful -- not over-complicated & inadequate.
>

It's simple and powerful from the point of view of authors who want to do
exactly what the feature was designed to do. Since you designed the
feature, I'm not surprised it's a good fit for your needs :-). But 16 new
pseudo-elements and a lot of spec text defining positioning and sizing for
the margin-box layout model is not simple for implementors, or people
trying to write tests for the feature, or authors trying to understand the
behavior they're getting, or authors trying to understand how to get the
behavior they want. And it will get more complex if/when we add features
for the use-cases Julian introduced at the start of this thread.

Rob
-- 
Wrfhf pnyyrq gurz gbtrgure naq fnvq, “Lbh xabj gung gur ehyref bs gur
Tragvyrf ybeq vg bire gurz, naq gurve uvtu bssvpvnyf rkrepvfr nhgubevgl
bire gurz. Abg fb jvgu lbh. Vafgrnq, jubrire jnagf gb orpbzr terng nzbat
lbh zhfg or lbhe freinag, naq jubrire jnagf gb or svefg zhfg or lbhe fynir
— whfg nf gur Fba bs Zna qvq abg pbzr gb or freirq, ohg gb freir, naq gb
tvir uvf yvsr nf n enafbz sbe znal.” [Znggurj 20:25-28]
Received on Monday, 25 March 2013 03:15:39 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT