Closed Bug 1789123 Opened 2 years ago Closed 2 years ago

Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes.

Categories

(Core :: Layout, task)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: emilio, Assigned: emilio)

References

(Blocks 1 open bug)

Details

Attachments

(3 files)

No description provided.

I haven't spotted any UI regression from this, and this should generally
make the XUL -> modern flex transition easier, and simplify some
of the relevant code.

This does fix a few layout issues with emulated flexbox.

For the most part, this shouldn't change behavior without that. This
changes behavior if you have mixed inline/non-inline content in the same
XUL box (before they'd get a single item, now you'd get the flexbox /
grid behavior of one item per inline run). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

Blocks: 1033225
Blocks: 1789165
Blocks: 1789168

This has no behavior change, just unifies the pseudo-element used for
these.

Possibly line-clamp should only work in -webkit- ones but I've preserved
behavior on this patch.

Depends on D156375

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/f36ff98a4bcb Unify anonymous flex/grid items. r=dholbert
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/61a98c3f4a30 Make anonymous box wrapping inside XUL boxes be similar to modern flex boxes. r=dholbert
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ef451461f420 Split legacy box bits in MOZ/WEBKIT. r=dholbert

Hey, Daniel, FYI, re. comment 7. I had missed this test because it was expected to fail on GTK (bug 1309107), and I usually run all the reftests, but on linux64, sigh.

The special-case in TextOverflow.cpp removed in comment 5 is actually why text-overflow: inherit mattered on the xul anon block (basically, we "jumped" one frame to make text-overflow work on XUL boxes). However, I think it's better to skip / remove the test that to keep it working, here's why:

  • It matches regular flexbox / -webkit-box / etc.
  • It doesn't make much sense conceptually since now we can have multiple anon items rather than just one.
  • Can be trivially made to work on the front-end if needed by using block layout.
  • I audited our front-end CSS for usage of text-overflow: and I didn't find a single use with XUL box (the closest was a XUL <description>, but that generates a block frame).

So all-in-all it probably makes sense to remove this special case. Thoughts?

Flags: needinfo?(dholbert)

Sounds reasonable to me, yup. Thanks for the quick follow-up!

Flags: needinfo?(dholbert)
Regressions: 1790898
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: