Glen Mazza wrote: ...
I think the next thing to consider is the storage of specified vs. computed values. Let's say we store pointers for many properties to the same {"property-name", "property-value"} pair. A specified property value of "10%" would not make this a very helpful data structure if that percentage resolves to different computed values for each property sharing this pair. I believe the goal for us then would be just store the computed value for each pair (meaning many more pairs), as long as we take into account the can't-resolve-everything-without-knowledge-of-layout issue.
alt.design makes no attempt to look for commonalities here. It resolves every possible property value, and keeps a partly-resolved value for percentages. Inheritance is (almost exclusively) of computed values.
<quote>
For a given inheritable property, if that property is present on a child, then that value of the property is used for that child (and its descendants until explicitly re-set in a lower descendant); otherwise, the specified value of that property on the child is the computed value of that property on the parent formatting object.
</quote> 5.1.4 Inheritance
There is an exception that comes to mind. For "line-height" a value may be specified which, although not specified as a percentage, is a factor by which the font-size (from memory) is multiplied. When such a value is inherited, it is the factor, not the computed value.
In general, the computed value of a percentage is inherited. That still leaves a problem, because the computed value is unknown. In alt.design, what is effectively a link back to the unresolved property is specified as the value. When the parent property is resolved, that resolved value is then available to the inheriting descendants.
Yet-to-be-implemented is the handling of expressions involving percentages, as mentioned in an earlier post.
In essence, alt.design attempts to resolve every property to its computed value, and store the result only on nodes to which the property applies. There is no attempt to reduce storage by procedures like interning strings. Note, though, that the process of resolving properties does eliminate most strings. My objective was that when areas were being laid out, the relevant properties would all be directly available.
Peter -- Peter B. West <http://www.powerup.com.au/~pbwest/resume.html>
