Merge mozilla-central to autoland. a=merge
This commit is contained in:
@@ -8,44 +8,11 @@ var TabsInTitlebar = {
|
||||
this._readPref();
|
||||
Services.prefs.addObserver(this._prefName, this);
|
||||
|
||||
// We need to update the appearance of the titlebar when the menu changes
|
||||
// from the active to the inactive state. We can't, however, rely on
|
||||
// DOMMenuBarInactive, because the menu fires this event and then removes
|
||||
// the inactive attribute after an event-loop spin.
|
||||
//
|
||||
// Because updating the appearance involves sampling the heights and margins
|
||||
// of various elements, it's important that the layout be more or less
|
||||
// settled before updating the titlebar. So instead of listening to
|
||||
// DOMMenuBarActive and DOMMenuBarInactive, we use a MutationObserver to
|
||||
// watch the "invalid" attribute directly.
|
||||
let menu = document.getElementById("toolbar-menubar");
|
||||
this._menuObserver = new MutationObserver(this._onMenuMutate);
|
||||
this._menuObserver.observe(menu, {attributes: true});
|
||||
|
||||
this.onAreaReset = function(aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this.update();
|
||||
};
|
||||
this.onWidgetAdded = this.onWidgetRemoved = function(aWidgetId, aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this.update();
|
||||
};
|
||||
CustomizableUI.addListener(this);
|
||||
|
||||
window.addEventListener("resolutionchange", this);
|
||||
window.addEventListener("resize", this);
|
||||
|
||||
gDragSpaceObserver.init();
|
||||
|
||||
this._initialized = true;
|
||||
this.update();
|
||||
},
|
||||
|
||||
whenWindowLayoutReady() {
|
||||
this._windowLayoutReady = true;
|
||||
this.update();
|
||||
},
|
||||
|
||||
allowedBy(condition, allow) {
|
||||
if (allow) {
|
||||
if (condition in this._disallowed) {
|
||||
@@ -82,54 +49,9 @@ var TabsInTitlebar = {
|
||||
this._readPref();
|
||||
},
|
||||
|
||||
handleEvent(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "resolutionchange":
|
||||
if (aEvent.target == window) {
|
||||
this.update();
|
||||
}
|
||||
break;
|
||||
case "resize":
|
||||
if (window.fullScreen || aEvent.target != window) {
|
||||
break;
|
||||
}
|
||||
// We use resize events because the window is not ready after
|
||||
// sizemodechange events. However, we only care about the event when
|
||||
// the sizemode is different from the last time we updated the
|
||||
// appearance of the tabs in the titlebar.
|
||||
let sizemode = document.documentElement.getAttribute("sizemode");
|
||||
if (this._lastSizeMode == sizemode) {
|
||||
break;
|
||||
}
|
||||
let oldSizeMode = this._lastSizeMode;
|
||||
this._lastSizeMode = sizemode;
|
||||
// Don't update right now if we are leaving fullscreen, since the UI is
|
||||
// still changing in the consequent "fullscreen" event. Code there will
|
||||
// call this function again when everything is ready.
|
||||
// See browser-fullScreen.js: FullScreen.toggle and bug 1173768.
|
||||
if (oldSizeMode == "fullscreen") {
|
||||
break;
|
||||
}
|
||||
this.update();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_onMenuMutate(aMutations) {
|
||||
for (let mutation of aMutations) {
|
||||
if (mutation.attributeName == "inactive" ||
|
||||
mutation.attributeName == "autohide") {
|
||||
TabsInTitlebar.update();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initialized: false,
|
||||
_windowLayoutReady: false,
|
||||
_disallowed: {},
|
||||
_prefName: "browser.tabs.drawInTitlebar",
|
||||
_lastSizeMode: null,
|
||||
|
||||
_readPref() {
|
||||
this.allowedBy("pref",
|
||||
@@ -159,148 +81,11 @@ var TabsInTitlebar = {
|
||||
}
|
||||
}
|
||||
|
||||
this._layOutTitlebar(allowed);
|
||||
|
||||
ToolbarIconColor.inferFromText("tabsintitlebar", allowed);
|
||||
},
|
||||
|
||||
_layOutTitlebar(drawInTitlebar) {
|
||||
if (!this._windowLayoutReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
let $ = id => document.getElementById(id);
|
||||
let rect = ele => ele.getBoundingClientRect();
|
||||
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
|
||||
|
||||
let titlebar = $("titlebar");
|
||||
let menubar = $("toolbar-menubar");
|
||||
|
||||
if (!drawInTitlebar) {
|
||||
if (AppConstants.platform == "macosx") {
|
||||
let secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width;
|
||||
this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth);
|
||||
}
|
||||
|
||||
// Reset styles that might have been modified:
|
||||
titlebar.style.marginBottom = "";
|
||||
menubar.style.paddingBottom = "";
|
||||
return;
|
||||
}
|
||||
|
||||
let titlebarContent = $("titlebar-content");
|
||||
let titlebarButtons = $("titlebar-buttonbox");
|
||||
|
||||
// Reset the custom titlebar height if the menubar is shown,
|
||||
// because we will want to calculate its original height.
|
||||
let buttonsShouldMatchTabHeight =
|
||||
AppConstants.isPlatformAndVersionAtLeast("win", "10.0") ||
|
||||
AppConstants.platform == "linux";
|
||||
if (buttonsShouldMatchTabHeight &&
|
||||
(menubar.getAttribute("inactive") != "true" ||
|
||||
menubar.getAttribute("autohide") != "true")) {
|
||||
titlebarButtons.style.removeProperty("height");
|
||||
}
|
||||
|
||||
// Try to avoid reflows in this code by calculating dimensions first and
|
||||
// then later set the properties affecting layout together in a batch.
|
||||
|
||||
// Get the height of the tabs toolbar:
|
||||
let fullTabsHeight = rect($("TabsToolbar")).height;
|
||||
|
||||
// Buttons first:
|
||||
let captionButtonsBoxWidth = rect(titlebarButtons).width;
|
||||
|
||||
let secondaryButtonsWidth, menuHeight, fullMenuHeight, menuStyles;
|
||||
if (AppConstants.platform == "macosx") {
|
||||
secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width;
|
||||
// No need to look up the menubar stuff on OS X:
|
||||
menuHeight = 0;
|
||||
fullMenuHeight = 0;
|
||||
} else {
|
||||
// Otherwise, get the height and margins separately for the menubar
|
||||
menuHeight = rect(menubar).height;
|
||||
menuStyles = window.getComputedStyle(menubar);
|
||||
fullMenuHeight = verticalMargins(menuStyles) + menuHeight;
|
||||
}
|
||||
|
||||
// And get the height of what's in the titlebar:
|
||||
let titlebarContentHeight = rect(titlebarContent).height;
|
||||
|
||||
// Begin setting CSS properties which will cause a reflow
|
||||
|
||||
// Adjust the window controls to span the entire
|
||||
// tab strip height if we're not showing a menu bar.
|
||||
if (buttonsShouldMatchTabHeight && !menuHeight) {
|
||||
titlebarContentHeight = fullTabsHeight;
|
||||
titlebarButtons.style.height = titlebarContentHeight + "px";
|
||||
}
|
||||
|
||||
// If the menubar is around (menuHeight is non-zero), try to adjust
|
||||
// its full height (i.e. including margins) to match the titlebar,
|
||||
// by changing the menubar's bottom padding
|
||||
if (menuHeight) {
|
||||
// Calculate the difference between the titlebar's height and that of the menubar
|
||||
let menuTitlebarDelta = titlebarContentHeight - fullMenuHeight;
|
||||
let paddingBottom;
|
||||
// The titlebar is bigger:
|
||||
if (menuTitlebarDelta > 0) {
|
||||
fullMenuHeight += menuTitlebarDelta;
|
||||
// If there is already padding on the menubar, we need to add that
|
||||
// to the difference so the total padding is correct:
|
||||
if ((paddingBottom = menuStyles.paddingBottom)) {
|
||||
menuTitlebarDelta += parseFloat(paddingBottom);
|
||||
}
|
||||
menubar.style.paddingBottom = menuTitlebarDelta + "px";
|
||||
// The menubar is bigger, but has bottom padding we can remove:
|
||||
} else if (menuTitlebarDelta < 0 && (paddingBottom = menuStyles.paddingBottom)) {
|
||||
let existingPadding = parseFloat(paddingBottom);
|
||||
// menuTitlebarDelta is negative; work out what's left, but don't set negative padding:
|
||||
let desiredPadding = Math.max(0, existingPadding + menuTitlebarDelta);
|
||||
menubar.style.paddingBottom = desiredPadding + "px";
|
||||
// We've changed the menu height now:
|
||||
fullMenuHeight += desiredPadding - existingPadding;
|
||||
}
|
||||
}
|
||||
|
||||
// Next, we calculate how much we need to stretch the titlebar down to
|
||||
// go all the way to the bottom of the tab strip, if necessary.
|
||||
let tabAndMenuHeight = fullTabsHeight + fullMenuHeight;
|
||||
|
||||
if (tabAndMenuHeight > titlebarContentHeight) {
|
||||
// We need to increase the titlebar content's outer height (ie including margins)
|
||||
// to match the tab and menu height:
|
||||
let extraMargin = tabAndMenuHeight - titlebarContentHeight;
|
||||
if (AppConstants.platform != "macosx") {
|
||||
titlebarContent.style.marginBottom = extraMargin + "px";
|
||||
}
|
||||
|
||||
titlebarContentHeight += extraMargin;
|
||||
} else {
|
||||
titlebarContent.style.removeProperty("margin-bottom");
|
||||
}
|
||||
|
||||
// Then add a negative margin to the titlebar, so that the following elements
|
||||
// will overlap it by the greater of the titlebar height or the tabstrip+menu.
|
||||
let maxTitlebarOrTabsHeight = Math.max(titlebarContentHeight, tabAndMenuHeight);
|
||||
titlebar.style.marginBottom = "-" + maxTitlebarOrTabsHeight + "px";
|
||||
|
||||
// Finally, size the placeholders:
|
||||
if (AppConstants.platform == "macosx") {
|
||||
this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth);
|
||||
}
|
||||
this._sizePlaceholder("caption-buttons", captionButtonsBoxWidth);
|
||||
},
|
||||
|
||||
_sizePlaceholder(type, width) {
|
||||
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
|
||||
function(node) { node.style.width = width + "px"; });
|
||||
},
|
||||
|
||||
uninit() {
|
||||
Services.prefs.removeObserver(this._prefName, this);
|
||||
this._menuObserver.disconnect();
|
||||
CustomizableUI.removeListener(this);
|
||||
gDragSpaceObserver.uninit();
|
||||
},
|
||||
};
|
||||
|
||||
@@ -89,6 +89,7 @@ toolbar[customizable="true"] {
|
||||
%ifdef XP_MACOSX
|
||||
#toolbar-menubar {
|
||||
-moz-binding: none;
|
||||
visibility: collapse;
|
||||
}
|
||||
%endif
|
||||
|
||||
@@ -153,7 +154,7 @@ panelview[mainview] > .panel-header {
|
||||
#tabbrowser-tabs[hasadjacentnewtabbutton]:not([overflow="true"]) ~ #new-tab-button,
|
||||
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#tabbrowser-tabs:not([hasadjacentnewtabbutton]) > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#TabsToolbar[customizing="true"] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
|
||||
#TabsToolbar[customizing="true"] #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
@@ -240,16 +241,16 @@ panelview[mainview] > .panel-header {
|
||||
|
||||
/* The next 3 rules allow dragging tabs slightly outside of the tabstrip
|
||||
* to make it easier to drag tabs. */
|
||||
#TabsToolbar[movingtab] {
|
||||
#navigator-toolbox[movingtab] > #titlebar > #TabsToolbar {
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
#TabsToolbar[movingtab] > #tabbrowser-tabs {
|
||||
#navigator-toolbox[movingtab] #tabbrowser-tabs {
|
||||
padding-bottom: 15px;
|
||||
margin-bottom: -15px;
|
||||
}
|
||||
|
||||
#TabsToolbar[movingtab] + #nav-bar {
|
||||
#navigator-toolbox[movingtab] > #nav-bar {
|
||||
margin-top: -15px;
|
||||
pointer-events: none;
|
||||
}
|
||||
@@ -286,32 +287,40 @@ window:not([chromehidden~="toolbar"]) #nav-bar[nonemptyoverflow] > .overflow-but
|
||||
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > .titlebar-placeholder,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > .titlebar-item,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar .titlebar-placeholder,
|
||||
%endif
|
||||
%ifndef MOZ_WIDGET_COCOA
|
||||
#main-window:not([sizemode=normal]) .titlebar-placeholder[type="pre-tabs"],
|
||||
%endif
|
||||
#main-window:not([chromemargin]) > #titlebar,
|
||||
#main-window[inFullscreen] > #titlebar,
|
||||
#main-window:not([chromemargin]) .titlebar-buttonbox-container,
|
||||
#main-window[inFullscreen] .titlebar-buttonbox-container,
|
||||
#main-window[inFullscreen] .titlebar-placeholder,
|
||||
#main-window:not([tabsintitlebar]) .titlebar-placeholder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar[autohide=true]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
|
||||
visibility: hidden;
|
||||
}
|
||||
%endif
|
||||
|
||||
#titlebar {
|
||||
-moz-window-dragging: drag;
|
||||
}
|
||||
|
||||
#titlebar-spacer {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #titlebar-buttonbox {
|
||||
#main-window[tabsintitlebar] .titlebar-buttonbox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox {
|
||||
#main-window:not([tabsintitlebar]) .titlebar-buttonbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#personal-bookmarks {
|
||||
@@ -322,23 +331,27 @@ toolbarpaletteitem {
|
||||
-moz-window-dragging: no-drag;
|
||||
}
|
||||
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
|
||||
%ifdef XP_MACOSX
|
||||
#titlebar-fullscreen-button {
|
||||
-moz-appearance: -moz-mac-fullscreen-button;
|
||||
}
|
||||
|
||||
/* Fullscreen and caption buttons don't move with RTL on OS X so override the automatic ordering. */
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(ltr),
|
||||
#titlebar-buttonbox-container:-moz-locale-dir(rtl),
|
||||
.titlebar-placeholder[type="fullscreen-button"]:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="caption-buttons"]:-moz-locale-dir(rtl) {
|
||||
/**
|
||||
* On macOS, the window caption buttons are on the left side of the window titlebar,
|
||||
* even when using the RTL UI direction. Similarly, the fullscreen button is on the
|
||||
* right side of the window titlebar, even when using the RTL UI direction. These
|
||||
* next rules enforce that ordering.
|
||||
*/
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(ltr) {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(rtl),
|
||||
#titlebar-buttonbox-container:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="caption-buttons"]:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="fullscreen-button"]:-moz-locale-dir(rtl) {
|
||||
.titlebar-buttonbox-container:-moz-locale-dir(ltr) {
|
||||
-moz-box-ordinal-group: 0;
|
||||
}
|
||||
%endif
|
||||
|
||||
@@ -1333,10 +1333,6 @@ var gBrowserInit = {
|
||||
});
|
||||
|
||||
this._setInitialFocus();
|
||||
|
||||
// Update the UI density before TabsInTitlebar lays out the titlbar.
|
||||
gUIDensity.init();
|
||||
TabsInTitlebar.whenWindowLayoutReady();
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
@@ -1393,6 +1389,7 @@ var gBrowserInit = {
|
||||
}
|
||||
|
||||
// Misc. inits.
|
||||
gUIDensity.init();
|
||||
TabletModeUpdater.init();
|
||||
CombinedStopReload.ensureInitialized();
|
||||
gPrivateBrowsingUI.init();
|
||||
@@ -5584,7 +5581,7 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
||||
|
||||
var firstMenuItem = aInsertPoint || popup.firstElementChild;
|
||||
|
||||
let toolbarNodes = gNavToolbox.children;
|
||||
let toolbarNodes = gNavToolbox.querySelectorAll("toolbar");
|
||||
|
||||
for (let toolbar of toolbarNodes) {
|
||||
if (!toolbar.hasAttribute("toolbarname")) {
|
||||
@@ -5861,7 +5858,6 @@ var gUIDensity = {
|
||||
}
|
||||
}
|
||||
|
||||
TabsInTitlebar.update();
|
||||
gBrowser.tabContainer.uiDensityChanged();
|
||||
},
|
||||
};
|
||||
|
||||
@@ -724,110 +724,98 @@ xmlns="http://www.w3.org/1999/xhtml"
|
||||
</popupset>
|
||||
<box id="appMenu-viewCache" hidden="true"/>
|
||||
|
||||
<vbox id="titlebar">
|
||||
<hbox id="titlebar-content">
|
||||
<spacer id="titlebar-spacer" flex="1"/>
|
||||
<hbox id="titlebar-buttonbox-container">
|
||||
<hbox id="titlebar-buttonbox" class="titlebar-color">
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
#ifdef XP_MACOSX
|
||||
<!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
|
||||
buttonbox from reversing order in RTL by forcing an LTR direction. -->
|
||||
<hbox id="titlebar-secondary-buttonbox" dir="ltr">
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
<hbox id="titlebar-fullscreen-button"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<toolbox id="navigator-toolbox">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar"
|
||||
class="browser-toolbar chromeclass-menubar titlebar-color"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
|
||||
<vbox id="titlebar">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar"
|
||||
class="browser-toolbar chromeclass-menubar titlebar-color"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
#ifdef MENUBAR_CAN_AUTOHIDE
|
||||
toolbarname="&menubarCmd.label;"
|
||||
accesskey="&menubarCmd.accesskey;"
|
||||
autohide="true"
|
||||
toolbarname="&menubarCmd.label;"
|
||||
accesskey="&menubarCmd.accesskey;"
|
||||
autohide="true"
|
||||
#endif
|
||||
context="toolbar-context-menu">
|
||||
<toolbaritem id="menubar-items" align="center">
|
||||
context="toolbar-context-menu">
|
||||
<toolbaritem id="menubar-items" align="center">
|
||||
# The entire main menubar is placed into browser-menubar.inc, so that it can be
|
||||
# shared with other top level windows in macWindow.inc.xul.
|
||||
#include browser-menubar.inc
|
||||
</toolbaritem>
|
||||
</toolbaritem>
|
||||
<spacer flex="1" />
|
||||
#include titlebar-items.inc.xul
|
||||
</toolbar>
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
<hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
#endif
|
||||
</toolbar>
|
||||
<toolbar id="TabsToolbar"
|
||||
class="browser-toolbar titlebar-color"
|
||||
fullscreentoolbar="true"
|
||||
customizable="true"
|
||||
customizationtarget="TabsToolbar-customization-target"
|
||||
mode="icons"
|
||||
aria-label="&tabsToolbar.label;"
|
||||
context="toolbar-context-menu"
|
||||
flex="1">
|
||||
<vbox flex="1" class="toolbar-items">
|
||||
<spacer flex="1000"/>
|
||||
|
||||
<toolbar id="TabsToolbar"
|
||||
class="browser-toolbar titlebar-color"
|
||||
fullscreentoolbar="true"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
aria-label="&tabsToolbar.label;"
|
||||
context="toolbar-context-menu">
|
||||
<hbox class="titlebar-placeholder" type="pre-tabs"
|
||||
skipintoolbarset="true"/>
|
||||
<hbox id="TabsToolbar-customization-target" flex="1">
|
||||
<hbox class="titlebar-placeholder" type="pre-tabs"
|
||||
skipintoolbarset="true"/>
|
||||
|
||||
<tabs id="tabbrowser-tabs"
|
||||
flex="1"
|
||||
setfocus="false"
|
||||
tooltip="tabbrowser-tab-tooltip"
|
||||
stopwatchid="FX_TAB_CLICK_MS">
|
||||
<tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
|
||||
</tabs>
|
||||
<tabs id="tabbrowser-tabs"
|
||||
flex="1"
|
||||
setfocus="false"
|
||||
tooltip="tabbrowser-tab-tooltip"
|
||||
stopwatchid="FX_TAB_CLICK_MS">
|
||||
<tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
|
||||
</tabs>
|
||||
|
||||
<toolbarbutton id="new-tab-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltip="dynamic-shortcut-tooltip"
|
||||
ondrop="newTabButtonObserver.onDrop(event)"
|
||||
ondragover="newTabButtonObserver.onDragOver(event)"
|
||||
ondragenter="newTabButtonObserver.onDragOver(event)"
|
||||
ondragexit="newTabButtonObserver.onDragExit(event)"
|
||||
cui-areatype="toolbar"
|
||||
removable="true"/>
|
||||
<toolbarbutton id="new-tab-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltip="dynamic-shortcut-tooltip"
|
||||
ondrop="newTabButtonObserver.onDrop(event)"
|
||||
ondragover="newTabButtonObserver.onDragOver(event)"
|
||||
ondragenter="newTabButtonObserver.onDragOver(event)"
|
||||
ondragexit="newTabButtonObserver.onDragExit(event)"
|
||||
cui-areatype="toolbar"
|
||||
removable="true"/>
|
||||
|
||||
<toolbarbutton id="alltabs-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
|
||||
oncommand="gTabsPanel.showAllTabsPanel();"
|
||||
label="&listAllTabs.label;"
|
||||
tooltiptext="&listAllTabs.label;"
|
||||
removable="false"/>
|
||||
<toolbarbutton id="alltabs-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
|
||||
oncommand="gTabsPanel.showAllTabsPanel();"
|
||||
label="&listAllTabs.label;"
|
||||
tooltiptext="&listAllTabs.label;"
|
||||
removable="false"/>
|
||||
|
||||
<hbox class="titlebar-placeholder" type="post-tabs"
|
||||
ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
<hbox class="titlebar-placeholder" type="post-tabs"
|
||||
ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
ordinal="1000"
|
||||
aria-live="polite" skipintoolbarset="true"/>
|
||||
<hbox class="private-browsing-indicator" skipintoolbarset="true"
|
||||
ordinal="1000"/>
|
||||
<hbox class="titlebar-placeholder" type="caption-buttons"
|
||||
#ifndef XP_MACOSX
|
||||
ordinal="1000"
|
||||
#endif
|
||||
skipintoolbarset="true"/>
|
||||
<button class="accessibility-indicator titlebar-item" tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
ordinal="1000"
|
||||
aria-live="polite" skipintoolbarset="true"/>
|
||||
<hbox class="private-browsing-indicator titlebar-item" skipintoolbarset="true"
|
||||
ordinal="1000"/>
|
||||
#include titlebar-items.inc.xul
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
<hbox class="titlebar-placeholder" type="fullscreen-button"
|
||||
skipintoolbarset="true"/>
|
||||
<!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
|
||||
buttonbox from reversing order in RTL by forcing an LTR direction. -->
|
||||
<hbox id="titlebar-secondary-buttonbox" dir="ltr">
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
<hbox id="titlebar-fullscreen-button"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</toolbar>
|
||||
</toolbar>
|
||||
|
||||
</vbox>
|
||||
|
||||
<toolbar id="nav-bar"
|
||||
class="browser-toolbar"
|
||||
|
||||
@@ -5359,6 +5359,8 @@ var TabBarVisibility = {
|
||||
this._initialUpdateDone = true;
|
||||
|
||||
toolbar.collapsed = collapse;
|
||||
let navbar = document.getElementById("nav-bar");
|
||||
navbar.setAttribute("tabs-hidden", collapse);
|
||||
|
||||
document.getElementById("menu_closeWindow").hidden = collapse;
|
||||
document.getElementById("menu_close").setAttribute("label",
|
||||
|
||||
@@ -590,7 +590,7 @@
|
||||
|
||||
if (this.getAttribute("movingtab") != "true") {
|
||||
this.setAttribute("movingtab", "true");
|
||||
this.parentNode.setAttribute("movingtab", "true");
|
||||
gNavToolbox.setAttribute("movingtab", "true");
|
||||
if (!draggedTab.multiselected)
|
||||
this.selectedItem = draggedTab;
|
||||
}
|
||||
@@ -717,7 +717,7 @@
|
||||
}
|
||||
|
||||
this.removeAttribute("movingtab");
|
||||
this.parentNode.removeAttribute("movingtab");
|
||||
gNavToolbox.removeAttribute("movingtab");
|
||||
|
||||
this._handleTabSelect();
|
||||
]]></body>
|
||||
@@ -1143,7 +1143,7 @@
|
||||
<parameter name="aContainer"/>
|
||||
<body><![CDATA[
|
||||
if (aContainer.ownerDocument == document &&
|
||||
aContainer.id == "TabsToolbar") {
|
||||
aContainer.id == "TabsToolbar-customization-target") {
|
||||
this._updateNewTabVisibility();
|
||||
}
|
||||
]]></body>
|
||||
|
||||
@@ -18,35 +18,6 @@ const EXPECTED_REFLOWS = [
|
||||
*/
|
||||
];
|
||||
|
||||
if (Services.appinfo.OS == "WINNT") {
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"whenWindowLayoutReady@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 2, // This number should only ever go down - never up.
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"rect@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"whenWindowLayoutReady@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
// These numbers should only ever go down - never up.
|
||||
maxCount: Services.appinfo.OS == "WINNT" ? 5 : 4,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* This test ensures that there are no unexpected
|
||||
* uninterruptible reflows or flickering areas when opening new windows.
|
||||
@@ -115,31 +86,6 @@ add_task(async function() {
|
||||
await BrowserTestUtils.firstBrowserLoaded(win, false);
|
||||
await BrowserTestUtils.browserStopped(win.gBrowser.selectedBrowser, "about:home");
|
||||
|
||||
if (Services.appinfo.OS == "WINNT" && win.windowState == win.STATE_MAXIMIZED) {
|
||||
// The reflows below are triggered by maximizing the window after
|
||||
// layout. They should be fixed by bug 1447864.
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"rect@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"handleEvent@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 4,
|
||||
},
|
||||
{
|
||||
stack: [
|
||||
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"handleEvent@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 2,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
await new Promise(resolve => {
|
||||
// 10 is an arbitrary value here, it needs to be at least 2 to avoid
|
||||
// races with code initializing itself using idle callbacks.
|
||||
|
||||
11
browser/base/content/titlebar-items.inc.xul
Normal file
11
browser/base/content/titlebar-items.inc.xul
Normal file
@@ -0,0 +1,11 @@
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# 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/.
|
||||
|
||||
<hbox class="titlebar-buttonbox-container titlebar-item">
|
||||
<hbox class="titlebar-buttonbox titlebar-color">
|
||||
<toolbarbutton class="titlebar-button titlebar-min" oncommand="window.minimize();"/>
|
||||
<toolbarbutton class="titlebar-button titlebar-max" oncommand="onTitlebarMaxClick();"/>
|
||||
<toolbarbutton class="titlebar-button titlebar-close" command="cmd_closeWindow"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
@@ -50,7 +50,7 @@ PaymentUIService.prototype = {
|
||||
showPayment(requestId) {
|
||||
this.log.debug("showPayment:", requestId);
|
||||
let request = paymentSrv.getPaymentRequestById(requestId);
|
||||
let merchantBrowser = this.findBrowserByTabId(request.tabId);
|
||||
let merchantBrowser = this.findBrowserByOuterWindowId(request.topOuterWindowId);
|
||||
let chromeWindow = merchantBrowser.ownerGlobal;
|
||||
let {gBrowser} = chromeWindow;
|
||||
let browserContainer = gBrowser.getBrowserContainer(merchantBrowser);
|
||||
@@ -200,19 +200,17 @@ PaymentUIService.prototype = {
|
||||
return {};
|
||||
},
|
||||
|
||||
findBrowserByTabId(tabId) {
|
||||
findBrowserByOuterWindowId(outerWindowId) {
|
||||
for (let win of BrowserWindowTracker.orderedWindows) {
|
||||
for (let browser of win.gBrowser.browsers) {
|
||||
if (!browser.frameLoader || !browser.frameLoader.tabParent) {
|
||||
continue;
|
||||
}
|
||||
if (browser.frameLoader.tabParent.tabId == tabId) {
|
||||
return browser;
|
||||
}
|
||||
let browser = win.gBrowser.getBrowserForOuterWindowID(outerWindowId);
|
||||
if (!browser) {
|
||||
continue;
|
||||
}
|
||||
return browser;
|
||||
}
|
||||
|
||||
this.log.error("findBrowserByTabId: No browser found for tabId:", tabId);
|
||||
this.log.error("findBrowserByOuterWindowId: No browser found for outerWindowId:",
|
||||
outerWindowId);
|
||||
return null;
|
||||
},
|
||||
};
|
||||
|
||||
@@ -15,20 +15,12 @@ https://trac.torproject.org/projects/tor/ticket/1517
|
||||
<a target="_blank" href="https://trac.torproject.org/projects/tor/ticket/1517">Tor Bug 1517</a>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1424341">Mozilla Bug 1424341</a>
|
||||
|
||||
<!-- Canvas for testing 'currentTime' -->
|
||||
<canvas id="test-canvas" width="100" height="100"></canvas>
|
||||
|
||||
<!-- The main testing script -->
|
||||
<script type="application/javascript">
|
||||
SimpleTest.requestFlakyTimeout("testing JS time-based fingerprinting");
|
||||
|
||||
// Prepare for test of AudioContext.currentTime
|
||||
let audioContext = new AudioContext();
|
||||
// Prepare for test of CanvasStream.currentTime
|
||||
let canvas = document.getElementById("test-canvas");
|
||||
let context = canvas.getContext("2d");
|
||||
context.fillText("test", 20, 20);
|
||||
let canvasStream = canvas.captureStream(25);
|
||||
|
||||
// Known ways to generate time stamps, in milliseconds
|
||||
const timeStampCodes = [
|
||||
@@ -40,7 +32,6 @@ https://trac.torproject.org/projects/tor/ticket/1517
|
||||
// These are measured in seconds, so we need to scale them up
|
||||
var timeStampCodesDOM = timeStampCodes.concat([
|
||||
"audioContext.currentTime * 1000",
|
||||
"canvasStream.currentTime * 1000",
|
||||
]);
|
||||
|
||||
let isRounded = (x, expectedPrecision) => {
|
||||
|
||||
@@ -53,10 +53,6 @@
|
||||
-moz-box-orient: vertical; /* for flex hack */
|
||||
}
|
||||
|
||||
#main-menubar {
|
||||
-moz-box-flex: 1; /* make menu items expand to fill toolbar height */
|
||||
}
|
||||
|
||||
#navigator-toolbox {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
@@ -75,7 +71,7 @@
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
/* This is needed for some toolbar button animations. Gross :( */
|
||||
position: relative;
|
||||
@@ -617,14 +613,6 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
||||
border-radius: inherit;
|
||||
}
|
||||
|
||||
/* Hide the titlebar explicitly on versions of GTK+ where
|
||||
* it's rendered by window manager. */
|
||||
@media (-moz-gtk-csd-available: 0) {
|
||||
#titlebar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* We draw to titlebar when Gkt+ CSD is available */
|
||||
@media (-moz-gtk-csd-available) {
|
||||
/* Some Gtk+ themes use non-rectangular toplevel windows. To fully support
|
||||
@@ -639,17 +627,10 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
||||
}
|
||||
}
|
||||
|
||||
:root[tabsintitlebar] > #titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
:root[tabsintitlebar] #titlebar-content:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
:root[tabsintitlebar] > #titlebar {
|
||||
:root[tabsintitlebar] > #navigator-toolbox > #titlebar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: -moz-window-titlebar-maximized;
|
||||
}
|
||||
:root[tabsintitlebar][sizemode="normal"] > #titlebar {
|
||||
:root[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: -moz-window-titlebar;
|
||||
}
|
||||
|
||||
@@ -659,12 +640,13 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
||||
padding-top: var(--space-above-tabbar);
|
||||
}
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
padding-top: calc(-1 * var(--space-above-tabbar));
|
||||
/**
|
||||
* Titlebar items (window caption buttons, private browsing indicator,
|
||||
* accessibility indicator, etc)
|
||||
*/
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item {
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* Make #TabsToolbar transparent as we style underlying #titlebar with
|
||||
@@ -681,7 +663,7 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
||||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events.
|
||||
*/
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
z-index: 1;
|
||||
-moz-box-align: center;
|
||||
}
|
||||
@@ -690,37 +672,37 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
||||
* Use full scale icons here as the Gtk+ does.
|
||||
*/
|
||||
@media (-moz-gtk-csd-minimize-button) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
-moz-appearance: -moz-window-button-minimize;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-minimize-button: 0) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-gtk-csd-maximize-button) {
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
-moz-appearance: -moz-window-button-maximize;
|
||||
}
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
-moz-appearance: -moz-window-button-restore;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-maximize-button: 0) {
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-gtk-csd-close-button) {
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
-moz-appearance: -moz-window-button-close;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-close-button: 0) {
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,11 +85,6 @@
|
||||
-moz-box-pack: center;
|
||||
}
|
||||
|
||||
#titlebar-content {
|
||||
/* Ensure the the content part of the titlebar does not shrink. */
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox > .titlebar-button {
|
||||
display: none;
|
||||
}
|
||||
@@ -103,15 +98,15 @@
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox-container {
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
/* These would be margin-inline-start/end if it wasn't for the fact that OS X
|
||||
* doesn't reverse the order of the items in the titlebar in RTL mode. */
|
||||
.titlebar-placeholder[type="caption-buttons"],
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
margin-left: 12px;
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* The fullscreen button doesnt show on Yosemite(10.10) or above so dont give it a
|
||||
@@ -122,18 +117,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
#main-window:not([tabsintitlebar]) > #titlebar {
|
||||
height: 22px; /* The native titlebar on OS X is 22px tall. */
|
||||
}
|
||||
|
||||
/**
|
||||
* For tabs in titlebar on OS X, we stretch the titlebar down so that the
|
||||
* tabstrip can overlap it.
|
||||
*/
|
||||
#main-window[tabsintitlebar] > #titlebar {
|
||||
min-height: calc(var(--tab-min-height) + var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/** End titlebar **/
|
||||
|
||||
#main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
|
||||
@@ -148,9 +131,9 @@
|
||||
|
||||
/* Draw the bottom border of the tabs toolbar when it's not using
|
||||
-moz-appearance: toolbar. */
|
||||
#main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
|
||||
#main-window:not([tabsintitlebar]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar:-moz-lwtheme {
|
||||
#main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #nav-bar:not([tabs-hidden="true"]),
|
||||
#main-window:not([tabsintitlebar]) #nav-bar:not([tabs-hidden="true"]),
|
||||
#nav-bar:not([tabs-hidden="true"]):-moz-lwtheme {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
|
||||
@@ -164,12 +147,12 @@
|
||||
--tabs-border-color: rgba(0,0,0,.05);
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #TabsToolbar:not([collapsed="true"]) + #nav-bar:not(:-moz-lwtheme) {
|
||||
#main-window[tabsintitlebar] #nav-bar:not([tabs-hidden="true"]):not(:-moz-lwtheme) {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
/* The toolbar buttons that animate are only visible when the #TabsToolbar is not collapsed.
|
||||
The animations use position:absolute and require a positioned #nav-bar. */
|
||||
position: relative;
|
||||
@@ -643,14 +626,9 @@ html|input.urlbar-input {
|
||||
}
|
||||
|
||||
#TabsToolbar {
|
||||
-moz-appearance: none;
|
||||
padding-top: var(--space-above-tabbar);
|
||||
}
|
||||
|
||||
:root:not([customizing]):not([tabsintitlebar]):not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: toolbar;
|
||||
}
|
||||
|
||||
#TabsToolbar:not(:-moz-lwtheme) {
|
||||
color: #333;
|
||||
text-shadow: @loweredShadow@;
|
||||
@@ -961,10 +939,10 @@ html|*.addon-webext-perm-list {
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #titlebar > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #titlebar > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #navigator-toolbox > #titlebar > #TabsToolbar > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #navigator-toolbox > #titlebar > #TabsToolbar > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
|
||||
%include ../shared/compacttheme.inc.css
|
||||
|
||||
/* Get rid of 1px bright strip at the top of window */
|
||||
#main-window[tabsintitlebar] #titlebar-content {
|
||||
background: var(--lwt-accent-color);
|
||||
}
|
||||
|
||||
#TabsToolbar:-moz-lwtheme-darktext {
|
||||
-moz-appearance: -moz-mac-vibrant-titlebar-light;
|
||||
-moz-font-smoothing-background-color: -moz-mac-vibrant-titlebar-light;
|
||||
|
||||
@@ -151,6 +151,7 @@
|
||||
visibility: collapse;
|
||||
overflow: hidden;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-inline-end: -20px;
|
||||
}
|
||||
|
||||
@@ -172,7 +173,6 @@
|
||||
#tracking-protection-icon-box > #tracking-protection-icon-animatable-box {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
top: calc(50% - 10px); /* half the height of the sprite */
|
||||
margin-inline-start: 4px;
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-background,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar .tabbrowser-tab > .tab-stack > .tab-background,
|
||||
%endif
|
||||
:root:not([tabsintitlebar]) .tab-background,
|
||||
:root[extradragspace] .tab-background {
|
||||
@@ -554,7 +554,7 @@
|
||||
background-color: rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]) {
|
||||
background-color: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
@@ -570,12 +570,12 @@
|
||||
transform: none;
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]):not([multiselected]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]):not([multiselected]) {
|
||||
background-color: rgba(255,255,255,.2);
|
||||
}
|
||||
|
||||
.tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected],
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected] {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@
|
||||
background-color: rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab[multiselected] > .tab-stack > .tab-background:not([selected=true]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab[multiselected] > .tab-stack > .tab-background:not([selected=true]) {
|
||||
background-color: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
@@ -668,7 +668,7 @@
|
||||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
:root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] + #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab::after,
|
||||
:root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] + #TabsToolbar .tabbrowser-tab::after,
|
||||
%else
|
||||
:root[tabsintitlebar]:not([extradragspace]) .tabbrowser-tab::after,
|
||||
%endif
|
||||
@@ -717,8 +717,7 @@
|
||||
/* New tab button */
|
||||
|
||||
.tabs-newtab-button,
|
||||
#TabsToolbar > #new-tab-button ,
|
||||
#TabsToolbar > toolbarpaletteitem > #new-tab-button {
|
||||
#TabsToolbar #new-tab-button {
|
||||
list-style-image: url(chrome://browser/skin/add.svg);
|
||||
}
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ toolbar[brighttext] {
|
||||
padding: 0 var(--toolbarbutton-inner-padding) !important;
|
||||
}
|
||||
|
||||
#navigator-toolbox:not(:hover) > #TabsToolbar > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-down:not([highlight]) {
|
||||
#navigator-toolbox:not(:hover) > #TabsToolbar .tabbrowser-arrowscrollbox > .scrollbutton-down:not([highlight]) {
|
||||
transition: 1s background-color ease-out;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,33 @@
|
||||
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
@media (-moz-windows-classic: 0) {
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #toolbar-menubar {
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar:not([autohide="true"]) > #menubar-items,
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .toolbar-items {
|
||||
margin-top: 1px;
|
||||
}
|
||||
/**
|
||||
* For all Windows configurations except for Windows Aero and
|
||||
* Windows Aero Basic, the -moz-window-button-box appearance on
|
||||
* the .titlebar-buttonbox adds an unwanted margin at the top of
|
||||
* the button box.
|
||||
*
|
||||
* For Windows Aero:
|
||||
* We want the -moz-window-button-box applied in the restored case,
|
||||
* and -moz-window-button-box-maximized in the maximized case.
|
||||
*
|
||||
* For Windows Aero Basic:
|
||||
* The margin is also unwanted in the maximized case, but we want
|
||||
* it in the restored window case.
|
||||
*/
|
||||
#main-window[sizemode="normal"] .titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box;
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor) {
|
||||
#main-window[sizemode="maximized"] .titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box-maximized;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +101,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#titlebar-buttonbox,
|
||||
.titlebar-buttonbox,
|
||||
.titlebar-button {
|
||||
-moz-appearance: none !important;
|
||||
}
|
||||
@@ -95,35 +119,35 @@
|
||||
height: 12px;
|
||||
}
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize.svg);
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore.svg);
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close.svg);
|
||||
}
|
||||
|
||||
:root[lwtheme-image] .titlebar-button {
|
||||
-moz-context-properties: unset;
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-min {
|
||||
:root[lwtheme-image] .titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-max {
|
||||
:root[lwtheme-image] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image][sizemode="maximized"] #titlebar-max {
|
||||
:root[lwtheme-image][sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-close {
|
||||
:root[lwtheme-image] .titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close-themes.svg);
|
||||
}
|
||||
|
||||
@@ -197,12 +221,12 @@
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#titlebar-close:hover {
|
||||
.titlebar-close:hover {
|
||||
stroke: white;
|
||||
background-color: hsl(355,86%,49%);
|
||||
}
|
||||
|
||||
#titlebar-close:hover:active {
|
||||
.titlebar-close:hover:active {
|
||||
background-color: hsl(355,82%,69%);
|
||||
}
|
||||
}
|
||||
@@ -217,19 +241,19 @@
|
||||
stroke: HighlightText;
|
||||
}
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize-highcontrast.svg);
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize-highcontrast.svg);
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore-highcontrast.svg);
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close-highcontrast.svg);
|
||||
}
|
||||
}
|
||||
@@ -243,7 +267,7 @@
|
||||
-moz-appearance: -moz-win-borderless-glass;
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-buttonbox {
|
||||
:root[sizemode="maximized"] .titlebar-buttonbox {
|
||||
margin-inline-end: 3px;
|
||||
}
|
||||
|
||||
|
||||
@@ -79,10 +79,6 @@
|
||||
-moz-box-orient: vertical; /* for flex hack */
|
||||
}
|
||||
|
||||
#main-menubar {
|
||||
-moz-box-flex: 1; /* make menu items expand to fill toolbar height */
|
||||
}
|
||||
|
||||
#main-menubar > menu {
|
||||
-moz-appearance: none;
|
||||
color: inherit;
|
||||
@@ -105,12 +101,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
/* Hides the titlebar-placeholder underneath the window caption buttons when we
|
||||
are not autohiding the menubar. */
|
||||
#toolbar-menubar:not([autohide="true"]) + #TabsToolbar > .titlebar-placeholder[type="caption-buttons"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar {
|
||||
padding-top: var(--space-above-tabbar);
|
||||
@@ -196,17 +186,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #titlebar-content:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
-moz-window-dragging: drag;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* In the classic themes, the titlebar has a horizontal gradient, which is
|
||||
* problematic for reading the text of background tabs when they're in the
|
||||
@@ -275,7 +254,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
/* This is needed for some toolbar button animations. Gross :( */
|
||||
position: relative;
|
||||
}
|
||||
@@ -284,7 +263,7 @@
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#TabsToolbar[collapsed="true"] + #nav-bar {
|
||||
#nav-bar[tabs-hidden="true"] {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
@@ -299,61 +278,84 @@
|
||||
|
||||
/* ::::: titlebar ::::: */
|
||||
|
||||
#main-window[sizemode="normal"] > #titlebar {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar {
|
||||
-moz-appearance: -moz-window-titlebar;
|
||||
}
|
||||
|
||||
#main-window[sizemode="maximized"] > #titlebar {
|
||||
#main-window[tabsintitlebar][sizemode="maximized"] > #navigator-toolbox > #titlebar {
|
||||
-moz-appearance: -moz-window-titlebar-maximized;
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
/**
|
||||
* Anytime we're not using the compositor on Windows, the -moz-window-titlebar
|
||||
* and -moz-window-titlebar-maximized values for -moz-appearance override
|
||||
* backgrounds supplied by lwthemes. We make the #titlebar itself hidden, but
|
||||
* it's children visible in order to hide the background but keep the margin and
|
||||
* padding that comes from those -moz-window-titlebar rules.
|
||||
*/
|
||||
#titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
#toolbar-menubar:-moz-lwtheme,
|
||||
#TabsToolbar:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-windows-classic) {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #toolbar-menubar {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar {
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* The button box must appear on top of the navigator-toolbox in order for
|
||||
* click and hover mouse events to work properly for the button in the restored
|
||||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events. It will also place the buttons above the fog on
|
||||
* Windows 7 with Aero Glass.
|
||||
*/
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
/* For all Windows configurations except for Windows Aero and Windows Aero Basic,
|
||||
* the default -moz-appearance of -moz-window-button-box and
|
||||
* -moz-window-button-box-maximized adds unwanted margins to the button box. We
|
||||
* special case Windows Aero and Windows Aero Basic in browser-aero.css.
|
||||
*/
|
||||
-moz-appearance: none;
|
||||
/* The button box must appear on top of the navigator-toolbox in order for
|
||||
* click and hover mouse events to work properly for the button in the restored
|
||||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events. It will also place the buttons above the fog on
|
||||
* Windows 7 with Aero Glass.
|
||||
*/
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox-container {
|
||||
-moz-box-align: center;
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: stretch;
|
||||
}
|
||||
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
/* Preserve window control buttons position at the top of the button box. */
|
||||
#titlebar-buttonbox-container {
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: start;
|
||||
}
|
||||
}
|
||||
|
||||
/* titlebar command buttons */
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
-moz-appearance: -moz-window-button-minimize;
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
-moz-appearance: -moz-window-button-maximize;
|
||||
}
|
||||
|
||||
#main-window[sizemode="maximized"] #titlebar-max {
|
||||
#main-window[sizemode="maximized"] .titlebar-max {
|
||||
-moz-appearance: -moz-window-button-restore;
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
-moz-appearance: -moz-window-button-close;
|
||||
}
|
||||
|
||||
@media (-moz-windows-classic: 0) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
margin-inline-end: 2px;
|
||||
}
|
||||
}
|
||||
@@ -946,21 +948,21 @@ notification[value="translation"] {
|
||||
|
||||
/* End customization mode */
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
/**
|
||||
* Titlebar items (window caption buttons, private browsing indicator,
|
||||
* accessibility indicator, etc)
|
||||
*/
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] > .titlebar-item {
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* Compensate for 4px extra margin on top of the tabs toolbar on Windows 7. */
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] > .titlebar-item {
|
||||
margin-top: calc(-1 * (var(--space-above-tabbar) + 4px));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
broken. So instead just show the normal titlebar in that case, and override
|
||||
the window color as transparent when the compositor is available. */
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
|
||||
#main-window[tabsintitlebar] > #navigator-toolbox > #titlebar:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
|
||||
@@ -661,6 +661,7 @@ skip-if = (os == "win" && ccov) # Bug 1453549
|
||||
[browser_dbg-sourcemapped-scopes.js]
|
||||
skip-if = ccov || (verify && debug && (os == 'linux')) # Bug 1441545
|
||||
[browser_dbg-sourcemapped-stepping.js]
|
||||
skip-if = (os == 'win' && os_version == '10.0' && ccov) # Bug 1480680
|
||||
[browser_dbg-sourcemapped-preview.js]
|
||||
skip-if = os == "win" # Bug 1448523, Bug 1448450
|
||||
[browser_dbg-breaking.js]
|
||||
|
||||
@@ -81,7 +81,7 @@ interface nsIPaymentOptions : nsISupports
|
||||
[scriptable, builtinclass, uuid(2fa36783-d684-4487-b7a8-9def6ae3128f)]
|
||||
interface nsIPaymentRequest : nsISupports
|
||||
{
|
||||
readonly attribute uint64_t tabId;
|
||||
readonly attribute uint64_t topOuterWindowId;
|
||||
readonly attribute nsIPrincipal topLevelPrincipal;
|
||||
readonly attribute AString requestId;
|
||||
readonly attribute AString completeStatus;
|
||||
|
||||
@@ -3217,7 +3217,7 @@ TabParent::DeallocPPluginWidgetParent(mozilla::plugins::PPluginWidgetParent* aAc
|
||||
PPaymentRequestParent*
|
||||
TabParent::AllocPPaymentRequestParent()
|
||||
{
|
||||
RefPtr<PaymentRequestParent> actor = new PaymentRequestParent(GetTabId());
|
||||
RefPtr<PaymentRequestParent> actor = new PaymentRequestParent();
|
||||
return actor.forget().take();
|
||||
}
|
||||
|
||||
|
||||
@@ -32,23 +32,10 @@
|
||||
#include "nsRFPService.h"
|
||||
#include "nsServiceManagerUtils.h"
|
||||
|
||||
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
|
||||
// GetTickCount() and conflicts with NS_DECL_NSIDOMMEDIASTREAM, containing
|
||||
// currentTime getter.
|
||||
#ifdef GetCurrentTime
|
||||
#undef GetCurrentTime
|
||||
#endif
|
||||
|
||||
#ifdef LOG
|
||||
#undef LOG
|
||||
#endif
|
||||
|
||||
// GetCurrentTime is defined in winbase.h as zero argument macro forwarding to
|
||||
// GetTickCount() and conflicts with MediaStream::GetCurrentTime.
|
||||
#ifdef GetCurrentTime
|
||||
#undef GetCurrentTime
|
||||
#endif
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layers;
|
||||
@@ -414,9 +401,9 @@ NS_INTERFACE_MAP_END_INHERITING(DOMMediaStream)
|
||||
|
||||
DOMMediaStream::DOMMediaStream(nsPIDOMWindowInner* aWindow,
|
||||
MediaStreamTrackSourceGetter* aTrackSourceGetter)
|
||||
: mLogicalStreamStartTime(0), mWindow(aWindow),
|
||||
mInputStream(nullptr), mOwnedStream(nullptr), mPlaybackStream(nullptr),
|
||||
mTracksPendingRemoval(0), mTrackSourceGetter(aTrackSourceGetter),
|
||||
: mWindow(aWindow), mInputStream(nullptr), mOwnedStream(nullptr),
|
||||
mPlaybackStream(nullptr), mTracksPendingRemoval(0),
|
||||
mTrackSourceGetter(aTrackSourceGetter),
|
||||
mPlaybackTrackListener(MakeAndAddRef<PlaybackTrackListener>(this)),
|
||||
mTracksCreated(false), mNotifiedOfMediaStreamGraphShutdown(false),
|
||||
mActive(false), mSetInactiveOnFinish(false), mCORSMode(CORS_NONE)
|
||||
@@ -565,20 +552,6 @@ DOMMediaStream::Constructor(const GlobalObject& aGlobal,
|
||||
return newStream.forget();
|
||||
}
|
||||
|
||||
double
|
||||
DOMMediaStream::CurrentTime()
|
||||
{
|
||||
if (!mPlaybackStream) {
|
||||
return 0.0;
|
||||
}
|
||||
// The value of a MediaStream's CurrentTime will always advance forward; it will never
|
||||
// reset (even if one rewinds a video.) Therefore we can use a single Random Seed
|
||||
// initialized at the same time as the object.
|
||||
return nsRFPService::ReduceTimePrecisionAsSecs(mPlaybackStream->
|
||||
StreamTimeToSeconds(mPlaybackStream->GetCurrentTime() - mLogicalStreamStartTime),
|
||||
GetRandomTimelineSeed());
|
||||
}
|
||||
|
||||
already_AddRefed<Promise>
|
||||
DOMMediaStream::CountUnderlyingStreams(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||
{
|
||||
|
||||
@@ -19,12 +19,6 @@
|
||||
#include "mozilla/RelativeTimeline.h"
|
||||
#include "PrincipalChangeObserver.h"
|
||||
|
||||
// X11 has a #define for CurrentTime. Unbelievable :-(.
|
||||
// See dom/media/webaudio/AudioContext.h for more fun!
|
||||
#ifdef CurrentTime
|
||||
#undef CurrentTime
|
||||
#endif
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class AbstractThread;
|
||||
@@ -357,8 +351,6 @@ public:
|
||||
const dom::Sequence<OwningNonNull<MediaStreamTrack>>& aTracks,
|
||||
ErrorResult& aRv);
|
||||
|
||||
double CurrentTime();
|
||||
|
||||
static already_AddRefed<dom::Promise>
|
||||
CountUnderlyingStreams(const dom::GlobalObject& aGlobal, ErrorResult& aRv);
|
||||
|
||||
@@ -522,11 +514,6 @@ public:
|
||||
nsIPrincipal* aPrincipal,
|
||||
MediaStreamGraph* aGraph);
|
||||
|
||||
void SetLogicalStreamStartTime(StreamTime aTime)
|
||||
{
|
||||
mLogicalStreamStartTime = aTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a MediaStreamTrack to mTracks and raises "addtrack".
|
||||
*
|
||||
@@ -662,9 +649,6 @@ protected:
|
||||
// the principal changes.
|
||||
void RecomputePrincipal();
|
||||
|
||||
// StreamTime at which the currentTime attribute would return 0.
|
||||
StreamTime mLogicalStreamStartTime;
|
||||
|
||||
// We need this to track our parent object.
|
||||
nsCOMPtr<nsPIDOMWindowInner> mWindow;
|
||||
|
||||
|
||||
@@ -1312,10 +1312,6 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
// Start currentTime from the point where this stream was successfully
|
||||
// returned.
|
||||
aStream->SetLogicalStreamStartTime(aStream->GetPlaybackStream()->GetCurrentTime());
|
||||
|
||||
// This is safe since we're on main-thread, and the windowlist can only
|
||||
// be invalidated from the main-thread (see OnNavigation)
|
||||
LOG(("Returning success for getUserMedia()"));
|
||||
|
||||
@@ -1221,9 +1221,6 @@ class RTCPeerConnection {
|
||||
}
|
||||
|
||||
addTrack(track, stream) {
|
||||
if (stream.currentTime === undefined) {
|
||||
throw new this._win.DOMException("invalid stream.", "InvalidParameterError");
|
||||
}
|
||||
this._checkClosed();
|
||||
|
||||
if (this._transceivers.some(
|
||||
|
||||
@@ -38,7 +38,6 @@ function startTest(test) {
|
||||
var stream;
|
||||
|
||||
var checkEnded = function() {
|
||||
is(stream.currentTime, vout.currentTime, test.name + " stream final currentTime");
|
||||
if (test.duration) {
|
||||
isGreaterThanOrEqualEps(vout.currentTime, test.duration,
|
||||
test.name + " current time at end");
|
||||
@@ -58,7 +57,6 @@ function startTest(test) {
|
||||
|
||||
var onloadedmetadata = function (ev) {
|
||||
stream = v.mozCaptureStreamUntilEnded();
|
||||
is(stream.currentTime, 0, test.name + " stream initial currentTime");
|
||||
vout.srcObject = stream;
|
||||
is(vout.srcObject, stream, test.name + " set output element .srcObject correctly");
|
||||
v.play();
|
||||
|
||||
@@ -92,12 +92,10 @@ MediaStreamPlayback.prototype = {
|
||||
* Verifies that media is playing.
|
||||
*/
|
||||
verifyPlaying : function() {
|
||||
var lastStreamTime = this.mediaStream.currentTime;
|
||||
var lastElementTime = this.mediaElement.currentTime;
|
||||
|
||||
var mediaTimeProgressed = listenUntil(this.mediaElement, 'timeupdate',
|
||||
() => this.mediaStream.currentTime > lastStreamTime &&
|
||||
this.mediaElement.currentTime > lastElementTime);
|
||||
() => this.mediaElement.currentTime > lastElementTime);
|
||||
|
||||
return timeout(Promise.all([this.canPlayThroughFired, mediaTimeProgressed]),
|
||||
VERIFYPLAYING_TIMEOUT_LENGTH, "verifyPlaying timed out")
|
||||
|
||||
@@ -75,7 +75,7 @@ runNetworkTest(function() {
|
||||
.then(() => pcall(pc1, pc1.setRemoteDescription, pc2.localDescription))
|
||||
.then(() => delivered)
|
||||
// .then(() => canPlayThrough) // why doesn't this fire?
|
||||
.then(() => waitUntil(() => v2.currentTime > 0 && v2.srcObject.currentTime > 0))
|
||||
.then(() => waitUntil(() => v2.currentTime > 0))
|
||||
.then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
|
||||
.then(() => ok(true, "Connected."))
|
||||
.then(() => pcall(pc1, pc1.getStats, null))
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
.then(() => pc1.setRemoteDescription(pc2.localDescription))
|
||||
.then(() => delivered)
|
||||
// .then(() => canPlayThrough) // why doesn't this fire?
|
||||
.then(() => waitUntil(() => v2.currentTime > 0 && v2.srcObject.currentTime > 0))
|
||||
.then(() => waitUntil(() => v2.currentTime > 0))
|
||||
.then(() => ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")"))
|
||||
.then(() => ok(true, "Connected."))
|
||||
.catch(reason => ok(false, "unexpected failure: " + reason))
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
await v2loadedmetadata;
|
||||
|
||||
await waitUntil(() => v2.currentTime > 0 && v2.srcObject.currentTime > 0);
|
||||
await waitUntil(() => v2.currentTime > 0);
|
||||
ok(v2.currentTime > 0, "v2.currentTime is moving (" + v2.currentTime + ")");
|
||||
|
||||
ok(v1.videoWidth > 0, "source width is positive");
|
||||
|
||||
@@ -203,6 +203,8 @@ MediaEngineWebRTCMicrophoneSource::Reconfigure(
|
||||
|
||||
ApplySettings(outputPrefs);
|
||||
|
||||
mCurrentPrefs = outputPrefs;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -496,6 +498,8 @@ MediaEngineWebRTCMicrophoneSource::Allocate(
|
||||
return NS_OK;
|
||||
}));
|
||||
|
||||
mCurrentPrefs = outputPrefs;
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -671,6 +675,8 @@ MediaEngineWebRTCMicrophoneSource::Start(const RefPtr<const AllocationHandle>&)
|
||||
return NS_OK;
|
||||
}));
|
||||
|
||||
ApplySettings(mCurrentPrefs);
|
||||
|
||||
MOZ_ASSERT(mState != kReleased);
|
||||
mState = kStarted;
|
||||
|
||||
|
||||
@@ -136,6 +136,9 @@ private:
|
||||
// Current state of the resource for this source.
|
||||
MediaEngineSourceState mState;
|
||||
|
||||
// The current preferences for the APM's various processing stages.
|
||||
MediaEnginePrefs mCurrentPrefs;
|
||||
|
||||
// The SourecMediaStream on which to append data for this microphone. Set in
|
||||
// SetTrack as part of the initialization, and nulled in ::Deallocate.
|
||||
RefPtr<SourceMediaStream> mStream;
|
||||
|
||||
@@ -674,14 +674,14 @@ PaymentOptions::GetShippingType(nsAString& aShippingType)
|
||||
NS_IMPL_ISUPPORTS(PaymentRequest,
|
||||
nsIPaymentRequest)
|
||||
|
||||
PaymentRequest::PaymentRequest(const uint64_t aTabId,
|
||||
PaymentRequest::PaymentRequest(const uint64_t aTopOuterWindowId,
|
||||
const nsAString& aRequestId,
|
||||
nsIPrincipal* aTopLevelPrincipal,
|
||||
nsIArray* aPaymentMethods,
|
||||
nsIPaymentDetails* aPaymentDetails,
|
||||
nsIPaymentOptions* aPaymentOptions,
|
||||
const nsAString& aShippingOption)
|
||||
: mTabId(aTabId)
|
||||
: mTopOuterWindowId(aTopOuterWindowId)
|
||||
, mRequestId(aRequestId)
|
||||
, mTopLevelPrincipal(aTopLevelPrincipal)
|
||||
, mPaymentMethods(aPaymentMethods)
|
||||
@@ -693,10 +693,10 @@ PaymentRequest::PaymentRequest(const uint64_t aTabId,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PaymentRequest::GetTabId(uint64_t* aTabId)
|
||||
PaymentRequest::GetTopOuterWindowId(uint64_t* aTopOuterWindowId)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aTabId);
|
||||
*aTabId = mTabId;
|
||||
NS_ENSURE_ARG_POINTER(aTopOuterWindowId);
|
||||
*aTopOuterWindowId = mTopOuterWindowId;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPAYMENTREQUEST
|
||||
|
||||
PaymentRequest(const uint64_t aTabId,
|
||||
PaymentRequest(const uint64_t aTopOuterWindowId,
|
||||
const nsAString& aRequestId,
|
||||
nsIPrincipal* aPrincipal,
|
||||
nsIArray* aPaymentMethods,
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
private:
|
||||
~PaymentRequest() = default;
|
||||
|
||||
uint64_t mTabId;
|
||||
uint64_t mTopOuterWindowId;
|
||||
nsString mRequestId;
|
||||
nsString mCompleteStatus;
|
||||
nsCOMPtr<nsIPrincipal> mTopLevelPrincipal;
|
||||
|
||||
@@ -463,7 +463,15 @@ PaymentRequestManager::CreatePayment(JSContext* aCx,
|
||||
IPCPaymentOptions options;
|
||||
ConvertOptions(aOptions, options);
|
||||
|
||||
IPCPaymentCreateActionRequest action(internalId,
|
||||
nsCOMPtr<nsPIDOMWindowOuter> outerWindow = aWindow->GetOuterWindow();
|
||||
MOZ_ASSERT(outerWindow);
|
||||
if (nsCOMPtr<nsPIDOMWindowOuter> topOuterWindow = outerWindow->GetTop()) {
|
||||
outerWindow = topOuterWindow;
|
||||
}
|
||||
uint64_t topOuterWindowId = outerWindow->WindowID();
|
||||
|
||||
IPCPaymentCreateActionRequest action(topOuterWindowId,
|
||||
internalId,
|
||||
IPC::Principal(aTopLevelPrincipal),
|
||||
methodData,
|
||||
details,
|
||||
|
||||
@@ -234,7 +234,6 @@ PaymentRequestService::RequestPayment(const nsAString& aRequestId,
|
||||
case IPCPaymentActionRequest::TIPCPaymentCreateActionRequest: {
|
||||
MOZ_ASSERT(!request);
|
||||
const IPCPaymentCreateActionRequest& action = aAction;
|
||||
uint64_t tabId = aIPC->GetTabId();
|
||||
nsCOMPtr<nsIMutableArray> methodData = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
MOZ_ASSERT(methodData);
|
||||
for (IPCPaymentMethodData data : action.methodData()) {
|
||||
@@ -251,7 +250,7 @@ PaymentRequestService::RequestPayment(const nsAString& aRequestId,
|
||||
rv = payments::PaymentOptions::Create(action.options(), getter_AddRefs(options));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
RefPtr<payments::PaymentRequest> request =
|
||||
new payments::PaymentRequest(tabId,
|
||||
new payments::PaymentRequest(action.topOuterWindowId(),
|
||||
aRequestId,
|
||||
action.topLevelPrincipal(),
|
||||
methodData,
|
||||
|
||||
@@ -70,6 +70,7 @@ struct IPCPaymentOptions
|
||||
|
||||
struct IPCPaymentCreateActionRequest
|
||||
{
|
||||
uint64_t topOuterWindowId;
|
||||
nsString requestId;
|
||||
Principal topLevelPrincipal;
|
||||
IPCPaymentMethodData[] methodData;
|
||||
|
||||
@@ -17,9 +17,8 @@
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
PaymentRequestParent::PaymentRequestParent(uint64_t aTabId)
|
||||
PaymentRequestParent::PaymentRequestParent()
|
||||
: mActorAlive(true)
|
||||
, mTabId(aTabId)
|
||||
, mRequestId(EmptyString())
|
||||
{
|
||||
}
|
||||
@@ -88,12 +87,6 @@ PaymentRequestParent::RecvRequestPayment(const IPCPaymentActionRequest& aRequest
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
uint64_t
|
||||
PaymentRequestParent::GetTabId()
|
||||
{
|
||||
return mTabId;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PaymentRequestParent::RespondPayment(nsIPaymentActionResponse* aResponse)
|
||||
{
|
||||
|
||||
@@ -18,9 +18,8 @@ class PaymentRequestParent final : public PPaymentRequestParent
|
||||
{
|
||||
NS_INLINE_DECL_REFCOUNTING(PaymentRequestParent)
|
||||
public:
|
||||
explicit PaymentRequestParent(uint64_t aTabId);
|
||||
PaymentRequestParent();
|
||||
|
||||
uint64_t GetTabId();
|
||||
nsresult RespondPayment(nsIPaymentActionResponse* aResponse);
|
||||
nsresult ChangeShippingAddress(const nsAString& aRequestId,
|
||||
nsIPaymentAddress* aAddress);
|
||||
@@ -47,7 +46,6 @@ private:
|
||||
nsIPaymentResponseData* aData);
|
||||
|
||||
bool mActorAlive;
|
||||
uint64_t mTabId;
|
||||
nsString mRequestId;
|
||||
};
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ interface MediaStream : EventTarget {
|
||||
readonly attribute boolean active;
|
||||
attribute EventHandler onaddtrack;
|
||||
attribute EventHandler onremovetrack;
|
||||
readonly attribute double currentTime;
|
||||
|
||||
[ChromeOnly, Throws]
|
||||
static Promise<long> countUnderlyingStreams();
|
||||
|
||||
@@ -4,7 +4,11 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://w3c.github.io/hr-time/
|
||||
* https://w3c.github.io/hr-time/#sec-performance
|
||||
* https://w3c.github.io/navigation-timing/#extensions-to-the-performance-interface
|
||||
* https://w3c.github.io/performance-timeline/#extensions-to-the-performance-interface
|
||||
* https://w3c.github.io/resource-timing/#sec-extensions-performance-interface
|
||||
* https://w3c.github.io/user-timing/#extensions-performance-interface
|
||||
*
|
||||
* Copyright © 2015 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* W3C liability, trademark and document use rules apply.
|
||||
@@ -13,6 +17,7 @@
|
||||
typedef double DOMHighResTimeStamp;
|
||||
typedef sequence <PerformanceEntry> PerformanceEntryList;
|
||||
|
||||
// https://w3c.github.io/hr-time/#sec-performance
|
||||
[Exposed=(Window,Worker)]
|
||||
interface Performance : EventTarget {
|
||||
[DependsOn=DeviceState, Affects=Nothing]
|
||||
@@ -20,19 +25,20 @@ interface Performance : EventTarget {
|
||||
|
||||
[Constant]
|
||||
readonly attribute DOMHighResTimeStamp timeOrigin;
|
||||
|
||||
[Default] object toJSON();
|
||||
};
|
||||
|
||||
// https://w3c.github.io/navigation-timing/#extensions-to-the-performance-interface
|
||||
[Exposed=Window]
|
||||
partial interface Performance {
|
||||
[Constant]
|
||||
readonly attribute PerformanceTiming timing;
|
||||
[Constant]
|
||||
readonly attribute PerformanceNavigation navigation;
|
||||
|
||||
[Default] object toJSON();
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/performance-timeline/#sec-window.performance-attribute
|
||||
// https://w3c.github.io/performance-timeline/#extensions-to-the-performance-interface
|
||||
[Exposed=(Window,Worker)]
|
||||
partial interface Performance {
|
||||
PerformanceEntryList getEntries();
|
||||
@@ -41,7 +47,7 @@ partial interface Performance {
|
||||
entryType);
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/resource-timing/#extensions-performance-interface
|
||||
// https://w3c.github.io/resource-timing/#sec-extensions-performance-interface
|
||||
[Exposed=(Window,Worker)]
|
||||
partial interface Performance {
|
||||
void clearResourceTimings();
|
||||
@@ -56,7 +62,7 @@ partial interface Performance {
|
||||
readonly attribute object mozMemory;
|
||||
};
|
||||
|
||||
// http://www.w3.org/TR/user-timing/
|
||||
// https://w3c.github.io/user-timing/#extensions-performance-interface
|
||||
[Exposed=(Window,Worker)]
|
||||
partial interface Performance {
|
||||
[Throws]
|
||||
@@ -66,4 +72,3 @@ partial interface Performance {
|
||||
void measure(DOMString measureName, optional DOMString startMark, optional DOMString endMark);
|
||||
void clearMeasures(optional DOMString measureName);
|
||||
};
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.w3c-test.org/webperf/specs/PerformanceTimeline/#sec-PerformanceEntry-interface
|
||||
* https://w3c.github.io/performance-timeline/#dom-performanceentry
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.w3.org/TR/hr-time/
|
||||
* https://w3c.github.io/navigation-timing/#the-performancenavigation-interface
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming
|
||||
* https://w3c.github.io/navigation-timing/#sec-PerformanceNavigationTiming
|
||||
*
|
||||
* Copyright © 2016 W3C® (MIT, ERCIM, Keio, Beihang).
|
||||
* W3C liability, trademark and document use rules apply.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://w3c.github.io/resource-timing/#performanceresourcetiming
|
||||
* https://w3c.github.io/resource-timing/#sec-performanceresourcetiming
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* https://w3c.github.io/server-timing/
|
||||
* https://w3c.github.io/server-timing/#the-performanceservertiming-interface
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://www.w3.org/TR/hr-time/
|
||||
* https://w3c.github.io/navigation-timing/#the-performancetiming-interface
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
|
||||
@@ -678,6 +678,13 @@ struct WebRenderMemoryReporterHelper {
|
||||
ReportInternal(aBytes, path, desc, nsIMemoryReporter::KIND_OTHER);
|
||||
}
|
||||
|
||||
void ReportTotalGPUBytes(size_t aBytes) const
|
||||
{
|
||||
nsCString path(NS_LITERAL_CSTRING("gfx/webrender/total-gpu-bytes"));
|
||||
nsCString desc(NS_LITERAL_CSTRING("Total GPU bytes used by WebRender (should match textures/ sum)"));
|
||||
ReportInternal(aBytes, path, desc, nsIMemoryReporter::KIND_OTHER);
|
||||
}
|
||||
|
||||
void ReportInternal(size_t aBytes, nsACString& aPath, nsACString& aDesc, int32_t aKind) const
|
||||
{
|
||||
// Generally, memory reporters pass the empty string as the process name to
|
||||
@@ -741,6 +748,9 @@ WebRenderMemoryReporter::CollectReports(nsIHandleReportCallback* aHandleReport,
|
||||
helper.ReportTexture(aReport.texture_cache_textures, "texture-cache");
|
||||
helper.ReportTexture(aReport.depth_target_textures, "depth-targets");
|
||||
|
||||
// Total GPU bytes, for sanity-checking the above.
|
||||
helper.ReportTotalGPUBytes(aReport.total_gpu_bytes_allocated);
|
||||
|
||||
FinishAsyncMemoryReport();
|
||||
},
|
||||
[](mozilla::ipc::ResponseRejectReason aReason) {
|
||||
|
||||
@@ -976,9 +976,12 @@ LongestPhaseSelfTimeInMajorGC(const Statistics::PhaseTimeTable& times)
|
||||
if (parent != Phase::NONE) {
|
||||
bool ok = CheckSelfTime(parent, i, times, selfTimes, times[i]);
|
||||
|
||||
// This happens very occasionally in release builds. Skip collecting
|
||||
// longest phase telemetry if it does.
|
||||
// This happens very occasionally in release builds and frequently
|
||||
// in Windows debug builds. Skip collecting longest phase telemetry
|
||||
// if it does.
|
||||
#ifndef XP_WIN
|
||||
MOZ_ASSERT(ok, "Inconsistent time data; see bug 1400153");
|
||||
#endif
|
||||
if (!ok) {
|
||||
return PhaseKind::NONE;
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ if (build['debug'] && isSimulator)
|
||||
quit();
|
||||
|
||||
// All the glue code is wrapped in a function so it can be executed uncached and
|
||||
// cached (via the shared cacheEntry argument).
|
||||
function runBox2d(cacheEntry) {
|
||||
// cached or compiled separately.
|
||||
function runBox2d(cacheEntryOrModule) {
|
||||
|
||||
// The Module object: Our interface to the outside world. We import
|
||||
// and export values on it, and do the work to get that through
|
||||
@@ -1499,12 +1499,15 @@ function integrateWasmJS(Module) {
|
||||
Module['printErr']('asynchronously preparing wasm');
|
||||
addRunDependency('wasm-instantiate'); // we can't run yet
|
||||
|
||||
(wasmStreamingIsSupported()
|
||||
? WebAssembly.instantiateStreaming(cacheEntry, info)
|
||||
: WebAssembly.instantiate(cacheEntry.getBuffer(), info))
|
||||
(cacheEntryOrModule instanceof WebAssembly.Module
|
||||
? WebAssembly.instantiate(cacheEntryOrModule, info)
|
||||
.then(instance => ({instance, module:cacheEntryOrModule}))
|
||||
: wasmStreamingIsSupported()
|
||||
? WebAssembly.instantiateStreaming(cacheEntryOrModule, info)
|
||||
: WebAssembly.instantiate(cacheEntryOrModule.getBuffer(), info))
|
||||
.then(function(output) {
|
||||
if (!cacheEntry.module)
|
||||
cacheEntry.module = output.module;
|
||||
if (!cacheEntryOrModule.module)
|
||||
cacheEntryOrModule.module = output.module;
|
||||
|
||||
// receiveInstance() will swap in the exports (to Module.asm) so they can be called
|
||||
receiveInstance(output.instance);
|
||||
@@ -3044,8 +3047,10 @@ drainJobQueue();
|
||||
|
||||
}; // End of function wrapping the whole top-level Emscripten glue code
|
||||
|
||||
const bytecode = os.file.readFile(scriptdir + 'wasm_box2d.wasm', 'binary');
|
||||
|
||||
setBufferStreamParams(/* delayMillis = */ 1, /* chunkSize = */ 1000);
|
||||
const cacheEntry = streamCacheEntry(os.file.readFile(scriptdir + 'wasm_box2d.wasm', 'binary'));
|
||||
const cacheEntry = streamCacheEntry(bytecode);
|
||||
|
||||
runBox2d(cacheEntry);
|
||||
|
||||
@@ -3053,3 +3058,7 @@ while (!wasmHasTier2CompilationCompleted(cacheEntry.module)) sleep(1);
|
||||
assertEq(cacheEntry.cached, wasmCachingIsSupported());
|
||||
|
||||
runBox2d(cacheEntry);
|
||||
|
||||
if (wasmCachingIsSupported()) {
|
||||
runBox2d(wasmCompileInSeparateProcess(bytecode));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,12 @@ function testCached(code, imports, test) {
|
||||
.then(m => {
|
||||
test(new Instance(m, imports));
|
||||
assertEq(cache.cached, wasmCachingIsSupported());
|
||||
|
||||
if (wasmCachingIsSupported()) {
|
||||
let m2 = wasmCompileInSeparateProcess(code);
|
||||
test(new Instance(m2, imports));
|
||||
}
|
||||
|
||||
success = true;
|
||||
})
|
||||
.catch(err => { print(String(err) + " at:\n" + err.stack) });
|
||||
@@ -29,6 +35,22 @@ function testCached(code, imports, test) {
|
||||
assertEq(success, true);
|
||||
}
|
||||
|
||||
testCached(`(module
|
||||
(func $test (param i64) (result f64)
|
||||
get_local 0
|
||||
f64.convert_u/i64
|
||||
)
|
||||
(func (export "run") (result i32)
|
||||
i64.const 1
|
||||
call $test
|
||||
f64.const 1
|
||||
f64.eq
|
||||
)
|
||||
)`,
|
||||
undefined,
|
||||
i => { assertEq(i.exports.run(), 1); }
|
||||
);
|
||||
|
||||
testCached(
|
||||
`(module
|
||||
(func (export "run") (result i32)
|
||||
|
||||
@@ -2559,7 +2559,7 @@ jit::RemoveUnmarkedBlocks(MIRGenerator* mir, MIRGraph& graph, uint32_t numMarked
|
||||
// bailout.
|
||||
for (PostorderIterator it(graph.poBegin()); it != graph.poEnd();) {
|
||||
MBasicBlock* block = *it++;
|
||||
if (!block->isMarked()) {
|
||||
if (block->isMarked()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "vm/TraceLogging.h"
|
||||
#include "vm/TypeInference.h"
|
||||
#include "wasm/WasmBuiltins.h"
|
||||
#include "wasm/WasmInstance.h"
|
||||
|
||||
#include "gc/Nursery-inl.h"
|
||||
#include "jit/JSJitFrameIter-inl.h"
|
||||
|
||||
@@ -120,7 +120,6 @@
|
||||
#include "vm/TypedArrayObject.h"
|
||||
#include "vm/WrapperObject.h"
|
||||
#include "wasm/WasmJS.h"
|
||||
#include "wasm/WasmModule.h"
|
||||
|
||||
#include "vm/Compartment-inl.h"
|
||||
#include "vm/ErrorObject-inl.h"
|
||||
@@ -5635,29 +5634,6 @@ runOffThreadDecodedScript(JSContext* cx, unsigned argc, Value* vp)
|
||||
return JS_ExecuteScript(cx, script, args.rval());
|
||||
}
|
||||
|
||||
struct MOZ_RAII FreeOnReturn
|
||||
{
|
||||
JSContext* cx;
|
||||
const char* ptr;
|
||||
MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER
|
||||
|
||||
explicit FreeOnReturn(JSContext* cx, const char* ptr = nullptr
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_PARAM)
|
||||
: cx(cx), ptr(ptr)
|
||||
{
|
||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||
}
|
||||
|
||||
void init(const char* ptr) {
|
||||
MOZ_ASSERT(!this->ptr);
|
||||
this->ptr = ptr;
|
||||
}
|
||||
|
||||
~FreeOnReturn() {
|
||||
JS_free(cx, (void*)ptr);
|
||||
}
|
||||
};
|
||||
|
||||
static int sArgc;
|
||||
static char** sArgv;
|
||||
|
||||
@@ -5847,6 +5823,313 @@ NestedShell(JSContext* cx, unsigned argc, Value* vp)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
ReadAll(int fd, wasm::Bytes* bytes)
|
||||
{
|
||||
size_t lastLength = bytes->length();
|
||||
while (true) {
|
||||
static const int ChunkSize = 64 * 1024;
|
||||
if (!bytes->growBy(ChunkSize)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
intptr_t readCount;
|
||||
while (true) {
|
||||
readCount = read(fd, bytes->begin() + lastLength, ChunkSize);
|
||||
if (readCount >= 0) {
|
||||
break;
|
||||
}
|
||||
if (errno != EINTR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (readCount < ChunkSize) {
|
||||
bytes->shrinkTo(lastLength + readCount);
|
||||
if (readCount == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
lastLength = bytes->length();
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
WriteAll(int fd, const uint8_t* bytes, size_t length)
|
||||
{
|
||||
while (length > 0) {
|
||||
int written = write(fd, bytes, length);
|
||||
if (written < 0) {
|
||||
if (errno == EINTR) {
|
||||
continue;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
MOZ_ASSERT(unsigned(written) <= length);
|
||||
length -= written;
|
||||
bytes += written;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
class AutoPipe
|
||||
{
|
||||
int fds_[2];
|
||||
|
||||
public:
|
||||
AutoPipe()
|
||||
{
|
||||
fds_[0] = -1;
|
||||
fds_[1] = -1;
|
||||
}
|
||||
|
||||
~AutoPipe() {
|
||||
if (fds_[0] != -1) {
|
||||
close(fds_[0]);
|
||||
}
|
||||
if (fds_[1] != -1) {
|
||||
close(fds_[1]);
|
||||
}
|
||||
}
|
||||
|
||||
bool init() {
|
||||
#ifdef XP_WIN
|
||||
return !_pipe(fds_, 4096, O_BINARY);
|
||||
#else
|
||||
return !pipe(fds_);
|
||||
#endif
|
||||
}
|
||||
|
||||
int reader() const {
|
||||
MOZ_ASSERT(fds_[0] != -1);
|
||||
return fds_[0];
|
||||
}
|
||||
|
||||
int writer() const {
|
||||
MOZ_ASSERT(fds_[1] != -1);
|
||||
return fds_[1];
|
||||
}
|
||||
|
||||
void closeReader() {
|
||||
MOZ_ASSERT(fds_[0] != -1);
|
||||
close(fds_[0]);
|
||||
fds_[0] = -1;
|
||||
}
|
||||
|
||||
void closeWriter() {
|
||||
MOZ_ASSERT(fds_[1] != -1);
|
||||
close(fds_[1]);
|
||||
fds_[1] = -1;
|
||||
}
|
||||
};
|
||||
|
||||
static bool
|
||||
CompileAndSerializeInSeparateProcess(JSContext* cx, const uint8_t* bytecode, size_t bytecodeLength,
|
||||
wasm::Bytes* serialized)
|
||||
{
|
||||
AutoPipe stdIn, stdOut;
|
||||
if (!stdIn.init() || !stdOut.init()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
AutoCStringVector argv(cx);
|
||||
|
||||
UniqueChars argv0 = DuplicateString(cx, sArgv[0]);
|
||||
if (!argv0 || !argv.append(std::move(argv0))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UniqueChars argv1 = DuplicateString("--wasm-compile-and-serialize");
|
||||
if (!argv1 || !argv.append(std::move(argv1))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
// The spawned process will have all the stdIn/stdOut file handles open, but
|
||||
// without the power of fork, we need some other way to communicate the
|
||||
// integer fd values so we encode them in argv and WasmCompileAndSerialize()
|
||||
// has a matching #ifdef XP_WIN to parse them out. Communicate both ends of
|
||||
// both pipes so the child process can closed the unused ends.
|
||||
|
||||
UniqueChars argv2 = JS_smprintf("%d", stdIn.reader());
|
||||
if (!argv2 || !argv.append(std::move(argv2))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UniqueChars argv3 = JS_smprintf("%d", stdIn.writer());
|
||||
if (!argv3 || !argv.append(std::move(argv3))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UniqueChars argv4 = JS_smprintf("%d", stdOut.reader());
|
||||
if (!argv4 || !argv.append(std::move(argv4))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
UniqueChars argv5 = JS_smprintf("%d", stdOut.writer());
|
||||
if (!argv5 || !argv.append(std::move(argv5))) {
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (unsigned i = 0; i < sPropagatedFlags.length(); i++) {
|
||||
UniqueChars flags = DuplicateString(cx, sPropagatedFlags[i]);
|
||||
if (!flags || !argv.append(std::move(flags))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!argv.append(nullptr)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef XP_WIN
|
||||
if (!EscapeForShell(cx, argv)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int childPid = _spawnv(P_NOWAIT, sArgv[0], argv.get());
|
||||
if (childPid == -1) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
pid_t childPid = fork();
|
||||
switch (childPid) {
|
||||
case -1:
|
||||
return false;
|
||||
case 0:
|
||||
// In the child process. Redirect stdin/stdout to the respective ends of
|
||||
// the pipes. Closing stdIn.writer() is necessary for stdin to hit EOF.
|
||||
// This case statement must not return before exec() takes over. Rather,
|
||||
// exit(-1) is used to return failure to the parent process.
|
||||
if (dup2(stdIn.reader(), STDIN_FILENO) == -1) {
|
||||
exit(-1);
|
||||
}
|
||||
if (dup2(stdOut.writer(), STDOUT_FILENO) == -1) {
|
||||
exit(-1);
|
||||
}
|
||||
close(stdIn.reader());
|
||||
close(stdIn.writer());
|
||||
close(stdOut.reader());
|
||||
close(stdOut.writer());
|
||||
execv(sArgv[0], argv.get());
|
||||
exit(-1);
|
||||
}
|
||||
#endif
|
||||
|
||||
// In the parent process. Closing stdOut.writer() is necessary for
|
||||
// stdOut.reader() below to hit EOF.
|
||||
stdIn.closeReader();
|
||||
stdOut.closeWriter();
|
||||
|
||||
if (!WriteAll(stdIn.writer(), bytecode, bytecodeLength)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
stdIn.closeWriter();
|
||||
|
||||
if (!ReadAll(stdOut.reader(), serialized)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
stdOut.closeReader();
|
||||
|
||||
int status;
|
||||
#ifdef XP_WIN
|
||||
if (_cwait(&status, childPid, WAIT_CHILD) == -1) {
|
||||
return false;
|
||||
}
|
||||
#else
|
||||
while (true) {
|
||||
if (waitpid(childPid, &status, 0) >= 0) {
|
||||
break;
|
||||
}
|
||||
if (errno != EINTR) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return status == 0;
|
||||
}
|
||||
|
||||
static bool
|
||||
WasmCompileAndSerialize(JSContext* cx)
|
||||
{
|
||||
MOZ_ASSERT(wasm::HasCachingSupport(cx));
|
||||
|
||||
#ifdef XP_WIN
|
||||
// See CompileAndSerializeInSeparateProcess for why we've had to smuggle
|
||||
// these fd values through argv. Closing the writing ends is necessary for
|
||||
// the reading ends to hit EOF.
|
||||
MOZ_RELEASE_ASSERT(sArgc >= 6);
|
||||
MOZ_ASSERT(!strcmp(sArgv[1], "--wasm-compile-and-serialize"));
|
||||
int stdIn = atoi(sArgv[2]); // stdIn.reader()
|
||||
close(atoi(sArgv[3])); // stdIn.writer()
|
||||
close(atoi(sArgv[4])); // stdOut.reader()
|
||||
int stdOut = atoi(sArgv[5]); // stdOut.writer()
|
||||
#else
|
||||
int stdIn = STDIN_FILENO;
|
||||
int stdOut = STDOUT_FILENO;
|
||||
#endif
|
||||
|
||||
wasm::MutableBytes bytecode = js_new<wasm::ShareableBytes>();
|
||||
if (!ReadAll(stdIn, &bytecode->bytes)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
wasm::Bytes serialized;
|
||||
if (!wasm::CompileAndSerialize(*bytecode, &serialized)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!WriteAll(stdOut, serialized.begin(), serialized.length())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
WasmCompileInSeparateProcess(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
if (!wasm::HasCachingSupport(cx)) {
|
||||
JS_ReportErrorASCII(cx, "WebAssembly caching not supported");
|
||||
return false;
|
||||
}
|
||||
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
if (!args.requireAtLeast(cx, "wasmCompileInSeparateProcess", 1)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
SharedMem<uint8_t*> bytecode;
|
||||
size_t numBytes;
|
||||
if (!args[0].isObject() || !IsBufferSource(&args[0].toObject(), &bytecode, &numBytes)) {
|
||||
RootedObject callee(cx, &args.callee());
|
||||
ReportUsageErrorASCII(cx, callee, "Argument must be a buffer source");
|
||||
return false;
|
||||
}
|
||||
|
||||
wasm::Bytes serialized;
|
||||
if (!CompileAndSerializeInSeparateProcess(cx, bytecode.unwrap(), numBytes, &serialized)) {
|
||||
if (!cx->isExceptionPending()) {
|
||||
JS_ReportErrorASCII(cx, "creating and executing child process");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
RootedObject module(cx);
|
||||
if (!wasm::DeserializeModule(cx, serialized, &module)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
args.rval().setObject(*module);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
DecompileFunction(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
@@ -6531,7 +6814,7 @@ DisableGeckoProfiling(JSContext* cx, unsigned argc, Value* vp)
|
||||
//
|
||||
// For the SharedArrayBuffer and WasmMemoryObject we transmit the underlying
|
||||
// SharedArrayRawBuffer ("SARB"). For the WasmModuleObject we transmit the
|
||||
// underlying wasm::Module. The transmitted types are refcounted. When they
|
||||
// underlying JS::WasmModule. The transmitted types are refcounted. When they
|
||||
// are in the mailbox their reference counts are at least 1, accounting for the
|
||||
// reference from the mailbox.
|
||||
//
|
||||
@@ -6562,7 +6845,7 @@ struct SharedObjectMailbox
|
||||
SharedArrayRawBuffer* buffer;
|
||||
uint32_t length;
|
||||
} sarb;
|
||||
const wasm::Module* module;
|
||||
JS::WasmModule* module;
|
||||
double number;
|
||||
};
|
||||
|
||||
@@ -6683,8 +6966,7 @@ GetSharedObject(JSContext* cx, unsigned argc, Value* vp)
|
||||
|
||||
// WasmModuleObject::create() increments the refcount on the module
|
||||
// and signals an error and returns null if that fails.
|
||||
RootedObject proto(cx, &cx->global()->getPrototype(JSProto_WasmModule).toObject());
|
||||
newObj = WasmModuleObject::create(cx, *mbx->val.module, proto);
|
||||
newObj = mbx->val.module->createObject(cx);
|
||||
if (!newObj) {
|
||||
return false;
|
||||
}
|
||||
@@ -6738,10 +7020,9 @@ SetSharedObject(JSContext* cx, unsigned argc, Value* vp)
|
||||
JS_ReportErrorASCII(cx, "Invalid argument to SetSharedObject");
|
||||
return false;
|
||||
}
|
||||
} else if (obj->is<WasmModuleObject>()) {
|
||||
} else if (JS::IsWasmModuleObject(obj)) {
|
||||
tag = MailboxTag::WasmModule;
|
||||
value.module = &obj->as<WasmModuleObject>().module();
|
||||
value.module->AddRef();
|
||||
value.module = JS::GetWasmModule(obj).forget().take();
|
||||
} else {
|
||||
JS_ReportErrorASCII(cx, "Invalid argument to SetSharedObject");
|
||||
return false;
|
||||
@@ -8615,6 +8896,12 @@ JS_FN_HELP("parseBin", BinParse, 1, 0,
|
||||
"underneath you."),
|
||||
#endif // ENABLE_INTL_API
|
||||
|
||||
JS_FN_HELP("wasmCompileInSeparateProcess", WasmCompileInSeparateProcess, 1, 0,
|
||||
"wasmCompileInSeparateProcess(buffer)",
|
||||
" Compile the given buffer in a separate process, serialize the resulting\n"
|
||||
" wasm::Module into bytes, and deserialize those bytes in the current\n"
|
||||
" process, returning the resulting WebAssembly.Module."),
|
||||
|
||||
JS_FS_HELP_END
|
||||
};
|
||||
|
||||
@@ -10413,6 +10700,15 @@ SetWorkerContextOptions(JSContext* cx)
|
||||
static int
|
||||
Shell(JSContext* cx, OptionParser* op, char** envp)
|
||||
{
|
||||
if (op->getBoolOption("wasm-compile-and-serialize")) {
|
||||
if (!WasmCompileAndSerialize(cx)) {
|
||||
// Errors have been printed directly to stderr.
|
||||
MOZ_ASSERT(!cx->isExceptionPending());
|
||||
return -1;
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
#ifdef MOZ_CODE_COVERAGE
|
||||
InstallCoverageSignalHandlers();
|
||||
#endif
|
||||
@@ -10788,6 +11084,7 @@ main(int argc, char** argv, char** envp)
|
||||
|| !op.addBoolOption('\0', "no-async-stacks", "Disable async stacks")
|
||||
|| !op.addMultiStringOption('\0', "dll", "LIBRARY", "Dynamically load LIBRARY")
|
||||
|| !op.addBoolOption('\0', "suppress-minidump", "Suppress crash minidumps")
|
||||
|| !op.addBoolOption('\0', "wasm-compile-and-serialize", "Compile the wasm bytecode from stdin and serialize the results to stdout")
|
||||
)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "vm/Realm.h"
|
||||
#include "vm/SavedStacks.h"
|
||||
#include "vm/Stack.h"
|
||||
#include "wasm/WasmJS.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "vm/GeneratorObject.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/JSScript.h"
|
||||
#include "wasm/WasmInstance.h"
|
||||
|
||||
#include "jit/BaselineFrame-inl.h"
|
||||
#include "vm/JSObject-inl.h"
|
||||
@@ -742,7 +741,7 @@ inline GlobalObject*
|
||||
AbstractFramePtr::global() const
|
||||
{
|
||||
if (isWasmDebugFrame()) {
|
||||
return &wasmInstance()->object()->global();
|
||||
return asWasmDebugFrame()->global();
|
||||
}
|
||||
return &script()->global();
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "vm/Debugger.h"
|
||||
#include "vm/JSContext.h"
|
||||
#include "vm/Opcodes.h"
|
||||
#include "wasm/WasmInstance.h"
|
||||
|
||||
#include "jit/JSJitFrameIter-inl.h"
|
||||
#include "vm/Compartment-inl.h"
|
||||
|
||||
@@ -530,7 +530,7 @@ DecodeCodeSection(const ModuleEnvironment& env, DecoderT& d, ModuleGenerator& mg
|
||||
|
||||
SharedModule
|
||||
wasm::CompileBuffer(const CompileArgs& args, const ShareableBytes& bytecode, UniqueChars* error,
|
||||
UniqueCharsVector* warnings)
|
||||
UniqueCharsVector* warnings, UniqueLinkData* maybeLinkData)
|
||||
{
|
||||
MOZ_RELEASE_ASSERT(wasm::HaveSignalHandlers());
|
||||
|
||||
@@ -569,7 +569,7 @@ wasm::CompileBuffer(const CompileArgs& args, const ShareableBytes& bytecode, Uni
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return mg.finishModule(bytecode);
|
||||
return mg.finishModule(bytecode, nullptr, maybeLinkData);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -89,7 +89,8 @@ SharedModule
|
||||
CompileBuffer(const CompileArgs& args,
|
||||
const ShareableBytes& bytecode,
|
||||
UniqueChars* error,
|
||||
UniqueCharsVector* warnings);
|
||||
UniqueCharsVector* warnings,
|
||||
UniqueLinkData* maybeLinkData = nullptr);
|
||||
|
||||
// Attempt to compile the second tier of the given wasm::Module.
|
||||
|
||||
|
||||
@@ -1037,7 +1037,7 @@ ModuleGenerator::finishMetadata(const Bytes& bytecode)
|
||||
SharedModule
|
||||
ModuleGenerator::finishModule(const ShareableBytes& bytecode,
|
||||
JS::OptimizedEncodingListener* maybeTier2Listener,
|
||||
UniqueLinkData* maybeLinkDataOut)
|
||||
UniqueLinkData* maybeLinkData)
|
||||
{
|
||||
MOZ_ASSERT(mode() == CompileMode::Once || mode() == CompileMode::Tier1);
|
||||
|
||||
@@ -1154,10 +1154,9 @@ ModuleGenerator::finishModule(const ShareableBytes& bytecode,
|
||||
module->serialize(*linkData_, *maybeTier2Listener);
|
||||
}
|
||||
|
||||
if (maybeLinkDataOut) {
|
||||
MOZ_ASSERT(isAsmJS());
|
||||
if (maybeLinkData) {
|
||||
MOZ_ASSERT(!env_->debugEnabled());
|
||||
*maybeLinkDataOut = std::move(linkData_);
|
||||
*maybeLinkData = std::move(linkData_);
|
||||
}
|
||||
|
||||
return module;
|
||||
|
||||
@@ -233,7 +233,7 @@ class MOZ_STACK_CLASS ModuleGenerator
|
||||
|
||||
SharedModule finishModule(const ShareableBytes& bytecode,
|
||||
JS::OptimizedEncodingListener* maybeTier2Listener = nullptr,
|
||||
UniqueLinkData* maybeLinkDataOut = nullptr);
|
||||
UniqueLinkData* maybeLinkData = nullptr);
|
||||
MOZ_MUST_USE bool finishTier2(const Module& module);
|
||||
|
||||
ExclusiveDeferredValidationState& deferredValidationState() {
|
||||
|
||||
@@ -385,7 +385,7 @@ DescribeScriptedCaller(JSContext* cx, ScriptedCaller* caller, const char* introd
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Fuzzing support
|
||||
// Testing / Fuzzing support
|
||||
|
||||
bool
|
||||
wasm::Eval(JSContext* cx, Handle<TypedArrayObject*> code, HandleObject importObj,
|
||||
@@ -442,6 +442,50 @@ wasm::Eval(JSContext* cx, Handle<TypedArrayObject*> code, HandleObject importObj
|
||||
instanceObj);
|
||||
}
|
||||
|
||||
bool
|
||||
wasm::CompileAndSerialize(const ShareableBytes& bytecode, Bytes* serialized)
|
||||
{
|
||||
MutableCompileArgs compileArgs = js_new<CompileArgs>(ScriptedCaller());
|
||||
if (!compileArgs) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// The caller has ensured HasCachingSupport().
|
||||
compileArgs->ionEnabled = true;
|
||||
|
||||
UniqueChars error;
|
||||
UniqueCharsVector warnings;
|
||||
UniqueLinkData linkData;
|
||||
SharedModule module = CompileBuffer(*compileArgs, bytecode, &error, &warnings, &linkData);
|
||||
if (!module) {
|
||||
fprintf(stderr, "Compilation error: %s\n", error ? error.get() : "oom");
|
||||
return false;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(module->code().hasTier(Tier::Serialized));
|
||||
|
||||
size_t serializedSize = module->serializedSize(*linkData);
|
||||
if (!serialized->resize(serializedSize)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
module->serialize(*linkData, serialized->begin(), serialized->length());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
wasm::DeserializeModule(JSContext* cx, const Bytes& serialized, MutableHandleObject moduleObj)
|
||||
{
|
||||
MutableModule module = Module::deserialize(serialized.begin(), serialized.length());
|
||||
if (!module) {
|
||||
ReportOutOfMemory(cx);
|
||||
return false;
|
||||
}
|
||||
|
||||
moduleObj.set(module->createObject(cx));
|
||||
return !!moduleObj;
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
// Common functions
|
||||
|
||||
|
||||
@@ -64,6 +64,18 @@ MOZ_MUST_USE bool
|
||||
Eval(JSContext* cx, Handle<TypedArrayObject*> code, HandleObject importObj,
|
||||
MutableHandleWasmInstanceObject instanceObj);
|
||||
|
||||
// For testing cross-process (de)serialization, this pair of functions are
|
||||
// responsible for, in the child process, compiling the given wasm bytecode
|
||||
// to a wasm::Module that is serialized into the given byte array, and, in
|
||||
// the parent process, deserializing the given byte array into a
|
||||
// WebAssembly.Module object.
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
CompileAndSerialize(const ShareableBytes& bytecode, Bytes* serialized);
|
||||
|
||||
MOZ_MUST_USE bool
|
||||
DeserializeModule(JSContext* cx, const Bytes& serialized, MutableHandleObject module);
|
||||
|
||||
// These accessors can be used to probe JS values for being an exported wasm
|
||||
// function.
|
||||
|
||||
|
||||
35
layout/reftests/display-list/1482403-1-ref.html
Normal file
35
layout/reftests/display-list/1482403-1-ref.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Bug 1482403</title>
|
||||
<style type="text/css">
|
||||
#col2 {
|
||||
display: inline-block;
|
||||
height: 35px;
|
||||
background: orange;
|
||||
filter: sepia(0.2);
|
||||
}
|
||||
|
||||
#subnav {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>Column 1</div>
|
||||
<div id="col2">Column 2
|
||||
<div id="subnav" style="">
|
||||
<ul>
|
||||
<li>Item 1</li>
|
||||
<li>Item 2</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
45
layout/reftests/display-list/1482403-1.html
Normal file
45
layout/reftests/display-list/1482403-1.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Bug 1482403</title>
|
||||
<style type="text/css">
|
||||
#col2 {
|
||||
display: inline-block;
|
||||
height: 35px;
|
||||
background: orange;
|
||||
filter: sepia(0.2);
|
||||
}
|
||||
|
||||
#subnav {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 25px;
|
||||
left: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
function doTest() {
|
||||
var col2 = document.getElementById('col2');
|
||||
var subnav = document.getElementById('subnav');
|
||||
subnav.style.display = 'block';
|
||||
document.documentElement.className = "";
|
||||
}
|
||||
|
||||
window.addEventListener("MozReftestInvalidate", doTest);
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div>Column 1</div>
|
||||
<div id="col2">Column 2
|
||||
<div id="subnav" style="">
|
||||
<ul>
|
||||
<li>Item 1</li>
|
||||
<li>Item 2</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -35,3 +35,4 @@ skip-if(!asyncPan) == 1437374-1.html 1437374-1-ref.html
|
||||
== 1452805-1.html 1452805-ref.html
|
||||
== 1461231-1.html about:blank
|
||||
fuzzy(0-2,0-40000) skip-if(!asyncPan) == 1464288-1.html 1464288-ref.html
|
||||
== 1482403-1.html 1482403-1-ref.html
|
||||
|
||||
@@ -305,6 +305,10 @@ function InitAndStartRefTests()
|
||||
|
||||
// Focus the content browser.
|
||||
if (g.focusFilterMode != FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS) {
|
||||
var fm = Cc["@mozilla.org/focus-manager;1"].getService(Ci.nsIFocusManager);
|
||||
if (fm.activeWindow != g.containingWindow) {
|
||||
Focus();
|
||||
}
|
||||
g.browser.addEventListener("focus", ReadTests, true);
|
||||
g.browser.focus();
|
||||
} else {
|
||||
|
||||
@@ -1,27 +1,9 @@
|
||||
[idlharness.any.worker.html]
|
||||
[Test default toJSON operation of Performance]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: operation toJSON()]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: performance must inherit property "toJSON()" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[WorkerGlobalScope interface: attribute performance]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
[idlharness.any.sharedworker.html]
|
||||
[Test default toJSON operation of Performance]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: operation toJSON()]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: performance must inherit property "toJSON()" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[WorkerGlobalScope interface: attribute performance]
|
||||
expected: FAIL
|
||||
|
||||
@@ -32,15 +14,6 @@
|
||||
expected: TIMEOUT
|
||||
|
||||
[idlharness.any.serviceworker.html]
|
||||
[Performance interface: operation toJSON()]
|
||||
expected: FAIL
|
||||
|
||||
[Performance interface: performance must inherit property "toJSON()" with the proper type]
|
||||
expected: FAIL
|
||||
|
||||
[Test default toJSON operation of Performance]
|
||||
expected: FAIL
|
||||
|
||||
[WorkerGlobalScope interface: attribute performance]
|
||||
expected: FAIL
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
prefs: [privacy.reduceTimerPrecision:false]
|
||||
[worker-performance.worker.html]
|
||||
[performance.toJSON is available in workers]
|
||||
expected: FAIL
|
||||
|
||||
@@ -1097,7 +1097,7 @@ var Control = {
|
||||
this._initAutorefresh();
|
||||
this._initDisplayMode();
|
||||
let tbody = document.getElementById("dispatch-tbody");
|
||||
tbody.addEventListener("click", () => {
|
||||
tbody.addEventListener("click", event => {
|
||||
this._updateLastMouseEvent();
|
||||
|
||||
// Handle showing or hiding subitems of a row.
|
||||
@@ -1154,7 +1154,7 @@ var Control = {
|
||||
});
|
||||
|
||||
// Select the tab of double clicked items.
|
||||
tbody.addEventListener("dblclick", () => {
|
||||
tbody.addEventListener("dblclick", event => {
|
||||
let id = parseInt(event.target.parentNode.windowId);
|
||||
if (isNaN(id))
|
||||
return;
|
||||
|
||||
@@ -55,10 +55,6 @@ toolbarbutton[disabled="true"] {
|
||||
}
|
||||
|
||||
@media (-moz-windows-default-theme: 0) {
|
||||
:root[lwtheme-image] toolbarbutton {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
:root[lwtheme-image] toolbarbutton:not([disabled="true"]) {
|
||||
text-shadow: inherit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user