Bug 1784265 - Drop support for flex attribute values other than 0 and 1. r=dholbert,mconley,preferences-reviewers

This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.

Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).

In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.

Add a debug-only assertion to ensure we preserve behavior for now.

Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.

Differential Revision: https://phabricator.services.mozilla.com/D154394
This commit is contained in:
Emilio Cobos Álvarez 2022-08-12 19:34:34 +00:00
Родитель 1bd1fb12a6
Коммит a2ec6564f3
61 изменённых файлов: 304 добавлений и 223 удалений

Просмотреть файл

@ -5,20 +5,16 @@
<hbox flex="1" id="browser">
<vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
<box id="sidebar-header" align="center">
<toolbarbutton id="sidebar-switcher-target" flex="1" class="tabbable">
<toolbarbutton id="sidebar-switcher-target" class="tabbable">
<image id="sidebar-icon" consumeanchor="sidebar-switcher-target"/>
<label id="sidebar-title" crop="end" flex="1" control="sidebar"/>
<label id="sidebar-title" crop="end" control="sidebar"/>
<image id="sidebar-switcher-arrow"/>
</toolbarbutton>
<image id="sidebar-throbber"/>
# To ensure the button label's intrinsic width doesn't expand the sidebar
# if the label is long, the button needs flex=1.
# To ensure the button doesn't expand unnecessarily for short labels, the
# spacer should significantly out-flex the button.
<spacer flex="1000"/>
<spacer id="sidebar-spacer"/>
<toolbarbutton id="sidebar-close" class="close-icon tabbable" data-l10n-id="sidebar-close-button" oncommand="SidebarUI.hide();"/>
</box>
<browser id="sidebar" flex="1" autoscroll="false" disablehistory="true" disablefullscreen="true"
<browser id="sidebar" autoscroll="false" disablehistory="true" disablefullscreen="true"
style="min-width: 14em; width: 18em; max-width: 36em;" tooltip="aHTMLTooltip"/>
</vbox>

Просмотреть файл

@ -32,8 +32,21 @@ body {
min-width: -moz-fit-content;
}
/* Prevent shrinking the page content to 0 height and width */
/* We set large flex on both containers to allow the devtools toolbox to
* set a flex value itself. We don't want the toolbox to actually take up free
* space, but we do want it to collapse when the window shrinks, and with
* flex: 0 it can't.
*
* When the toolbox is on the bottom it's a sibling of browserStack, and when
* it's on the side it's a sibling of browserContainer.
*/
.browserContainer {
-moz-box-flex: 10000;
}
.browserStack {
-moz-box-flex: 10000;
/* Prevent shrinking the page content to 0 height and width */
min-height: 25px;
min-width: 25px;
}

Просмотреть файл

@ -155,7 +155,7 @@
</toolbarbutton>
</toolbaritem>
<toolbarspring cui-areatype="toolbar" class="chromeclass-toolbar-additional"/>
<toolbaritem id="urlbar-container" flex="400" persist="width"
<toolbaritem id="urlbar-container" persist="width"
removable="false"
class="chromeclass-location" overflows="false">
<toolbartabstop/>
@ -654,7 +654,6 @@
class="chromeclass-toolbar-additional"
data-l10n-id="navbar-search"
align="center"
flex="175"
persist="width">
<toolbartabstop/>
<searchbar id="searchbar" flex="1"/>

Просмотреть файл

@ -833,17 +833,17 @@ function onImageSelect() {
previewBox.collapsed = true;
mediaSaveBox.collapsed = true;
splitter.collapsed = true;
tree.flex = 1;
tree.setAttribute("flex", "1");
} else if (count > 1) {
splitter.collapsed = true;
previewBox.collapsed = true;
mediaSaveBox.collapsed = false;
tree.flex = 1;
tree.setAttribute("flex", "1");
} else {
mediaSaveBox.collapsed = true;
splitter.collapsed = false;
previewBox.collapsed = false;
tree.flex = 0;
tree.setAttribute("flex", "0");
makePreview(getSelectedRows(tree)[0]);
}
}

Просмотреть файл

@ -152,11 +152,11 @@
<tree id="metatree" flex="1" hidecolumnpicker="true" contextmenu="picontext">
<treecols>
<treecol id="meta-name" data-l10n-id="general-meta-name"
persist="width" flex="1"
persist="width" style="-moz-box-flex: 1"
onclick="gMetaView.onPageMediaSort('meta-name');"/>
<splitter class="tree-splitter"/>
<treecol id="meta-content" data-l10n-id="general-meta-content"
persist="width" flex="4"
persist="width" style="-moz-box-flex: 4"
onclick="gMetaView.onPageMediaSort('meta-content');"/>
</treecols>
<treechildren id="metatreechildren" flex="1"/>
@ -172,23 +172,23 @@
<tree id="imagetree" onselect="onImageSelect();" contextmenu="picontext"
ondragstart="onBeginLinkDrag(event, 'image-address', 'image-alt')">
<treecols>
<treecol primary="true" persist="width" flex="10"
<treecol primary="true" persist="width" style="-moz-box-flex: 10"
width="10" id="image-address" data-l10n-id="media-address"
onclick="gImageView.onPageMediaSort('image-address');"/>
<splitter class="tree-splitter"/>
<treecol persist="hidden width" flex="2"
<treecol persist="hidden width" style="-moz-box-flex: 2"
width="2" id="image-type" data-l10n-id="media-type"
onclick="gImageView.onPageMediaSort('image-type');"/>
<splitter class="tree-splitter"/>
<treecol hidden="true" persist="hidden width" flex="2"
<treecol hidden="true" persist="hidden width" style="-moz-box-flex: 2"
width="2" id="image-size" data-l10n-id="media-size" value="size"
onclick="gImageView.onPageMediaSort('image-size');"/>
<splitter class="tree-splitter"/>
<treecol hidden="true" persist="hidden width" flex="4"
width="4" id="image-alt" data-l10n-id="media-alt-header"
<treecol hidden="true" persist="hidden width" style="-moz-box-flex: 4"
width="4" id="image-alt" data-l10n-id="media-alt-header"
onclick="gImageView.onPageMediaSort('image-alt');"/>
<splitter class="tree-splitter"/>
<treecol hidden="true" persist="hidden width" flex="1"
<treecol hidden="true" persist="hidden width" style="-moz-box-flex: 1"
width="1" id="image-count" data-l10n-id="media-count"
onclick="gImageView.onPageMediaSort('image-count');"/>
</treecols>

