Open Bug 1316923 Opened 9 years ago Updated 3 years ago

[css-align] UsedAlignSelf/UsedJustifySelf doesn't work well for <table>s

Categories

(Core :: Layout, defect, P3)

defect

Tracking

()

Tracking Status
firefox52 --- wontfix

People

(Reporter: MatsPalmgren_bugz, Unassigned)

References

Details

Example: <div style="display: grid; align-items:start; justify-items:start"> <table><td></td></table> </div> This results in the frame tree: Grid TableWrapper Table and the style context tree: Grid Table TableWrapper Results for UsedAlignSelf(this->GetParent()->StyleContext()): this=TableWrapper: ok, uses align-items from Grid this=Table: WRONG! uses (initial value) align-items from TableWrapper Results for UsedAlignSelf(this->StyleContext()->GetParent()): this=TableWrapper: WRONG! uses (initial value) align-items from Table this=Table: ok, uses align-items from Grid Discovered while implementing *-self for <table> grid items (bug 1316051). I'd like some method that returns the align-items value from the Grid for both Table[Wrapper]Frames (when resolving a *-self:auto value). I guess I can work around it for now...
(In reply to Mats Palmgren (:mats) from comment #0) > Results for UsedAlignSelf(this->GetParent()->StyleContext()): > this=TableWrapper: ok, uses align-items from Grid > this=Table: WRONG! uses (initial value) align-items from TableWrapper Where/why are we checking & reacting to UsedAlignSelf on a nsTableFrame? I'm not sure that's something we should use, since a nsTableFrame is never directly inside of a css-align alignment container. To the extent that we *do* care about UsedAlignSelf on a nsTableFrame (in layout), I expect that it's fine for us to use the initial value... Maybe this is about getComputedStyle(), though? I agree that for getComputedStyle(), we should probably be reporting the resolved align-self value from the TableWrapper, rather than the Table. (Or from the Table with respect to its alignment container even though that's not technically its parent.)
(In reply to Daniel Holbert [:dholbert] from comment #1) > Where/why are we checking & reacting to UsedAlignSelf on a nsTableFrame? I'll need it in bug 1316051. > I'm not sure that's something we should use, since a nsTableFrame is never > directly inside of a css-align alignment container. It actually *is* directly inside the Grid from a sizing perspective. They both use the same CBReflowInput (the Grid's RI in this case): http://searchfox.org/mozilla-central/rev/4b6cab91f93c73ae591dafaea40fd5704b41810e/layout/generic/ReflowInput.cpp#493 That's why something like <table style=width:50%> works (without making the inner table frame just 25%). It's also needed for stretching - they *both* need to fill that CB. It's not observable for start/end/center etc though, since the table is shrink-wrapped it doesn't matter.
> without making the inner table frame just 25% Or rather, without being 50% of the table-wrapper's 'width:auto'.
I've worked around it in bug 1316051 for now. But it is a bit of a foot-gun so we might want to add some convenience method to avoid that in the future. We should probably wait until bug 799725 (table flex items) is fixed though, to see what the needs are there first.
Severity: normal → minor
Depends on: 799725
Mass wontfix for bugs affecting firefox 52.
Priority: -- → P3
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.