Skip to content
Browse files

style: In css 'display' blockification codepath, leave -moz-box alone…

… and promote -moz-inline-box to -moz-box (if a new pref is set).

This is in the interests of allowing the frontend team to experiment with
switching from XUL grid to CSS grid, without inadvertently changing the
display values for the grid items via css-grid-item blockification.

This patch's new pref is not expected to remain in the codebase for long.
We're just adding it so that the behavior remains the same by default, because
we do currently have some XUL code that inadvertently depends on -moz-box
display values being blockified to 'block'.  The plan is for folks to remove
that dependency e.g. by adding explicit 'display:block' styling to frontend
code as-needed. After we've done that, we can tentatively flip the pref to true
by default, and then remove the pref entirely.

Differential Revision:
  • Loading branch information...
dholbert authored and emilio committed Sep 19, 2019
1 parent 0138fc3 commit fee0f2cd23a05194842cff09bf035902157ad81e
Showing with 14 additions and 0 deletions.
  1. +14 −0 components/style/values/specified/
@@ -393,6 +393,20 @@ impl Display {
Display::from3(DisplayOutside::Block, inside, self.is_list_item())
// If this pref is true, then we'll blockify "-moz-inline-box" to
// "-moz-box", and blockify "-moz-box" to itself. Otherwise, we
// blockify both to "block".
#[cfg(feature = "gecko")]
DisplayOutside::XUL => {
if static_prefs::pref!("layout.css.xul-box-display-values.survive-blockification.enabled") {
match self.inside() {
DisplayInside::MozInlineBox | DisplayInside::MozBox => Display::MozBox,
_ => Display::Block,
} else {
DisplayOutside::Block | DisplayOutside::None => *self,
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
_ => Display::Block,

0 comments on commit fee0f2c

Please sign in to comment.
You can’t perform that action at this time.