Skip to content

Commit

Permalink
Bug 1818811 - Make -moz-box-layout: flex default, and clean-up CSS. r…
Browse files Browse the repository at this point in the history
…=Gijs,extension-reviewers,settings-reviewers,desktop-theme-reviewers,dao

Now it's on by default everywhere, so all this is not needed. No behavior
change effectively since the xul.css bits being removed effectively achieve the
same.

Differential Revision: https://phabricator.services.mozilla.com/D170944
  • Loading branch information
emilio committed Feb 27, 2023
1 parent 9e8aaaf commit 22b9349
Show file tree
Hide file tree
Showing 24 changed files with 4 additions and 56 deletions.
2 changes: 0 additions & 2 deletions browser/base/content/aboutDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@namespace html "http://www.w3.org/1999/xhtml";

:root { -moz-box-layout: flex }

#aboutDialog {
/* Set an explicit line-height to avoid discrepancies in 'auto' spacing
across screens with different device DPI, which may cause font metrics
Expand Down
1 change: 0 additions & 1 deletion browser/themes/shared/browser-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@

--ext-theme-background-transition: background-color 0.1s cubic-bezier(.17,.67,.83,.67);

-moz-box-layout: flex;
user-select: none;
}

Expand Down
1 change: 0 additions & 1 deletion browser/themes/shared/preferences/preferences.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#preferences-root {
text-rendering: optimizeLegibility;
-moz-box-layout: flex;
}

@media not print {
Expand Down
1 change: 0 additions & 1 deletion browser/themes/shared/preferences/siteDataSettings.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
* Confirmation dialog of removing sites selected
*/
#SiteDataRemoveSelectedDialog {
-moz-box-layout: flex;
padding: 16px;
min-width: 50px;
}
Expand Down
1 change: 0 additions & 1 deletion devtools/client/themes/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* we're using the `font` shorthand. */
font: message-box;
font-size: var(--theme-body-font-size);
-moz-box-layout: flex;

--tab-line-hover-color: rgba(0,0,0,.2);
--tab-line-selected-color: var(--blue-50);
Expand Down
1 change: 0 additions & 1 deletion layout/reftests/xul/accesskey-ref.xhtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="data:text/css,:root { -moz-box-layout: flex }" type="text/css"?>
<?xml-stylesheet href="data:text/css,u { display: inline; text-decoration: underline; }" type="text/css"?>

<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
Expand Down
1 change: 0 additions & 1 deletion layout/reftests/xul/accesskey.xhtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="data:text/css,:root { -moz-box-layout: flex }" type="text/css"?>

<!-- This test checks that access keys are rendered properly, both when set with the
accesskey attribute in the markup and updated via script later.
Expand Down
1 change: 0 additions & 1 deletion layout/reftests/xul/text-crop.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
font-family: firasans;
src: url(../fonts/fira/FiraSans-Regular.otf);
}
:root { -moz-box-layout: flex }
vbox {
font-family: firasans;
font-size: 40px;
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsStyleConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ enum class StyleTextOrientation : uint8_t {

// Whether to emulate -moz-box with flex. See nsStyleVisibility
enum class StyleMozBoxLayout : uint8_t {
Legacy,
Flex,
Legacy,
};

// See nsStyleText
Expand Down
2 changes: 1 addition & 1 deletion layout/style/nsStyleStruct.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2704,7 +2704,7 @@ nsStyleVisibility::nsStyleVisibility(const Document& aDocument)
mImageRendering(StyleImageRendering::Auto),
mWritingMode(StyleWritingModeProperty::HorizontalTb),
mTextOrientation(StyleTextOrientation::Mixed),
mMozBoxLayout(StyleMozBoxLayout::Legacy),
mMozBoxLayout(StyleMozBoxLayout::Flex),
mPrintColorAdjust(StylePrintColorAdjust::Economy),
mImageOrientation(StyleImageOrientation::FromImage) {
MOZ_COUNT_CTOR(nsStyleVisibility);
Expand Down
1 change: 0 additions & 1 deletion layout/style/test/chrome/chrome-only-media-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const CHROME_ONLY_TOGGLES = [
"-moz-gtk-csd-maximize-button",
"-moz-gtk-csd-close-button",
"-moz-gtk-csd-reversed-placement",
"-moz-box-flexbox-emulation",
"-moz-panel-animations",
];

Expand Down
7 changes: 0 additions & 7 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9086,13 +9086,6 @@
value: true
mirror: always

# Pref to control whether we emulate all -moz-box with modern flexbox.
- name: layout.css.moz-box-flexbox-emulation.enabled
type: bool
value: true
mirror: always
rust: true

# Pref to control whether to suspend also RefreshDriver::Tick when the page
# itself is suspended because of some synchronous operation, like sync XHR.
- name: layout.skip_ticks_while_page_suspended
Expand Down
6 changes: 1 addition & 5 deletions servo/components/style/gecko/media_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ macro_rules! bool_pref_feature {
/// to support new types in these entries and (2) ensuring that either
/// nsPresContext::MediaFeatureValuesChanged is called when the value that
/// would be returned by the evaluator function could change.
pub static MEDIA_FEATURES: [QueryFeatureDescription; 64] = [
pub static MEDIA_FEATURES: [QueryFeatureDescription; 63] = [
feature!(
atom!("width"),
AllowsRanges::Yes,
Expand Down Expand Up @@ -916,10 +916,6 @@ pub static MEDIA_FEATURES: [QueryFeatureDescription; 64] = [
),
lnf_int_feature!(atom!("-moz-system-dark-theme"), SystemUsesDarkTheme),
lnf_int_feature!(atom!("-moz-panel-animations"), PanelAnimations),
bool_pref_feature!(
atom!("-moz-box-flexbox-emulation"),
"layout.css.moz-box-flexbox-emulation.enabled"
),
// media query for MathML Core's implementation of maction/semantics
bool_pref_feature!(
atom!("-moz-mathml-core-maction-and-semantics"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ${helpers.single_keyword(

${helpers.single_keyword(
"-moz-box-layout",
"legacy flex",
"flex legacy",
engines="gecko",
gecko_enum_prefix="StyleMozBoxLayout",
animation_value_type="none",
Expand Down
4 changes: 0 additions & 4 deletions toolkit/components/alerts/alert.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root {
-moz-box-layout: flex;
}

#alertBox[animate] {
animation-duration: 20s;
animation-fill-mode: both;
Expand Down
13 changes: 0 additions & 13 deletions toolkit/content/xul.css
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,6 @@ iframe {
display: inline;
}

@media (-moz-box-flexbox-emulation) {
*|*:root {
-moz-box-layout: flex;
}
}

/* Allow the browser to shrink below its intrinsic size, to match legacy
* behavior */
browser {
Expand Down Expand Up @@ -731,13 +725,6 @@ wizard {
min-height: 30em;
}

.wizard-window {
/* TODO: This can be removed once
* layout.css.moz-box-flexbox-emulation.enabled
* is true unconditionally */
-moz-box-layout: flex;
}

wizard > wizardpage {
grid-area: 1 / 1;
min-height: 0;
Expand Down
1 change: 0 additions & 1 deletion toolkit/mozapps/extensions/content/aboutaddons.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root {
-moz-box-layout: flex;
--addon-icon-size: 32px;
--card-border-zap-gradient: linear-gradient(90deg, #9059FF 0%, #FF4AA2 52.08%, #FFBD4F 100%);
--main-margin-start: 28px;
Expand Down
2 changes: 0 additions & 2 deletions toolkit/themes/osx/mozapps/downloads/unknownContentType.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root { -moz-box-layout: flex }

#unknownContentType {
font: menu;
}
Expand Down
1 change: 0 additions & 1 deletion toolkit/themes/shared/in-content/common-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@
appearance: none;
background-color: var(--in-content-page-background);
color: var(--in-content-page-color);
-moz-box-layout: flex;
}

:root:not(.system-font-size) {
Expand Down
4 changes: 0 additions & 4 deletions toolkit/themes/shared/profileDowngrade.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root {
-moz-box-layout: flex;
}

dialog::part(button-spacer) {
display: none;
}
Expand Down
2 changes: 0 additions & 2 deletions toolkit/themes/shared/profileSelection.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

@import url("chrome://global/skin/global.css");

:root { -moz-box-layout: flex }

#managebuttons {
padding-top: 1em;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

:root { -moz-box-layout: flex; }

#type {
-moz-box-flex: 1;
background-color: transparent;
Expand Down
1 change: 0 additions & 1 deletion widget/nsXPLookAndFeel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ static constexpr struct {
// need to re-layout.
{"browser.theme.toolbar-theme"_ns, widget::ThemeChangeKind::AllBits},
{"browser.theme.content-theme"_ns},
{"layout.css.moz-box-flexbox-emulation.enabled"_ns},
{"mathml.legacy_maction_and_semantics_implementations.disabled"_ns},
{"mathml.ms_lquote_rquote_attributes.disabled"_ns},
};
Expand Down
1 change: 0 additions & 1 deletion xpcom/ds/StaticAtoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,6 @@
Atom("_moz_content_prefers_color_scheme", "-moz-content-prefers-color-scheme"),
Atom("_moz_content_preferred_color_scheme", "-moz-content-preferred-color-scheme"),
Atom("_moz_system_dark_theme", "-moz-system-dark-theme"),
Atom("_moz_box_flexbox_emulation", "-moz-box-flexbox-emulation"),
Atom("_moz_panel_animations", "-moz-panel-animations"),
# application commands
Atom("Back", "Back"),
Expand Down

0 comments on commit 22b9349

Please sign in to comment.