Re: [Resent: Disadvantages of ch unit (was: stability of root em unit spec)]

I like your idea, just I think your gone a bit too far wanting to allow any
char from any selector
look at "width of 'ᚘ' from #my-id > div.my-class:nth-child(4)"
(char is U+1698, OGHAM LETTER IFIN)
it is perfectly legal in your proposal but doesn't have a real use case

Instead, it adds unneeded complexity for 2 reasons:
1) your not backcompatible with the current syntax
2) CSS parsers already exists and their tokenizers don't expect whitespace
inside values
3) you're introducing two syntax keywords (of and from)
4) I'm not sure if this syntax is compatible with shorthand properties,
where whitespace is meaningful to divide the shorthand into the full form
(there are already too many issues about shorthand property syntax)

A part from syntax, which may be resolved using something like
chw(<string>,<selector>) (where cwh is char width)

your proposal has two problems:
1) you assume that given char exists in the selected font (which is not
always true)
2) you assume that a full loaded document (to fully resolve selectors) is
linked with the style sheet (incremental parsing is not allowed)
3) the selector may match more than one element, and those may have
different actual values
4) you assume that an actual value for all font properties for that element
is already found, which in turn means:
- no transformation can be applied to the computed value from the specified
value, because computed values are calculated earlier than actual values
(now instead the computed value of em or ex is aware of font metrics)
- the desidered element must already have been processed, ie you cannot
reference an element later in the tree and your constraining UA processing
order (now the only constraint is "parent before childs" for inheritance)

Moreover, the width of '0', 'x' and 'm' are widely used in written
typography, and the root version of em was introduced to simplify
accessibility, as the root font size initial value is user decided, so using
relative units allows to scale appropriately when zooming text, while not
dealing with nasty inheritance effects (0.7rem is always the 70% of default
font, while 0.7em is 70% of parent's font)

Regards,

Giovanni

Received on Friday, 9 January 2009 18:16:36 UTC