Re: [css3-page] Page-margin boxes layout

Simon Sapin <simon.sapin@kozea.fr> wrote on 2012/11/05 10:54:42
> I just pushed my replacement for section 6.3.2 of css3-page:
> http://dev.w3.org/csswg/css3-page/#margin-dimension
> 
> Any feedback is appreciated. In particular, are there use cases not 
> covered by the algorithm?


I think the new computation rules are reasonable, but I found a problem comparing them with existing implementations, Prince, and our Antenna House Formatter, we had implemented it referring to existing working draft spec (WD-css3-page-20061010, §4.3 Dimension of margin boxes). The large difference is that the existing spec has the rule “The sum of the outer widths of the three boxes is equal to max box width.” It means that when fit-content width is less than the available width the remaining space is distributed to the used widths.

For example, 
  @page {
    @top-left {
      content: "AAA";
      background: silver;
    }
    @top-right {
      content: "CCC";
      background: silver;
    }
  }
In existing spec and implementations there is no space between two margin-boxes, but in the new spec they have fit-content widths.
Another example,
  @page {
    @top-center {
      content: "BBB";
      background: silver;
    }
  }
In existing spec and implementations the width of the top-center margin-box is equal to the width of the page-area, but in the new spec it has the fit-content width.


I would like to modify the new spec so that the remaining space is distributed proportionally to the used widths unless ‘width: fit-content’ is specified explicitly, in the following rules:
* ... the used width for A and C is the respective ‘max-content’.
* ... the used width for B is ‘max-content’. 
and the rule
* ... the used width is min(max-content, max(min-content, available)),
will be
  the used width is max(min-content, available) ,
unless ‘width: fit-content’ is specified explicitly.

We have not implemented yet the ‘width: fit-content’ for margin boxes but I think it will be useful.


Best regards,

Shinyu Murakami
Antenna House

Received on Sunday, 11 November 2012 19:34:22 UTC