W3C home > Mailing lists > Public > www-style@w3.org > October 2011

[css3-gcpm] Use of string(...) outside of margin boxes

From: Peter Moulder <peter.moulder@monash.edu>
Date: Fri, 07 Oct 2011 16:31:30 +1100
To: www-style@w3.org
Message-id: <20111007053130.GA1805@bowman.infotech.monash.edu.au>
Named strings were apparently designed for use in margin boxes, but I
don't see anything in the text that says that string(...) can only be
used in margin boxes.

There is some text in the string-set section saying

  # The scope of a named string is the page of the element to which the
  # 'string-set' property is attached and subsequent pages.

which could perhaps be taken to mean that string(...) outside of an @page
rule has the same behaviour as string(unknown-named-string), though for
me it isn't explicit enough if that is the intent: if a document element
can be considered attached to a page for purposes of 'string-set', then
one might similarly consider that document element to be within that same
scope.

I think the text ought to make some comment about whether string(...) is
required to be supported outside of margin boxes, and some comments about
the value in that case.

If named strings can be accessed outside of margin boxes, then the
literal reading of the current text would be that the value is still
page-based rather than the most recently assigned value as for counters,
but that then requires answering the question "what page?", particularly
if the page placement is affected by the value: e.g. suppose that if
evaluated in the context of page 5 then the value is
"starts-with-a-very-long-word-that-doesn't-fit-in-page-5" (while if
evaluated on page 6 the value would be short and would fit on page 5).

Another issue with using the same page-based evaluation is that it
probably isn't what authors would want if they did use named string
values outside of margin boxes.

Another issue with use outside of margin boxes generally (whether with
page-based evaluation or counter-like evaluation) is what happens when
the string-set content is determined in part by string() of the same
named string.

The simplest way to resolve all of these would be to say that string(...)
outside of @page rules is either an invalid value or evaluates to the
empty string.  (Just as only certain properties apply to margin boxes,
so too we could say that certain values of those properties are only
legal when applied to margin boxes.)

pjrm.
Received on Friday, 7 October 2011 05:31:55 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:45 GMT