Closed Bug 1171773 Opened 9 years ago Closed 9 years ago

[css-grid] ASSERTION: writing-mode mismatch with grid

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: MatsPalmgren_bugz, Assigned: jfkthame)

References

Details

Attachments

(3 files, 1 obsolete file)

Attached file testcase #1
STR
1. set the pref layout.css.grid.enabled to true
2. load the attached testcase

ACTUAL RESULT
The assertion occurs inside the nsHTMLReflowState ctor when accessing
aAvailableSpace.ISize(mWritingMode).  The nsHTMLReflowState is
created here:
http://hg.mozilla.org/mozilla-central/annotate/5b4c240e1a36/layout/generic/nsGridContainerFrame.cpp#l1264
Actually, it's not even necessary to enable vertical mode in order to hit this; just setting direction:rtl on the child <span> will hit the same assertions.

When reflowing the child, we need to convert appropriately between the grid container's writing mode and the child's.
I think something along these lines is what we want here. But clearly we need some additional tests, too...
Attachment #8615882 - Flags: review?(mats)
Comment on attachment 8615882 [details] [diff] [review]
Handle reflowing a grid child with different writing mode

Nit: s/grid child/grid item/ in the commit message (so that it excludes
abs.pos.)

(A vertical abs.pos. child still isn't rendered correctly, but I suspect
we need bug 1079151 for that.  It's also broken with a block CB so it's
not just grid.)

Thanks for the fix!

(and don't worry about tests - I'll make sure to include some in
bug 1151212 that involves different writing modes.  I actually
discovered this while writing those tests!)
Attachment #8615882 - Flags: review?(mats) → review+
I'm a bit surprised our fuzz testing haven't caught this assertion yet.
Perhaps it's not run with both layout.css.vertical-text.enabled and
layout.css.grid.enabled set to true?
Flags: needinfo?(jruderman)
Minor update to account for margins on the grid item, which weren't handled correctly in the previous version. Carrying over r=mats.
Attachment #8616252 - Flags: review?(mats)
Attachment #8615882 - Attachment is obsolete: true
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
OK, I won't spend a lot of time on testcases here, but here's one I wrote earlier that hits these assertions, and runs cleanly with the patch. (It was when I added margins to this that I noticed the original patch didn't handle them right.) A more extensive set of tests, including vertical mode (which still has shrink-to-fit-related issues) would still be valuable, of course.
Attachment #8616256 - Flags: review?(mats)
Attachment #8616252 - Flags: review?(mats) → review+
Attachment #8616256 - Flags: review?(mats) → review+
(In reply to Mats Palmgren (:mats) from comment #4)
> I'm a bit surprised our fuzz testing haven't caught this assertion yet.
> Perhaps it's not run with both layout.css.vertical-text.enabled and
> layout.css.grid.enabled set to true?

My fault for not removing "ASSERTION: writing-mode mismatch" from my known-bugs list after another bug was fixed. I should also generate more complex values for grid-template-columns and grid-template-rows, and change the writing-mode property more frequently.
Flags: needinfo?(jruderman)
https://hg.mozilla.org/mozilla-central/rev/e3057db49f4e
https://hg.mozilla.org/mozilla-central/rev/f1c34cec973b
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: