RE: Range of integer values (wrt 1 Microsoft z-index test)

Gérard Talbot wrote:
> This test
> http://test.csswg.org/source/contributors/microsoft/submitted/Chapter_9/z-index-001.xht
> must be reviewed, reassessed.
> Its assertion field states something that CSS 2.1 spec does not specify, does not define anywhere:
> <meta name="assert" content="The property z-index set to a minimum value minus 1 is correctly truncated to the minimum value.">

This assertion was discussed at the CSS WG F2F in Beijing. It was decided that tests need to test some boundaries that were reasonable. In the case of integer it was easy enough to find the definition of integer in the C Language Specification. Though I am not going to put up much of a battle for the exact number defined in the test case I will put up the question "How do we test that the boundaries are supported correctly for <integers>, <numbers> and <lengths>?". This must be defined or the spec is untestable for all scenarios.

> http://www.w3.org/TR/CSS21/visuren.html#propdef-z-index
> makes no mentions of any truncation method and of any specific (floor) minimum value
>
> Section 4.3.1 Integers and real numbers
> http://www.w3.org/TR/CSS21/syndata.html#numbers
>
> states
>
> "Note that many properties that allow an integer or real number as a value actually restrict the value to some range, often to a non-negative value."
>
> but does not state and does not suggest any floor and/or ceiling values.

We discussed truncating at Beijing as well and we decided that it is better to truncate than roll the value over from negative to positive and positive to negative in the case of integer overflows. The word restrict would imply that you cannot go beyond the maximum value or the minimum values when defining an integer. The issue with the sentence is really the words "some range".

Since there are no clear definition for "some range" (i.e. minimums or maximums) for integers, real numbers, or lengths for that matter, a value range between 0-10 is all that is needed to be standards compliant. Though not very useful to the world it would meet with the specification and be a standards compliant implementation.

What I recommend is that we define some reasonable testable definition of minimums and maximums that user agents must support but allow user agents to support beyond that definition as necessary. This allows for interoperable implementations, and testable assertions, and allows web developers a number that they can rely on. However in the case of <integer> this is defined by a different specification and is already defined as -2,147,483,648 to 2,147,483,647. If we want to use that definition I think it makes the most sense. Again if these definitions are not defined then the spec is not testable for all scenarios and we cannot move it to REC because we can't prove that the maximum or minimum values are supported correctly.

There is also an issue with the section 1.2.2.1 where the modifiers + and * are discussed. These also need a maximum number to be supported or again any property that contains the modifiers cannot be fully tested.

--
Thanks,
Arron Eicholz

Received on Saturday, 19 December 2009 00:44:56 UTC