From 718a9b1f05292be3afc552eab20fcf65803348ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 7 Jan 2020 21:00:42 +0000 Subject: [PATCH] style: Make display: -moz-box more similar to other display types for block layout. It is unexpected (see bug) that a -moz-box is affected by baseline alignment. Make -moz-box be block-outside, and -moz-inline-box be inline-outside, instead of the bespoke thing we have now. This is more similar to everything else, and fixes the bug. Differential Revision: https://phabricator.services.mozilla.com/D58726 --- components/style/values/specified/box.rs | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/components/style/values/specified/box.rs b/components/style/values/specified/box.rs index 1549f66e8e9..2f114b5bb0a 100644 --- a/components/style/values/specified/box.rs +++ b/components/style/values/specified/box.rs @@ -98,8 +98,6 @@ pub enum DisplayInside { #[cfg(feature = "gecko")] MozBox, #[cfg(feature = "gecko")] - MozInlineBox, - #[cfg(feature = "gecko")] MozGrid, #[cfg(feature = "gecko")] MozGridGroup, @@ -221,9 +219,9 @@ impl Display { /// XUL boxes. #[cfg(feature = "gecko")] - pub const MozBox: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozBox); + pub const MozBox: Self = Self::new(DisplayOutside::Block, DisplayInside::MozBox); #[cfg(feature = "gecko")] - pub const MozInlineBox: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozInlineBox); + pub const MozInlineBox: Self = Self::new(DisplayOutside::Inline, DisplayInside::MozBox); #[cfg(feature = "gecko")] pub const MozGrid: Self = Self::new(DisplayOutside::XUL, DisplayInside::MozGrid); #[cfg(feature = "gecko")] @@ -375,11 +373,6 @@ impl Display { }; Display::from3(DisplayOutside::Block, inside, self.is_list_item()) }, - #[cfg(feature = "gecko")] - DisplayOutside::XUL => match self.inside() { - DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox, - _ => Display::Block, - }, DisplayOutside::Block | DisplayOutside::None => *self, #[cfg(any(feature = "servo-layout-2013", feature = "gecko"))] _ => Display::Block, @@ -400,11 +393,6 @@ impl Display { }; Display::from3(DisplayOutside::Inline, inside, self.is_list_item()) }, - #[cfg(feature = "gecko")] - DisplayOutside::XUL => match self.inside() { - DisplayInside::MozBox => Display::MozInlineBox, - _ => *self, - }, _ => *self, } }