Просмотреть файл

@ -2161,22 +2161,14 @@
let notificationbox = document.createXULElement("notificationbox");
notificationbox.setAttribute("notificationside", "top");
// We set large flex on both containers to allow the devtools toolbox to
// set a flex attribute. We don't want the toolbox to actually take up free
// space, but we do want it to collapse when the window shrinks, and with
// flex=0 it can't. When the toolbox is on the bottom it's a sibling of
// browserStack, and when it's on the side it's a sibling of
// browserContainer.
let stack = document.createXULElement("stack");
stack.className = "browserStack";
stack.appendChild(b);
stack.setAttribute("flex", "10000");
let browserContainer = document.createXULElement("vbox");
browserContainer.className = "browserContainer";
browserContainer.appendChild(notificationbox);
browserContainer.appendChild(stack);
browserContainer.setAttribute("flex", "10000");
let browserSidebarContainer = document.createXULElement("hbox");
browserSidebarContainer.className = "browserSidebarContainer";

Просмотреть файл

@ -341,7 +341,7 @@
<treechildren flex="1"/>
</tree>
<splitter collapse="none" persist="state"></splitter>
<vbox id="contentView" flex="4">
<vbox id="contentView" style="-moz-box-flex: 4">
<vbox id="placesViewsBox" flex="1">
<tree id="placeContent"
class="plain placesTree"
@ -365,25 +365,25 @@
the CSS lives in toolkit/content/widget/tree.js and is specific to
tree elements.
-->
<treecol data-l10n-id="places-view-sort-col-name" id="placesContentTitle" anonid="title" flex="5" primary="true" ordinal="1"
<treecol data-l10n-id="places-view-sort-col-name" id="placesContentTitle" anonid="title" style="-moz-box-flex: 5" primary="true" ordinal="1"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-tags" id="placesContentTags" anonid="tags" flex="2"
<treecol data-l10n-id="places-view-sort-col-tags" id="placesContentTags" anonid="tags" style="-moz-box-flex: 2"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-url" id="placesContentUrl" anonid="url" flex="5"
<treecol data-l10n-id="places-view-sort-col-url" id="placesContentUrl" anonid="url" style="-moz-box-flex: 5"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-most-recent-visit" id="placesContentDate" anonid="date" flex="1" hidden="true"
<treecol data-l10n-id="places-view-sort-col-most-recent-visit" id="placesContentDate" anonid="date" style="-moz-box-flex: 1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-visit-count" id="placesContentVisitCount" anonid="visitCount" flex="1" hidden="true"
<treecol data-l10n-id="places-view-sort-col-visit-count" id="placesContentVisitCount" anonid="visitCount" style="-moz-box-flex: 1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-date-added" id="placesContentDateAdded" anonid="dateAdded" flex="1" hidden="true"
<treecol data-l10n-id="places-view-sort-col-date-added" id="placesContentDateAdded" anonid="dateAdded" style="-moz-box-flex: 1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
<splitter class="tree-splitter"/>
<treecol data-l10n-id="places-view-sort-col-last-modified" id="placesContentLastModified" anonid="lastModified" flex="1" hidden="true"
<treecol data-l10n-id="places-view-sort-col-last-modified" id="placesContentLastModified" anonid="lastModified" style="-moz-box-flex: 1" hidden="true"
persist="width hidden ordinal sortActive sortDirection"/>
</treecols>
<treechildren flex="1" onclick="ContentTree.onClick(event);"/>
@ -397,12 +397,12 @@
</vbox>
<vbox id="detailsPane" style="height: 11em;">
<vbox id="itemsCountBox" align="center" flex="1" hidden="true">
<spacer flex="3"/>
<spacer style="-moz-box-flex: 3"/>
<label id="itemsCountText"/>
<spacer flex="1"/>
<description id="selectItemDescription" data-l10n-id="places-details-pane-select-an-item-description">
</description>
<spacer flex="3"/>
<spacer style="-moz-box-flex: 3"/>
</vbox>
<vbox id="infoBox" flex="1">
#include editBookmarkPanel.inc.xhtml

Просмотреть файл

@ -41,9 +41,9 @@
hidecolumnpicker="true"
onselect="gBlocklistManager.onListSelected();">
<treecols>
<treecol id="selectionCol" label="" flex="1" sortable="false"
<treecol id="selectionCol" label="" style="-moz-box-flex: 1" sortable="false"
type="checkbox"/>
<treecol id="listCol" data-l10n-id="blocklist-treehead-list" flex="80"
<treecol id="listCol" data-l10n-id="blocklist-treehead-list" style="-moz-box-flex: 80"
sortable="false"/>
</treecols>
<treechildren/>

Просмотреть файл

