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

On 10/8/15 6:55 PM, Tab Atkins Jr. wrote:
> You missed my point.  Flexbox has had this exact behavior for years.
> Has it always been troublesome?

Here's what the Gecko code has to say about align-self right now:

   // NOTE: align-self's initial value is the special keyword "auto", 
which is
   // supposed to compute to our parent's computed value of 
"align-items".  So
   // technically, "auto" itself is never a valid computed value for 
align-self,
   // since it always computes to something else.  Despite that, we do 
actually
   // store "auto" in nsStylePosition::mAlignSelf, as 
NS_STYLE_ALIGN_SELF_AUTO
   // (and then resolve it as-necessary).  We do this because "auto" is the
   // initial value for this property, so if we were to actually resolve 
it in
   // nsStylePosition, we'd never be able to share any nsStylePosition 
structs
   // in the rule tree, since their mAlignSelf values would depend on 
the parent
   // style, by default.

which is more or less dbaron's "I could implement something
that's mostly indistinguishable by storing 'auto' and doing lots of 
complicated and fragile stuff elsewhere in the engine" from the original 
post that started this thread.  I expect that there might be edge cases 
where we are in fact currently nonconformant right now; I see nothing in 
our transition code to magically handle this property, so I expect there 
may be cases where there are spurious transitions (that may be hard to 
detect, seeing as they happen between two values that are supposed to 
look the same per spec, so only detectable via transiition events).

> It sounds like, from your further
> comments that I'm snipping, it has been.

Afaict it has been.

> I just want to make sure that I actually understand the issue here,
> and that it's not something new and unique to the Alignment spec that
> I'm not seeing.

It's not unique, but it's an antipattern if you want this stuff to be 
able to be optimized well, and just because we made a mistake once 
doesn't mean we should make it again.

-Boris

Received on Thursday, 8 October 2015 23:08:02 UTC