Bug 1424095 - Tweak frontend CSS to play nicely in XUL flexbox emulation mode;r=Gijs

There are still known issues with the browser chrome when emulating, but this changeset is
done in service of getting the UI to be close enough to start running Talos tests against
it in Bug 1425330.

MozReview-Commit-ID: B0w1aOmi4FJ

--HG--
extra : rebase_source : e8b13f9203f0e368fb6f36bc9d2059fff7061b54
This commit is contained in:
Brian Grinstead 2018-01-04 10:25:30 -08:00
parent aba250b512
commit 7748a17ff2
6 changed files with 91 additions and 1 deletions

View File

@ -272,7 +272,7 @@ var TabsInTitlebar = {
_sizePlaceholder(type, width) {
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
function(node) { node.width = width; });
function(node) { node.style.width = width + "px"; });
},
uninit() {

View File

@ -97,6 +97,18 @@ tabbrowser {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-tabs");
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
#tabbrowser-tabs {
/* Without this, the tabs container width extends beyond the window width */
width: 0;
}
.tab-stack {
/* Without this, pinned tabs get a bit too tall when the tabstrip overflows. */
vertical-align: top;
}
}
#tabbrowser-tabs:not([overflow="true"]) ~ #alltabs-button,
#tabbrowser-tabs[hasadjacentnewtabbutton]:not([overflow="true"]) ~ #new-tab-button,
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,

View File

@ -309,6 +309,14 @@ description#identity-popup-content-verifier,
padding-bottom: 1.5em;
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
/* The extra padding-bottom is there to work around XUL flex (Bug 1368281).
This rule and the 1.5em above can both be removed once we are only using CSS flex. */
#identity-popup-permissions-content {
padding-bottom: 1em;
}
}
#identity-popup-permissions-headline {
/* Make sure the label is as tall as the icon so that the permission list
which is aligned with the icon doesn't cover it up. */

View File

@ -45,6 +45,19 @@ tabbrowser {
min-height: inherit;
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
.tab-stack {
/* Needed to allow tabs to shrink to be skinnier than their page-title: */
min-width: 0;
}
.scrollbox-innerbox {
/* Needed to prevent tabstrip from growing as wide as the sum of the tabs'
page-title widths (when we'd rather have it be as wide as the window and
compress the tabs to their minimum size): */
max-width: 100%;
}
}
.tabbrowser-tab {
-moz-appearance: none;
background-color: transparent;

View File

@ -20,6 +20,16 @@ html|*.textbox-textarea {
-moz-box-flex: 1;
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
html|*.textbox-input,
html|*.textbox-textarea {
/* Be block-level, so that -moz-box-flex can take effect, when we are an item
in a -moz-box being emulated by modified modern flex. */
display: block;
}
}
/*
html|*.textbox-input::placeholder,
html|*.textbox-textarea::placeholder {

View File

@ -1055,3 +1055,50 @@ tabmodalprompt {
.menu-iconic-text[highlightable="true"] {
display: none;
}
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
/* Support common XUL attributes in the emulated flex mode so we can
test the browser in this configuration without mass-changing existing
markup and CSS. */
[orient="vertical"] { -moz-box-orient: vertical; }
[orient="horizontal"] { -moz-box-orient: horizontal; }
[dir="reverse"] { -moz-box-direction: reverse; }
[align="start"] { -moz-box-align: start; }
[align="center"] { -moz-box-align: center; }
[align="end"] { -moz-box-align: end; }
[align="baseline"] { -moz-box-align: baseline; }
[align="stretch"] { -moz-box-align: stretch; }
[pack="start"] { -moz-box-pack: start; }
[pack="center"] { -moz-box-pack: center; }
[pack="end"] { -moz-box-pack: end; }
/* This isn't a real solution for [flex] and [ordinal], but it covers enough
cases to render the browser chrome. If we get attr() in Bug 435426 this could
work for all cases. */
[flex="1"] { -moz-box-flex: 1; }
[flex="2"] { -moz-box-flex: 2; }
[flex="3"] { -moz-box-flex: 3; }
[flex="4"] { -moz-box-flex: 4; }
[flex="5"] { -moz-box-flex: 5; }
[flex="6"] { -moz-box-flex: 6; }
[flex="7"] { -moz-box-flex: 7; }
[flex="8"] { -moz-box-flex: 8; }
[flex="9"] { -moz-box-flex: 9; }
[flex="100"] { -moz-box-flex: 100; }
[flex="400"] { -moz-box-flex: 400; }
[flex="1000"] { -moz-box-flex: 1000; }
[ordinal="1"] { -moz-box-ordinal-group: 1; }
[ordinal="2"] { -moz-box-ordinal-group: 2; }
[ordinal="3"] { -moz-box-ordinal-group: 3; }
[ordinal="4"] { -moz-box-ordinal-group: 4; }
[ordinal="5"] { -moz-box-ordinal-group: 5; }
[ordinal="6"] { -moz-box-ordinal-group: 6; }
[ordinal="7"] { -moz-box-ordinal-group: 7; }
[ordinal="8"] { -moz-box-ordinal-group: 8; }
[ordinal="9"] { -moz-box-ordinal-group: 9; }
[ordinal="1000"] { -moz-box-ordinal-group: 1000; }
}