Remove special computation behavior for "justify-content: stretch" on flex containers, and just handle it in layout

NEW
Assigned to

Status

()

Core
Layout
2 years ago
2 years ago

People

(Reporter: dholbert, Assigned: dholbert)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(firefox45 affected)

Details

(Assignee)

Description

2 years ago
Per this thread [1], I think "justify-content" should compute to its specified value, and the special-case that we have for "stretch"[2] should just be handled at layout-time.

(Note that its MapLeftRightToStart calls are also going away, in bug 1225376.)

Then, as discussed in bug 1225376 comment 22, we'll likely want to get rid of the newly-useless Computed{Align|Justify}Content accessors, and we can get rid of the special-case inheritance code for mJustifyContent in nsRuleNode.cpp, too.

[1]  https://lists.w3.org/Archives/Public/www-style/2015Nov/0327.html
[2] http://mxr.mozilla.org/mozilla-central/source/layout/style/nsStyleStruct.cpp?rev=965b8e749d1f#1747
Well, we have the special 'legacy' inheritance also.  Perhaps we can take
the SetUncacheable perf hit for that one though since it's a rare edge case.

Anyway, I suspect there's a reason why these properties were specced so weirdly
to begin with.  Perhaps back-compat with IE's old grid implementation?
I doubt the spec editor would have introduced all this weirdness unless there
was a really strong reason for it.  I don't think we should get too far ahead
of the spec here.  If fantasai/Tab agrees with your proposal then I think
we should ask for it to be discussed at a CSSWG meeting to get a formal
decision on (all) the spec changes with all the stake holders present.
(Assignee)

Comment 2

2 years ago
I think they were specced in this complex way so that the initial value of "justify-content" on a flex container would remain unchanged, despite the addition of "auto" as the new initial value under-the-hood.  But, given that "justify-content:auto" now just computes to itself (as of https://lists.w3.org/Archives/Public/www-style/2015Oct/0023.html ), it seems that this is no longer a goal, so I don't see any reason for this "stretch" weirdness to remain.
(Assignee)

Comment 3

2 years ago
(In reply to Mats Palmgren (:mats) from comment #1)
> Well, we have the special 'legacy' inheritance also.  Perhaps we can take
> the SetUncacheable perf hit for that one though since it's a rare edge case.

The "legacy" keyword is only valid on "justify-items", correct? (and gets stripped out when evaluating "justify-self:auto")

This bug isn't concerned with either of those properties -- I'm just focusing on "justify-content" here.
Oh, never mind, I thought you were aiming to remove them all.  Sorry for the noise.
(Assignee)

Comment 5

2 years ago
Tab and fantasai replied, confirming my hunch here:
> fantasai and I reviewed this, and agree that it no longer makes sense
> to have "stretch" compute to "flex-start", for the reasons you gave.
> We've fixed it to say "behaves as".
https://lists.w3.org/Archives/Public/www-style/2015Dec/0058.html

So, we should go ahead with this. Taking, though I may not get to this right away.
Assignee: nobody → dholbert
You need to log in before you can comment on or make changes to this bug.