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
This commit is contained in:
Emilio Cobos Álvarez 2020-01-07 21:00:42 +00:00
parent 219c0f6328
commit 718a9b1f05
No known key found for this signature in database
GPG key ID: E1152D0994E4BF8A

View file

@ -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,
}
}