[css-align] implementability of computed value rules for align/justify-self/items

This email is a result of discussion from
https://bugzilla.mozilla.org/show_bug.cgi?id=1176782#c21 .

I'm really not sure how we'd implement the magic computed value
rules for align-items, justify-items, align-self, and justify-self
in Gecko.  Having the initial value of a property produce different
computed values depending on other properties (all of which could
also be produced from other values) defeats the key memory usage and
speed optimizations in our style computation code, since we're no
longer able to share computation results for non-inherited
properties between different elements with the same specified
values.

For the values other than 'legacy', I could implement something
that's mostly indistinguishable by storing 'auto' as the internal
computed value, adding code to compute the "real" computed value for
use by getComputedStyle and our internal users, adding code to fix
things up when explicit 'inherit' is used, and adding code to fix
things up for starting of transitions, but there are probably other
cases I've missed, where we'd end up being nonconformant.

The 'legacy' value on justify-items is even worse, though, since it
makes justify-items essentially be a half-inherited and
half-non-inherited property, even for the initial value.  I would
really rather have this legacy alignment behavior be part of an
inherited property.  (I think I'd be ok if the 'auto' value of
'justify-items' took its value from a non-'auto' value of an
inherited 'legacy-justify-items' and then fell back to the current
'auto' rules if 'legacy-justify-items' was 'auto'.  I think that's
no worse than what we do for the values other than 'legacy'.  (Or
'legacy-justify-items' could be part of 'text-align'.)

I'm not sure I worked out the implications of these various
possibilities correctly, though.

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Received on Friday, 11 September 2015 22:48:53 UTC