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

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), and multiple inline-elements
(which would become their own flex items). But I pushed a patch with
some asserts and they didn't fire on our browser mochitests, so I think
we're good.

The UA rule refactoring (removing the inherit from xul anon blocks)
shouldn't matter in practice, since we only have one item (so
box-ordinal is irrelevant) and they have overflow: visible (so
text-overflow and overflow-clip-box shouldn't have an effect).

Differential Revision: https://phabricator.services.mozilla.com/D156375
This commit is contained in:
Emilio Cobos Álvarez 2022-09-08 11:51:15 +00:00 committed by Martin Robinson
parent 319dca5351
commit b7773d02d2

View file

@ -300,6 +300,8 @@ impl Display {
DisplayInside::Flex => true,
#[cfg(feature = "gecko")]
DisplayInside::Grid => true,
#[cfg(feature = "gecko")]
DisplayInside::MozBox => true,
_ => false,
}
}
@ -337,7 +339,7 @@ impl Display {
};
Display::from3(DisplayOutside::Block, inside, self.is_list_item())
},
DisplayOutside::Block | DisplayOutside::None => *self,
DisplayOutside::Block | DisplayOutside::XUL | DisplayOutside::None => *self,
_ => Display::Block,
}
}