Re: unit expander (was: Disadvantages of ch unit)

As I said before, you may introduce a chw(<string>,<simple selector>)
function (which stands for char-width), or even a
link-value(<property-name>,<simple-selector>) to avoid at all parsing
issues.
But there are many other problems:
1) chw has no intrinsic meaning, so the width of non existent chars ('0' in
my case) cannot be replaced by the average char width (currently the meaning
of ch unit)
2) linking properties between otherwise unrelated element can be difficult
to implement (ie. needing for a complete DOM, for actual values elaborated,
etc.)

For what concerns 1), you said using � REPLACEMENT CHARACTER: it may be
fine, because, as you said, the char is expected to be also in the content,
so it is consistent the replacement
For 2), instead, I'm not an implementor so I don't actually know how
difficult it would be. I would wait for browser developers.

Giovanni

2009/1/12 Josef Schmid <e9427749@student.tuwien.ac.at>

> Hi!
>
> Brad Kemper schrieb:
>
>> On Jan 9, 2009, at 12:34 PM, Josef Schmid wrote:
>>
>>  3) you're introducing two syntax keywords (of and from)
>>>>
>>>
>>> yes, and? Instead of 'ch', 'rem' and many other that will
>>> follow.
>>>
>>>  For me this was a argument, how much a web developer must
> learn and what power he get for this.
>
>
>  "ch" and "rem" and other measurement units are interpreted as such when
>> they have a number before them, not a space.
>>
>
> yes, so the possible _values_ for CSS-properties are a little bit
> restricted, so the parser is allowed to assume that it is a
> value-extender (because of the space).
> Neither selectors nor the names of properties are affected.
>
>
>  There may be existing CSS out in the wild that styles XML with "of" and
>> "from" being used as simple selectors for "of"and "from" XML elements.
>>
>
> Yes of course.
> But why you think that this has anything to do with my proposal?
>
> Eg. <doc>
>    <from class="from" id="from">foo
>    </from>
>    <later_in_stream id="there">bar</later_in_stream>
>    </doc>
>
>    from.from#from { .... }
>    later_in_stream#there
>    { font-size: 1em from (doc #from);
>      with: 50% from :root;
>      ...
>    }
>
> The price is only that for css-properties simple values called 'from'
> are not allowed one second an beyond argument position, when
> the values before can have a expandable value.
>
> So disallowing some-css-property: from; are more as enough.
> (The whole thing does only effect stuff on the right side of ':'.)
> At least i think that it can work that way.
>
>
> --------------------------------------------------------------------------------
>
> Alternatively a postfix syntax without this restriction:
>
>    later_in_stream#there
>    { font-size: 1em-from (doc #from);
>      with: 50%-from :root;
>      ...
>    }
>
>
> ---------------------------------------------------------------------------------
>
> bye,
>  Josef
>

Received on Monday, 12 January 2009 20:25:10 UTC