Re: unitless lengths in mpadded attributes

On 05/21/2012 05:54 PM, Karl Tomlinson wrote:
> Can get clarification of these questions in the context of mpadded
> attributes, please?
>
> 1. Are unitless lengths valid attribute values?
> 2. Is "0" a special case where no unit is valid?
>
> In the attribute table, the description
> '( "+" | "-" )? unsigned-number (("%" pseudo-unit?) | pseudo-unit | unit | namedspace )'
> has no "?" following the second set of parentheses, indicating
> that there must be something following the unsigned-number.

Indeed we had intended the "?" to allow unit-less values as we do with other
length-like attributes --- a few paragraphs later in the text you
cited describes that case --- but in the heat of sorting out reference & default
values, we left off the "?" in the regular expressions.
(and in the schemas generated from them).

> That seems reasonably clear that the answer to both my questions
> is "no", but there are some possible hints elsewhere in the spec
> that unitless values might be valid, so I want to check that I am
> not missing something.

> The default for both lspace and voffset is "0".

Odd that we managed to mangle that as well; a unitless "0"
shouldn't have been used as the default in either case!
(it would be either invalid or circular!)

> I guess it's quite feasible to have a default that is not a string
> that can be specified as a valid value, but it feels a little odd.
>
> Would it be clearer to specify the default value as "0em", as it
> was in MathML2?

Indeed.

> In the text "Each format begins with an unsigned-number, which may
> be followed by a % sign (effectively scaling the number) and an
> optional pseudo-unit, by a pseudo-unit alone, or by a unit
> (excepting %)", would it be clearer to replace "which may be followed"
> with "followed"?
>
> In the text "the resulting length is the product of the number
> (possibly including the %) and the following pseudo-unit, unit,
> namedspace or the default value for the attribute if no such unit
> or space is given", would it be clearer to replace "if no such unit
> or space is given" with "if % is specified with no pseudo-unit"?

I think this is correct as it stands, but was intended to describe
the case where the entire percent|unit|pseudo-unit|namedspace clause
was optional.

> http://www.w3.org/Math/draft-spec/chapter3.html#presm.mpadded

The correction is now in the editors draft.
Thanks for bringing this up, and your attention to detail!

bruce

Received on Tuesday, 22 May 2012 20:12:18 UTC