From b7773d02d2313fd955f5cb4ba9ab8a002042910a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 8 Sep 2022 11:51:15 +0000 Subject: [PATCH] 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 --- components/style/values/specified/box.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 47561c9a51a..660b77b32e8 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -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, } }