Re: CSS3-box: margin-outside and the cascade

[I still don't see "margin-before/after/start/end" in the cited spec
(<http://www.w3.org/TR/2001/WD-css3-box-20010726/#the-margin>);
from your example, I guess the idea is that they represent what would be
top/bottom/left/right in scripts that are left-to-right then top-to-bottom,
adjusted as necessary for text with different directionality.]

[Tue, 20 Aug 2002 20:54:53 -0400] fantasai:
>Reasonable case, no?

Yes, it seems so.

I think the underlying difficulty is that it's a bad idea to define
a property that can be an alias for one of a set of other properties
(based on some further criteria).


If the properties cascade independently (by name) and the "aliasing" is
resolved only during formatting, then it becomes confusing to describe how
the cascade determines a value.  We get the cumbersome "defer" logic
described by Ian, and the unreasonable result of a reasonable case which
you demonstrated it implies.

If the properties are taken to alias before the cascade (which I presume is
what Ian means is  "a known error in the spec"), we complicate
implementation immensely.  In your original example:
||     margin-left: 1em;
||     margin-inside: 0;
||     margin-outside: 2em;
||     margin-right: .5em;
*we* can figure out (considering the cascade in each case) that the right
margin must be .5em, and the left margin is either 0 (on an odd-numbered
page) or 2em (on an even-numbered page).  But an implementation will want
to determine the full set of CSS properties of each element in the document
tree long before it gets to pagination!  The user agent would have to
maintain, for element, not only the values of each alias property *and* of
each property that can be aliased, but also the weight, specificity and
position of the strongest declaration for each, so that it could later
determine which one is actually predominant in the cascade.


For the record, I'll repeat my suggestion --- instead of the troublesome
margin-inside and margin-outside properties, define:

     Name: margin-mirror
     Value: none | horizontal | vertical | inherit
     Initial: none
     Applies to: all elements 
     Inherited: no 
     Media: paged

     none:       Margins do not depend on whether the page is odd or even.
     horizontal: Even pages are rendered as if the specified values for
                 margin-left and margin-right were interchanged (for
                 binding pages at the left or right).
     vertical:   Even pages are rendered as if the specified values for
                 margin-top and margin-bottom were interchanged (for
                 binding pages at the top).

     For this purpose, "odd" and "even" pages are determined by counting
     from 1, which is assigned to the first page of the formatted document
     (regardless of  whether the entire document is printed or otherwise
     rendered in any particular operation).

(I intend the last paragraph not so much as the suggestion of a solution as
the suggestion of a problem that should be resolved one way or the other.)
-- 
Randall Joseph Fellmy aka Randy@Coises.com

Received on Wednesday, 21 August 2002 06:09:07 UTC