Re: [css3-text-layout] New editor's draft - margin-before/after/start/end etc.

On 6/1/10 10:16 AM, Håkon Wium Lie wrote:
> However, if you need to keep the specified value, memory costs go up;
> you suddenly have many more properties to keep track of.
>
>   >  >     - there is no DOM access to DDAs (I hope, the draft doesn't say)
>   >
>   >  Why not, if they have specified values?
>
> Because you save memory by converting them to real properties and
> forgetting about them, no?

Right, but if your specified values might turn out to mean different 
computed values based on other computed values, then you can't just 
pre-convert on specified values.

In other words, the only reason to forbid DOM access to these specified 
values is to allow the "map it at parse time" optimization.  But then 
you can't do simple things like incrementing the margin-start from 
script, say.  Is that the right tradeoff?

>   >  >    >   For UAs supporting only horizontal writing, *-before, *-after,
>   >  >    >   logical-width and logical-height are simply aliases of *-top, *-bottom,
>   >  >    >   width and height respectively. No costs needed.
>   >
>   >  That seems like an optimization based on pre-converting on the specified
>   >  value level due to knowing what computed writing directon will be.  That
>   >  optimization is, of course, not compatible with DOM access to the
>   >  specified values, so I'm not sure it's a valid optimization.  Unless the
>   >  specified-value behavior of these properties is _very_ weird.
>
> Right. You could offer access to computed values of the DDAs by
> tiltering them through the 'writing-mode' property. Which is somthing
> scripts can do themselves, too. But access to specified values
> requires memory. More memory than I think it's worth.

I'm not sure this makes sense.  Specified values need a lot less memory 
than computed values, at least in Gecko's implementation.  In 
particular, a specified value for a property that's not set needs no 
memory at all (in Gecko's implementation).  A specified value that's set 
requires memory, but only once.  A computed value requires memory 
multiple times, in general (worst-case once per element in the DOM, but 
presumably UAs optimize this to some extent).

-Boris

Received on Tuesday, 1 June 2010 14:37:19 UTC