Closed Bug 1186729 Opened 9 years ago Closed 7 years ago

resolve align-self:auto at computed value time and use rule node cache conditions to handle the parent align-items dependency

Categories

(Core :: CSS Parsing and Computation, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID
Tracking Status
firefox42 --- affected

People

(Reporter: heycam, Unassigned)

References

Details

Currently we handle align-self:auto a bit oddly, in that auto should always compute to the parent's align-items value, but we keep auto stored in nsStylePosition::mAlignSelf so that we can have better rule node caching behaviour.

In bug 804975 we added the ability to cache more structs in rule nodes, if they have a dependency on a parent font-size, direction, writing-mode or text-orientation value.  We could add align-self to RuleNodeCacheConditions and then resolve auto at computed value time.

This would allow us to remove the only use of the NS_STYLE_USES_GRANDANCESTOR_STYLE style context bit, which was added in bug 931668 to record a condition where the eRestyle_Stop optimisation cannot be used.
It would also remove a case that bug 1180120 would need to check for explicitly.
Blocks: 1180120
(In reply to Cameron McCormack (:heycam) from comment #0)
> This would allow us to remove the only use of the
> NS_STYLE_USES_GRANDANCESTOR_STYLE style context bit, which was added in bug
> 931668 to record a condition where the eRestyle_Stop optimisation cannot be
> used.

Oh, I'm wrong about that; it's still needed to record that reset properties on a child of a ::first-line inherits from the element, no the first line frame.
No longer blocks: 1180120
I think this bug is now INVALID due to spec changed. In particular:
 (1) The spec used to say that "align-self:auto" _computed_ to the align-items value on the parent (which is why we had the odd behavior described in comment 0 here), but nowadays the spec says that "auto" computes to itself & simply _behaves like_ the parent value when used in layout. We implemented this change in bug 1304012 (and that bug also ripped out a lot of the junk that heycam was alluding to here).

 (2) The spec has also been clarified on something else -- it now says that the parent whose align-items we mimic is the *box tree* parent, not necessarily the parent we inherit styles from.  I don't think we know about box-tree parentage in nsRuleNode.cpp, so I'm not sure this bug's original plan is workable in light of that spec change.

Anyway: the good news is that bug 1304012 got rid of the most severe hackiness here, I think.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.