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

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

From: Håkon Wium Lie <howcome@opera.com>
Date: Thu, 28 Mar 2013 00:15:14 +0100
Message-ID: <20819.32130.18911.447499@gargle.gargle.HOWL>
To: Julian Viereck <julian.viereck@googlemail.com>
Cc: www-style@w3.org, robert <robert@ocallahan.org>, me <julian.viereck@gmail.com>
Julian Viereck wrote:

 > >   > > Going down this path, one requirement would be to position elements
 > >   > > wrt the page area -- I'd say that's an even more fundamental reference
 > >   > > than then page box.
 > >
 > >   > Can we do both? E.g.
 > >   >
 > >   >    <div style="position: pagebox">...</div>
 > >   >    <div style="position: pagearea">...</div>
 > >
 > > The keywords seem right. But I'm unsure how to achive the layouts we
 > > need. For example, how would you specify the top-left-corner margin
 > > box using this syntax?
 > >
 > >    http://www.w3.org/TR/2013/WD-css3-page-20130314/#margin-box-def
 > >
 > > The trouble is that two of the edges (top, left) are relative to the
 > > pagebox, while the other two (right, bottom) are relative to the
 > > two of the edges of the pagearea (top and left edges).
 > >
 > > For example, how would you specify the top-left-corner margin box 
 > > using this syntax?
 > 
 > You can only if you also control the margin, e.g.:
 > 
 > @page {
 >    margin-left: 2cm;
 >    margin-top: 2cm;
 > }

The thing is, you don't know if you control the page margin --
cascading could get in the way. As such, it would be better to refer
to the pagebox/pagearea to avoid dependencies on certain settings.

 > Then you can do:
 > 
 >    <div style="position: pagebox; top: 0px; left: 0px; width: 2cm; 
 > height: 2cm">...</div>
 > 
 > Alternatively, this can be solved by exposing the current's page margin 
 > to the "calc" function. Not sure about the concrete naming, but how 
 > about this:
 > 
 >    <div style="position: pagebox; top: 0px; left: 0px; width: 
 > calc(page-margin-left); height: calc(page-margin-top)">...</div>

Yes, this could express the rectangle without dependencies. But it
introduces more complexities. Hmm.

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Wednesday, 27 March 2013 23:15:49 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 27 March 2013 23:15:50 UTC