@ -354,7 +354,7 @@ var gPermissionManager = {
let richlistitem = document.createXULElement("richlistitem");
richlistitem.setAttribute("origin", permission.origin);
let row = document.createXULElement("hbox");
row.setAttribute("flex", "1");
row.setAttribute("style", "-moz-box-flex: 1");
let hbox = document.createXULElement("hbox");
let website = document.createXULElement("label");
@ -363,7 +363,7 @@ var gPermissionManager = {
website.setAttribute("value", permission.origin);
hbox.setAttribute("width", "0");
hbox.setAttribute("class", "website-name");
hbox.setAttribute("flex", "3");
hbox.setAttribute("style", "-moz-box-flex: 3");
hbox.appendChild(website);
row.appendChild(hbox);
@ -378,7 +378,7 @@ var gPermissionManager = {
);
hbox.setAttribute("width", "0");
hbox.setAttribute("class", "website-name");
hbox.setAttribute("flex", "1");
hbox.setAttribute("style", "-moz-box-flex: 1");
hbox.appendChild(capability);
row.appendChild(hbox);
}

Просмотреть файл

@ -58,9 +58,9 @@
</hbox>
<separator class="thin"/>
<listheader>
<treecol id="siteCol" data-l10n-id="permissions-site-name" flex="3" width="0"
<treecol id="siteCol" data-l10n-id="permissions-site-name" style="-moz-box-flex: 3" width="0"
onclick="gPermissionManager.buildPermissionsList(event.target)"/>
<treecol id="statusCol" data-l10n-id="permissions-status" flex="1" width="0"
<treecol id="statusCol" data-l10n-id="permissions-status" style="-moz-box-flex: 1" width="0"
data-isCurrentSortCol="true"
onclick="gPermissionManager.buildPermissionsList(event.target);"/>
</listheader>

Просмотреть файл

@ -41,7 +41,7 @@ let gSiteDataSettings = {
function addColumnItem(l10n, flexWidth, tooltipText) {
let box = document.createXULElement("hbox");
box.className = "item-box";
box.setAttribute("flex", flexWidth);
box.setAttribute("style", `-moz-box-flex: ${flexWidth}`);
let label = document.createXULElement("label");
label.setAttribute("crop", "end");
if (l10n) {

Просмотреть файл

@ -42,11 +42,11 @@
<separator class="thin"/>
<listheader>
<treecol flex="4" width="50" data-l10n-id="site-data-column-host" id="hostCol"/>
<treecol flex="1" width="50" data-l10n-id="site-data-column-cookies" id="cookiesCol"/>
<treecol style="-moz-box-flex: 4" width="50" data-l10n-id="site-data-column-host" id="hostCol"/>
<treecol style="-moz-box-flex: 1" width="50" data-l10n-id="site-data-column-cookies" id="cookiesCol"/>
<!-- Sorted by usage so the user can quickly see which sites use the most data. -->
<treecol flex="2" width="50" data-l10n-id="site-data-column-storage" id="usageCol" data-isCurrentSortCol="true"/>
<treecol flex="2" width="50" data-l10n-id="site-data-column-last-used" id="lastAccessedCol" />
<treecol style="-moz-box-flex: 2" width="50" data-l10n-id="site-data-column-storage" id="usageCol" data-isCurrentSortCol="true"/>
<treecol style="-moz-box-flex: 2" width="50" data-l10n-id="site-data-column-last-used" id="lastAccessedCol" />
</listheader>
<richlistbox seltype="multiple" id="sitesList" orient="vertical" flex="1"/>
</vbox>

Просмотреть файл

@ -351,18 +351,18 @@ var gSitePermissionsManager = {
let richlistitem = document.createXULElement("richlistitem");
richlistitem.setAttribute("origin", permission.origin);
let row = document.createXULElement("hbox");
row.setAttribute("flex", "1");
row.setAttribute("style", "-moz-box-flex: 1");
let hbox = document.createXULElement("hbox");
let website = document.createXULElement("label");
website.setAttribute("value", permission.origin);
website.setAttribute("width", width);
hbox.setAttribute("class", "website-name");
hbox.setAttribute("flex", "3");
hbox.setAttribute("style", "-moz-box-flex: 1");
hbox.appendChild(website);
let menulist = document.createXULElement("menulist");
menulist.setAttribute("flex", "1");
menulist.setAttribute("style", "-moz-box-flex: 1");
menulist.setAttribute("width", width);
menulist.setAttribute("class", "website-status");
let states = SitePermissions.getAvailableStates(permission.type);

Просмотреть файл

@ -49,9 +49,9 @@
</hbox>
<separator class="thin"/>
<listheader>
<treecol id="siteCol" data-l10n-id="permissions-site-name" flex="3" width="75"
<treecol id="siteCol" data-l10n-id="permissions-site-name" style="-moz-box-flex: 3" width="75"
onclick="gSitePermissionsManager.buildPermissionsList(event.target)"/>
<treecol id="statusCol" data-l10n-id="permissions-status" flex="1" width="75"
<treecol id="statusCol" data-l10n-id="permissions-status" style="-moz-box-flex: 1" width="75"
data-isCurrentSortCol="true"
onclick="gSitePermissionsManager.buildPermissionsList(event.target);"/>
</listheader>

Просмотреть файл

@ -18,6 +18,16 @@
border-bottom: 1px solid var(--sidebar-border-color);
}
#sidebar-spacer {
/* To ensure the button doesn't expand unnecessarily for short labels, the
spacer should significantly out-flex the button. */
-moz-box-flex: 1000;
}
#sidebar {
-moz-box-flex: 1;
}
@media not (-moz-platform: linux) {
/* We don't let the splitter overlap the sidebar on Linux since the sidebar's
scrollbar is too narrow on Linux. */
@ -55,6 +65,7 @@
margin: 0;
padding: 0;
padding-inline: 8px 4px;
-moz-box-flex: 1;
}
#sidebar-switcher-arrow {
@ -76,6 +87,7 @@
border-radius: var(--toolbarbutton-border-radius);
border: 1px solid transparent;
padding: 2px 4px;
-moz-box-flex: 1;
}
#sidebar-switcher-target:hover {

Просмотреть файл

@ -265,6 +265,7 @@
#urlbar-container {
-moz-box-align: center;
-moz-box-flex: 400;
}
#urlbar-search-splitter {
@ -638,6 +639,7 @@
#search-container {
min-width: 125px;
-moz-box-flex: 175;
}
#search-container[cui-areatype="menu-panel"] > #searchbar:-moz-lwtheme {

