Skip to content

Commit

Permalink
style: In css 'display' blockification codepath, leave -moz-box alone…
Browse files Browse the repository at this point in the history
… 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: https://phabricator.services.mozilla.com/D45258
  • Loading branch information
dholbert authored and emilio committed Oct 9, 2019
1 parent 0138fc3 commit fee0f2c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions components/style/values/specified/box.rs
Expand Up @@ -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 {
Display::Block
}
},
DisplayOutside::Block | DisplayOutside::None => *self,
#[cfg(any(feature = "servo-layout-2013", feature = "gecko"))]
_ => Display::Block,
Expand Down

0 comments on commit fee0f2c

Please sign in to comment.