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

Re: [css3-page] Flexbox or table algorithm for page-margin box layout

From: Håkon Wium Lie <howcome@opera.com>
Date: Mon, 25 Mar 2013 15:41:38 +0100
Message-ID: <20816.25122.747724.476351@gargle.gargle.HOWL>
To: Simon Sapin <simon.sapin@exyr.org>
Cc: www-style@w3.org
Hello Simon,

 > > How about using the table algorithm? The rendering of the top margin
 > > boxes would be described with:
 > >
 > > <style>
 > >   #top-left-corner { text-align: right; vertical-align: middle }
 > >   #top-left { text-align: left; vertical-align: middle }
 > >   #top-center { text-align: center; vertical-align: middle }
 > >   #top-right { text-align: right; vertical-align: middle }
 > >   #top-right-corner { text-align: left; vertical-align: middle }
 > >   #page-area { /* determined elsewhere */ }
 > > <style>
 > > <table>
 > >   <tr><td id=top-left-corner><td id=top-left><td id=top-center><td id=top-right><td id=top-right-corner></tr>
 > >   <tr><td><td colspan=3 id=page-area><td></tr>
 > > </table>
 > Maybe there something in this direction, but the code above is not enough:
 > 1. If there is any content in #top-left or #top-right, #top-center may 
 > not be centered compared to #page-area.

Right. We could add a constraint that:

 #top-right.width = max (#top-left.width, #top-right.width )
 #top-left.width = max (#top-left.width, #top-right.width )

Or something. 

It's not ideal as it cannot be represented in CSS. But it ensures that
overlap doesn't happen.

 > 2. Large unbreakable content in #top-left-corner will make the column 
 > smaller (even if the cell has a fixed 'width'), which in turn probably 
 > makes #page-area smaller.

The dimension/size of #page-area must be the strongest constraint --
we never want margin boxes to change the dimension/size of the page
area. This could probably be represented formally by "!important" or

 > Do you think that something based on tables could be tweaked to fix this?

I think so, if we can keep the number of exceptions to a minimum.

 > > If we need to simplify, droppig the six left-* and right-* margin
 > > boxes may be an option -- I can't recall ever having used these.
 > Page-margin boxes on the left or right can make sense with a vertical 
 > writing mode (where they are "headers" and "footers".) Removing them 
 > does not make the algorithm any simpler for the remaining boxes.

Right. I'm in favor of keeping them.

 > > Margin boxes on the side of a page often need even more precise
 > > placement:
 > >
 > >   http://people.opera.com/howcome/2013/tests/margin-boxes.jpg
 > I think there is no difficulty in doing this in a printed book. If you 
 > know the size of your paper, fonts and content, just use fixed 
 > (non-auto) heights and margins.

Hmm, would that work? On a right page, the top right margin box (the
one who leaves a dark mark on the edge of the paper) must be taller
than the top page margin. So, the dark margin boxes don't really fit
into the grid of 16 margin boxes.

              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Monday, 25 March 2013 14:42:18 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:09 UTC