Просмотреть файл

@ -420,7 +420,7 @@ function focusTab(tab) {
function createDevToolsFrame(doc, className) {
const frame = doc.createXULElement("browser");
frame.setAttribute("type", "content");
frame.flex = 1; // Required to be able to shrink when the window shrinks
frame.setAttribute("flex", "1"); // Required to be able to shrink when the window shrinks
frame.className = className;
const inXULDocument = doc.documentElement.namespaceURI === XUL_NS;

Просмотреть файл

@ -23,19 +23,15 @@
<script src="chrome://devtools/content/framework/toolbox-init.js"/>
<vbox id="toolbox-container" flex="1" role="group">
<vbox id="toolbox-container" role="group">
<div xmlns="http://www.w3.org/1999/xhtml" id="toolbox-error-mount"/>
<div xmlns="http://www.w3.org/1999/xhtml" id="toolbox-notificationbox"/>
<div xmlns="http://www.w3.org/1999/xhtml" id="toolbox-toolbar-mount"
role="toolbar" />
<vbox flex="1" class="theme-body">
<!-- Set large flex to allow the toolbox-panel-webconsole to have a
height set to a small value without flexing to fill up extra
space. There must be a flex on both to ensure that the console
panel itself is sized properly -->
<box id="toolbox-deck" flex="10000" minheight="75" />
<box id="toolbox-deck" />
<splitter id="toolbox-console-splitter" class="devtools-horizontal-splitter" hidden="true" />
<box minheight="75" flex="1" id="toolbox-panel-webconsole" collapsed="true" />
<box id="toolbox-panel-webconsole" collapsed="true" />
</vbox>
<tooltip id="aHTMLTooltip" page="true" />
</vbox>

Просмотреть файл

@ -327,7 +327,7 @@ Editor.prototype = {
env = el.ownerDocument.createElementNS(el.namespaceURI, "iframe");
if (el.namespaceURI === XUL_NS) {
env.flex = 1;
env.setAttribute("flex", "1");
}
}

Просмотреть файл

@ -521,6 +521,11 @@
-moz-user-focus: ignore;
}
#toolbox-panel-webconsole {
min-height: 75px;
-moz-box-flex: 1;
}
/**
* Enrure that selected toolbox panel's contents are keyboard accessible as they
* are explicitly made not to be when hidden (default).
@ -529,11 +534,21 @@
-moz-user-focus: normal;
}
/* Let the component gain focus when a click hits an empty area */
#toolbox-container {
-moz-box-flex: 1;
/* Let the component gain focus when a click hits an empty area */
-moz-user-focus: normal;
}
#toolbox-deck {
min-height: 75px;
/* Set large flex to allow the toolbox-panel-webconsole to have a
height set to a small value without flexing to fill up extra
space. There must be a flex on both to ensure that the console
panel itself is sized properly */
-moz-box-flex: 10000;
}
#toolbox-container:focus {
outline: 0;
}

Просмотреть файл

@ -1,5 +1,5 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="try { document.cloneNode(true); } catch (e) { }">
<image src="tree.gif" width="49" height="60" flex="none" />
<image src="tree.gif" width="49" height="60" style="-moz-box-flex: 0" />
</window>

Просмотреть файл

@ -40,14 +40,14 @@
</groupbox>
</hbox>
<hbox>
<input xmlns="http://www.w3.org/1999/xhtml" id="currentStatus" readonly="true" flex="1"/>
<progressmeter id="currentProgress" mode="normal" value="0" flex="2"/>
<progressmeter id="totalProgress" mode="normal" value="0" flex="2"/>
<input xmlns="http://www.w3.org/1999/xhtml" id="currentStatus" readonly="true" style="-moz-box-flex: 1"/>
<progressmeter id="currentProgress" mode="normal" value="0" style="-moz-box-flex: 2"/>
<progressmeter id="totalProgress" mode="normal" value="0" style="-moz-box-flex: 2"/>
</hbox>
<hbox flex="1">
<html:textarea id="transformOutput" class="out" readonly="readonly" flex="1"/>
<hbox style="-moz-box-flex: 1">
<html:textarea id="transformOutput" class="out" readonly="readonly" style="-moz-box-flex: 1"/>
</hbox>
<hbox flex="1">
<html:textarea id="transformDetailedOutput" class="out" readonly="readonly" flex="1"/>
<hbox style="-moz-box-flex: 1">
<html:textarea id="transformDetailedOutput" class="out" readonly="readonly" style="-moz-box-flex: 1"/>
</hbox>
</window>

Просмотреть файл

@ -40,7 +40,6 @@ nsresult XULTooltipElement::Init() {
NS_ENSURE_SUCCESS(rv, rv);
description->SetAttr(kNameSpaceID_None, nsGkAtoms::_class,
u"tooltip-label"_ns, false);
description->SetAttr(kNameSpaceID_None, nsGkAtoms::flex, u"true"_ns, false);
ErrorResult error;
AppendChild(*description, error);

Просмотреть файл

@ -846,6 +846,28 @@ nsresult nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
aSubjectPrincipal, aNotify);
}
void nsXULElement::GetFlex(DOMString& aValue) const {
#ifdef DEBUG
printf_stderr("\n");
ListAttributes(stderr);
xpc_DumpJSStack(true, true, false);
printf_stderr("\n");
MOZ_ASSERT_UNREACHABLE("XULElement.flex getter");
#endif
GetXULAttr(nsGkAtoms::flex, aValue);
}
void nsXULElement::SetFlex(const nsAString& aValue, ErrorResult& aRv) {
#ifdef DEBUG
printf_stderr("\n");
ListAttributes(stderr);
xpc_DumpJSStack(true, true, false);
printf_stderr("\n");
MOZ_ASSERT_UNREACHABLE("XULElement.flex setter");
#endif
SetXULAttr(nsGkAtoms::flex, aValue, aRv);
}
void nsXULElement::AddTooltipSupport() {
nsXULTooltipListener* listener = nsXULTooltipListener::GetInstance();
if (!listener) {

Просмотреть файл

@ -398,10 +398,9 @@ class nsXULElement : public nsStyledElement {
}
// WebIDL API
void GetFlex(DOMString& aValue) const { GetXULAttr(nsGkAtoms::flex, aValue); }
void SetFlex(const nsAString& aValue, mozilla::ErrorResult& rv) {
SetXULAttr(nsGkAtoms::flex, aValue, rv);
}
void GetFlex(DOMString& aValue) const;
void SetFlex(const nsAString& aValue, mozilla::ErrorResult&);
bool Hidden() const { return BoolAttrIsTrue(nsGkAtoms::hidden); }
void SetHidden(bool aHidden) { SetXULBoolAttr(nsGkAtoms::hidden, aHidden); }
bool Collapsed() const { return BoolAttrIsTrue(nsGkAtoms::collapsed); }

Просмотреть файл

@ -10603,10 +10603,10 @@ nsSize nsIFrame::GetXULMaxSize(nsBoxLayoutState& aState) {
return size;
}
nscoord nsIFrame::GetXULFlex() {
int32_t nsIFrame::GetXULFlex() {
nsBoxLayoutMetrics* metrics = BoxMetrics();
if (XULNeedsRecalc(metrics->mFlex)) {
nsIFrame::AddXULFlex(this, metrics->mFlex);
metrics->mFlex = nsIFrame::ComputeXULFlex(this);
}
return metrics->mFlex;

Просмотреть файл

@ -4265,7 +4265,7 @@ class nsIFrame : public nsQueryFrame {
*/
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState);
virtual nscoord GetXULFlex();
virtual int32_t GetXULFlex();
virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState);
virtual bool IsXULCollapsed();
// This does not alter the overflow area. If the caller is changing
@ -4310,7 +4310,7 @@ class nsIFrame : public nsQueryFrame {
bool& aHeightSet);
static bool AddXULMaxSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth,
bool& aHeightSet);
static bool AddXULFlex(nsIFrame* aBox, nscoord& aFlex);
static int32_t ComputeXULFlex(nsIFrame* aBox);
void AddXULBorderAndPadding(nsSize& aSize);

Просмотреть файл

@ -6,7 +6,6 @@
<head>
<style>
:root {
/* Only legacy nsBoxFrame looks at flex="" attributes, so rendering is expected to differ */
-moz-box-layout: flex;
}
hbox {

Просмотреть файл

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<head>
<style>
hbox {
width: 700px;
/* Handling of replaced elements is different between legacy and regular
* flexbox, so rendering is expected to differ */
-moz-box-layout: flex;
}
input {
-moz-box-flex: 1;
}
</style>
</head>
<body>
<xul:hbox>
<xul:description>A</xul:description>
<html:input flex="1" style="background: blue" value="B"/>
</xul:hbox>
</body>
</html>

Просмотреть файл

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<head>
<style>
hbox {
width: 700px;
}
input {
-moz-box-flex: 1;
}
</style>
</head>
<body>
<xul:hbox>
<xul:description>A</xul:description>
<html:input flex="1" style="background: blue" value="B"/>
</xul:hbox>
</body>
</html>

Просмотреть файл

@ -35,7 +35,7 @@ div > div {
<div minheight="100">minheight</div>
<div maxwidth="50">maxwidth</div>
<div maxheight="15">maxheight</div>
<div flex="100">flex</div>
<div style="-moz-box-flex: 100">flex</div>
</div>
</body>
</html>

Просмотреть файл

@ -35,7 +35,7 @@ div > div {
<div minheight="100">minheight</div>
<div maxwidth="50">maxwidth</div>
<div maxheight="15">maxheight</div>
<div flex="100">flex</div>
<div style="-moz-box-flex: 100">flex</div>
</div>
</body>
</html>

Просмотреть файл

@ -31,7 +31,7 @@ body > div {
<input type="text" minheight="100" value="minheight" />
<input type="text" maxwidth="50" value="maxwidth" />
<input type="text" maxheight="15" value="maxheight" />
<input type="text" flex="100" value="flex" />
<input type="text" style="-moz-box-flex: 100" value="flex" />
</div>
</body>
</html>

Просмотреть файл

@ -29,7 +29,7 @@ body > div {
<input type="text" minheight="100" value="minheight" />
<input type="text" maxwidth="50" value="maxwidth" />
<input type="text" maxheight="5" value="maxheight" />
<input type="text" flex="100" value="flex" />
<input type="text" style="-moz-box-flex: 100" value="flex" />
</div>
</body>
</html>

Просмотреть файл

@ -1,5 +1,6 @@
== chrome://reftest/content/box/box-as-grid-or-flex-item-1.html chrome://reftest/content/box/box-as-grid-or-flex-item-1-ref.html
!= chrome://reftest/content/box/flex-emulation-1.xhtml chrome://reftest/content/box/flex-emulation-1-notref.xhtml
== chrome://reftest/content/box/flex-emulation-1.xhtml chrome://reftest/content/box/flex-emulation-1-ref.xhtml
!= chrome://reftest/content/box/flex-emulation-2.xhtml chrome://reftest/content/box/flex-emulation-2-notref.xhtml
== flexbox-abspos-container-1a.html flexbox-abspos-container-1-ref.html
== flexbox-abspos-container-1b.html flexbox-abspos-container-1-ref.html

Просмотреть файл

@ -1 +1 @@
<?xml version="1.0"?><!DOCTYPE window><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><hbox><label value="test" flex="3" /><label value="test2" /><label value="test3" flex="1" /></hbox></window>
<?xml version="1.0"?><!DOCTYPE window><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><hbox><label value="test" style="-moz-box-flex: 3" /><label value="test2" /><label value="test3" style="-moz-box-flex: 1" /></hbox></window>

Просмотреть файл

@ -6,8 +6,8 @@
<!DOCTYPE window>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<label value="test" flex="3" />
<label value="test" style="-moz-box-flex: 3" />
<label value="test2" />
<label value="test3" flex="1" />
<label value="test3" style="-moz-box-flex: 1" />
</hbox>
</window>

Просмотреть файл

@ -1,7 +1,7 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox height="40">
<spacer flex="6000" style="background-color: red;"/>
<spacer style="-moz-box-flex: 6000; background-color: red;"/>
<spacer style="background-color: blue;"/>
</hbox>

Просмотреть файл

@ -1,7 +1,7 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox height="40">
<spacer flex="60000" style="background-color: red;"/>
<spacer style="-moz-box-flex: 60000; background-color: red;"/>
<spacer style="background-color: blue;"/>
</hbox>

Просмотреть файл

@ -9,6 +9,6 @@
class="reftest-image-region">
<hbox id="ref">
<image id="image1" />
<hbox flex="1000" />
<hbox style="-moz-box-flex: 1000" />
</hbox>
</window>
</window>

Просмотреть файл

@ -9,6 +9,6 @@
class="reftest-image-region">
<hbox id="test">
<image id="image1" />
<hbox flex="1000" />
<hbox style="-moz-box-flex: 1000" />
</hbox>
</window>

Просмотреть файл

@ -39,6 +39,7 @@ scrollbar[root="true"] {
slider {
appearance: auto;
-moz-default-appearance: scrollbartrack-horizontal;
-moz-box-flex: 1;
}
slider[orient="vertical"] {

Просмотреть файл

@ -4,8 +4,8 @@
<window title="Negative flex bug #2"
orient="horizontal"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<button label="Button" flex="2"/>
<label value="This is a label" flex="1"/>
<label value="This is the second label" flex="-2"/>
<label value="This is another label" flex="-1"/>
<button label="Button" style="-moz-box-flex: 2"/>
<label value="This is a label" style="-moz-box-flex: 1"/>
<label value="This is the second label" style="-moz-box-flex: -2"/>
<label value="This is another label" style="-moz-box-flex: -1"/>
</window>

Просмотреть файл

@ -4,8 +4,8 @@
<window title="Negative flex bug #2"
orient="horizontal"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<button label="Button" flex="1073741824"/>
<label value="This is a label" flex="1073741824"/>
<label value="This is the second label" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is a label" style="-moz-box-flex: 1073741824"/>
<label value="This is the second label" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
</window>

Просмотреть файл

@ -5,133 +5,133 @@
orient="vertical"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="1"/>
<button label="Button" style="-moz-box-flex: 1"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="1"/>
<button label="Button" style="-moz-box-flex: 1"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="1"/>
<button label="Button" style="-moz-box-flex: 1"/>
<label value="This is another label" style="-moz-box-flex: 1;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741823"/>
<button label="Button" style="-moz-box-flex: 1073741823"/>
<label value="This is another label" style="-moz-box-flex: 1073741823;"/>
<button label="Button" flex="2"/>
<button label="Button" style="-moz-box-flex: 2"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741824"/>
<button label="Button" style="-moz-box-flex: 1073741824"/>
<label value="This is another label" style="-moz-box-flex: 1073741824;"/>
<button label="Button" flex="2"/>
<button label="Button" style="-moz-box-flex: 2"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
<hbox>
<button label="Button" flex="1073741825"/>
<button label="Button" style="-moz-box-flex: 1073741825"/>
<label value="This is another label" style="-moz-box-flex: 1073741825;"/>
<button label="Button" flex="2"/>
<button label="Button" style="-moz-box-flex: 2"/>
<label value="This is another label" style="-moz-box-flex: 2;"/>
</hbox>
</window>

Просмотреть файл

@ -14,8 +14,8 @@ function boom()
<tree rows="6">
<treecols>
<treecol id="firstname" label="First Name" primary="true" flex="3"/>
<treecol id="lastname" label="Last Name" flex="7"/>
<treecol id="firstname" label="First Name" primary="true" style="-moz-box-flex: 3"/>
<treecol id="lastname" label="Last Name" style="-moz-box-flex: 7"/>
</treecols>
<treechildren id="tc1">

Просмотреть файл

@ -542,30 +542,36 @@ bool nsIFrame::AddXULMaxSize(nsIFrame* aBox, nsSize& aSize, bool& aWidthSet,
return (aWidthSet || aHeightSet);
}
bool nsIFrame::AddXULFlex(nsIFrame* aBox, nscoord& aFlex) {
bool flexSet = false;
int32_t nsIFrame::ComputeXULFlex(nsIFrame* aBox) {
// Get the flexibility
int32_t flex =
clamped(int32_t(aBox->StyleXUL()->mBoxFlex), 0, nscoord_MAX - 1);
// get the flexibility
aFlex = aBox->StyleXUL()->mBoxFlex;
// attribute value overrides CSS
// Attribute value overrides CSS
#ifdef DEBUG
nsIContent* content = aBox->GetContent();
if (content && content->IsXULElement()) {
nsresult error;
nsAutoString value;
content->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::flex, value);
content->AsElement()->GetAttr(nsGkAtoms::flex, value);
if (!value.IsEmpty()) {
value.Trim("%");
aFlex = value.ToInteger(&error);
flexSet = true;
int32_t attr = value.ToInteger(&error);
if (attr != flex && !aBox->Style()->IsAnonBox()) {
printf_stderr("\n");
content->AsElement()->ListAttributes(stderr);
printf_stderr("\n");
Servo_ComputedValues_DumpMatchedRules(aBox->Style());
printf_stderr("\n");
MOZ_CRASH_UNSAFE_PRINTF("No-longer-supported flex attribute detected: %d vs. %d", attr, flex);
}
}
}
#endif
if (aFlex < 0) aFlex = 0;
if (aFlex >= nscoord_MAX) aFlex = nscoord_MAX - 1;
return flexSet || aFlex > 0;
return flex;
}
void nsIFrame::AddXULBorderAndPadding(nsSize& aSize) {

Просмотреть файл

@ -673,11 +673,10 @@ nsSize nsBoxFrame::GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) {
return size;
}
nscoord nsBoxFrame::GetXULFlex() {
int32_t nsBoxFrame::GetXULFlex() {
if (XULNeedsRecalc(mFlex)) {
nsIFrame::AddXULFlex(this, mFlex);
mFlex = nsIFrame::ComputeXULFlex(this);
}
return mFlex;
}
@ -844,9 +843,9 @@ nsresult nsBoxFrame::AttributeChanged(int32_t aNameSpaceID, nsAtom* aAttribute,
aAttribute == nsGkAtoms::align || aAttribute == nsGkAtoms::valign ||
aAttribute == nsGkAtoms::minwidth || aAttribute == nsGkAtoms::maxwidth ||
aAttribute == nsGkAtoms::minheight ||
aAttribute == nsGkAtoms::maxheight || aAttribute == nsGkAtoms::flex ||
aAttribute == nsGkAtoms::orient || aAttribute == nsGkAtoms::pack ||
aAttribute == nsGkAtoms::dir || aAttribute == nsGkAtoms::equalsize) {
aAttribute == nsGkAtoms::maxheight || aAttribute == nsGkAtoms::orient ||
aAttribute == nsGkAtoms::pack || aAttribute == nsGkAtoms::dir ||
aAttribute == nsGkAtoms::equalsize) {
if (aAttribute == nsGkAtoms::align || aAttribute == nsGkAtoms::valign ||
aAttribute == nsGkAtoms::orient || aAttribute == nsGkAtoms::pack ||
aAttribute == nsGkAtoms::dir) {

Просмотреть файл

@ -63,7 +63,7 @@ class nsBoxFrame : public nsContainerFrame {
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aBoxLayoutState) override;
virtual nscoord GetXULFlex() override;
virtual int32_t GetXULFlex() override;
virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aBoxLayoutState) override;
virtual Valignment GetXULVAlign() const override { return mValign; }
virtual Halignment GetXULHAlign() const override { return mHalign; }

Просмотреть файл

@ -295,11 +295,7 @@ nsSize nsLeafBoxFrame::GetXULMaxSize(nsBoxLayoutState& aState) {
}
/* virtual */
nscoord nsLeafBoxFrame::GetXULFlex() {
nscoord flex = 0;
nsIFrame::AddXULFlex(this, flex);
return flex;
}
int32_t nsLeafBoxFrame::GetXULFlex() { return nsIFrame::ComputeXULFlex(this); }
/* virtual */
nscoord nsLeafBoxFrame::GetXULBoxAscent(nsBoxLayoutState& aState) {

Просмотреть файл

@ -23,7 +23,7 @@ class nsLeafBoxFrame : public nsLeafFrame {
virtual nsSize GetXULPrefSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULMinSize(nsBoxLayoutState& aState) override;
virtual nsSize GetXULMaxSize(nsBoxLayoutState& aState) override;
virtual nscoord GetXULFlex() override;
virtual int32_t GetXULFlex() override;
virtual nscoord GetXULBoxAscent(nsBoxLayoutState& aState) override;
virtual bool IsFrameOfType(uint32_t aFlags) const override {

Просмотреть файл

@ -404,7 +404,6 @@ nsresult nsScrollbarFrame::CreateAnonymousContent(
nodeInfoManager->GetNodeInfo(nsGkAtoms::slider, nullptr,
kNameSpaceID_XUL, nsINode::ELEMENT_NODE));
mSlider->SetAttr(kNameSpaceID_None, nsGkAtoms::orient, orient, false);
mSlider->SetAttr(kNameSpaceID_None, nsGkAtoms::flex, u"1"_ns, false);
aElements.AppendElement(ContentInfo(mSlider, key));

Просмотреть файл

@ -26,8 +26,8 @@ function boom2()
<tree rows="6" id="tree" style="display: list-item; overflow: auto; visibility: collapse;">
<treecols>
<treecol id="firstname" label="First Name" primary="true" flex="3"/>
<treecol id="lastname" label="Last Name" flex="7"/>
<treecol id="firstname" label="First Name" primary="true" style="-moz-box-flex: 3"/>
<treecol id="lastname" label="Last Name" style="-moz-box-flex: 7"/>
</treecols>
<treechildren>

Просмотреть файл

@ -2,10 +2,10 @@
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setInterval(run, 25)">
<tree flex="1" rows="2">
<tree style="-moz-box-flex: 1" rows="2">
<treecols>
<treecol id="sender" label="Sender" flex="1"/>
<treecol id="subject" label="Subject" flex="2"/>
<treecol id="sender" label="Sender" style="-moz-box-flex: 1"/>
<treecol id="subject" label="Subject" style="-moz-box-flex: 2"/>
</treecols>
<treechildren>
<treeitem>

Просмотреть файл

@ -36,10 +36,10 @@
<!-- / List of devices -->
<!-- Device status -->
<tree id="info_tree" seltype="single" hidecolumnpicker="true"
flex="3" style="min-width: 10em">
style="-moz-box-flex: 3; min-width: 10em">
<treecols>
<treecol id="title1Col" flex="5" primary="true" data-l10n-id="devmgr-header-details"/>
<treecol id="title2Col" flex="7" data-l10n-id="devmgr-header-value"/>
<treecol id="title1Col" style="-moz-box-flex: 5" primary="true" data-l10n-id="devmgr-header-details"/>
<treecol id="title2Col" style="-moz-box-flex: 7" data-l10n-id="devmgr-header-value"/>
</treecols>
<treechildren id="info_list"/>
</tree>

Просмотреть файл

@ -4210,20 +4210,22 @@ fn dump_properties_and_rules(cv: &ComputedValues, properties: &LonghandIdSet) {
#[cfg(feature = "gecko_debug")]
fn dump_rules(cv: &ComputedValues) {
println_stderr!(" Rules:");
println_stderr!(" Rules({:?}):", cv.pseudo());
let global_style_data = &*GLOBAL_STYLE_DATA;
let guard = global_style_data.shared_lock.read();
for rn in cv.rules().self_and_ancestors() {
if rn.importance().important() {
continue;
}
if let Some(d) = rn.style_source().and_then(|s| s.as_declarations()) {
println_stderr!(" [DeclarationBlock: {:?}]", d);
}
if let Some(r) = rn.style_source().and_then(|s| s.as_rule()) {
let mut s = nsCString::new();
r.read_with(&guard).to_css(&guard, &mut s).unwrap();
println_stderr!(" {}", s);
if let Some(rules) = cv.rules.as_ref() {
for rn in rules.self_and_ancestors() {
if rn.importance().important() {
continue;
}
if let Some(d) = rn.style_source().and_then(|s| s.as_declarations()) {
println_stderr!(" [DeclarationBlock: {:?}]", d);
}
if let Some(r) = rn.style_source().and_then(|s| s.as_rule()) {
let mut s = nsCString::new();
r.read_with(&guard).to_css(&guard, &mut s).unwrap();
println_stderr!(" {}", s);
}
}
}
}

Просмотреть файл

@ -160,7 +160,7 @@ FormAutofillPreferences.prototype = {
}
addressAutofillCheckboxGroup.setAttribute("align", "center");
addressAutofillCheckboxGroup.flex = 1;
addressAutofillCheckboxGroup.setAttribute("flex", "1");
formAutofillGroup.appendChild(addressAutofill);
addressAutofill.appendChild(addressAutofillCheckboxGroup);
@ -230,7 +230,7 @@ FormAutofillPreferences.prototype = {
}
creditCardAutofillCheckboxGroup.setAttribute("align", "center");
creditCardAutofillCheckboxGroup.flex = 1;
creditCardAutofillCheckboxGroup.setAttribute("flex", "1");
formAutofillGroup.appendChild(creditCardAutofill);
creditCardAutofill.appendChild(creditCardAutofillCheckboxGroup);
@ -288,7 +288,7 @@ FormAutofillPreferences.prototype = {
}
reauthCheckboxGroup.setAttribute("align", "center");
reauthCheckboxGroup.flex = 1;
reauthCheckboxGroup.setAttribute("flex", "1");
formAutofillGroup.appendChild(reauth);
reauth.appendChild(reauthCheckboxGroup);

Просмотреть файл

@ -48,6 +48,7 @@
-moz-control-character-visibility: initial;
-moz-font-smoothing-background-color: initial;
-moz-min-font-size-ratio: initial;
-moz-box-layout: initial;
math-depth: initial;
/* As long as inert implies pointer-events: none as it does now, we're
* good. */

Просмотреть файл

@ -16,7 +16,7 @@
<treecols>
<treecol id="name" label="Name" primary="true"
sort="label" properties="one two" flex="1"/>
<treecol id="address" label="Address" flex="2"/>
<treecol id="address" label="Address" style="-moz-box-flex: 2"/>
<treecol id="planet" label="Planet" flex="1"/>
<treecol id="gender" label="Gender" flex="1" cycler="true"/>
</treecols>

Просмотреть файл

@ -659,22 +659,5 @@ button, image {
[pack="center"] { -moz-box-pack: center !important; }
[pack="end"] { -moz-box-pack: end !important; }
@supports -moz-bool-pref("layout.css.emulate-moz-box-with-flex") {
/* This isn't a real solution for [flex] and [ordinal], but it covers enough
cases to render the browser chrome for us to test emulated flex mode without
mass-changing existing markup and CSS.
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; }
[flex="10000"] { -moz-box-flex: 10000; }
}
[flex="0"] { -moz-box-flex: 0 !important; }
[flex="1"] { -moz-box-flex: 1 !important; }

Просмотреть файл

@ -11,14 +11,14 @@
<script src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
<script src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"/>
<tabbox id="tabbox" flex="100%">
<tabbox id="tabbox" style="-moz-box-flex: 100">
<tabs>
<tab label="Tab 1"/>
<tab label="Tab 2"/>
</tabs>
<tabpanels flex="100%">
<browser onload="configureFirstTab();" id="tab1browser" flex="100%"/>
<browser onload="configureSecondTab();" id="tab2browser" flex="100%"/>
<tabpanels style="-moz-box-flex: 100">
<browser onload="configureFirstTab();" id="tab1browser" style="-moz-box-flex: 100"/>
<browser onload="configureSecondTab();" id="tab2browser" style="-moz-box-flex: 100"/>
</tabpanels>
</tabbox>