Merge inbound to mozilla-central. a=merge

This commit is contained in:
Ciure Andrei 2018-06-08 00:50:18 +03:00
Родитель ffa6cb75f4 c0b25e1706
Коммит 05605d68c4
242 изменённых файлов: 8178 добавлений и 5193 удалений

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

@ -59,3 +59,6 @@ if CONFIG['ACCESSIBILITY']:
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -101,6 +101,16 @@
`${anode.attributes[i]} attribute is expected and found`);
}
// Check if an AccessibleNode is properly cached.
let node = ifrDoc.createElement("div");
anode = node.accessibleNode;
is(anode, node.accessibleNode, "an AccessibleNode is properly cached");
// Adopting node to another document doesn't change .accessibleNode
anotherDoc = document.implementation.createDocument("", "", null);
let adopted_node = anotherDoc.adoptNode(node);
is(anode, adopted_node.accessibleNode, "adopting node to another document doesn't change node.accessibleNode");
finish();
}
</script>

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

@ -11,7 +11,7 @@
<menu id="file-menu" label="&fileMenu.label;"
accesskey="&fileMenu.accesskey;">
<menupopup id="menu_FilePopup"
onpopupshowing="updateUserContextUIVisibility();">
onpopupshowing="updateFileMenuUserContextUIVisibility('menu_newUserContext');">
<menuitem id="menu_newNavigatorTab"
label="&tabCmd.label;"
command="cmd_newNavigatorTab"

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

@ -1314,7 +1314,6 @@ var gBrowserInit = {
LanguageDetectionListener.init();
BrowserOnClick.init();
FeedHandler.init();
AboutCapabilitiesListener.init();
TrackingProtection.init();
CaptivePortalWatcher.init();
ZoomUI.init(window);
@ -1875,8 +1874,6 @@ var gBrowserInit = {
FeedHandler.uninit();
AboutCapabilitiesListener.uninit();
TrackingProtection.uninit();
CaptivePortalWatcher.uninit();
@ -4550,16 +4547,23 @@ function openNewUserContextTab(event) {
}
/**
* Updates File Menu User Context UI visibility depending on
* Updates User Context Menu Item UI visibility depending on
* privacy.userContext.enabled pref state.
*/
function updateUserContextUIVisibility() {
let menu = document.getElementById("menu_newUserContext");
menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled");
function updateFileMenuUserContextUIVisibility(id) {
let menu = document.getElementById(id);
menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled", false);
// Visibility of File menu item shouldn't change frequently.
if (PrivateBrowsingUtils.isWindowPrivate(window)) {
menu.setAttribute("disabled", "true");
}
}
function updateTabMenuUserContextUIVisibility(id) {
let menu = document.getElementById(id);
// Visibility of Tab menu item can change frequently.
menu.hidden = !Services.prefs.getBoolPref("privacy.userContext.enabled", false) ||
PrivateBrowsingUtils.isWindowPrivate(window);
}
/**
* Updates the User Context UI indicators if the browser is in a non-default context
@ -4592,6 +4596,44 @@ function updateUserContextUIIndicator() {
hbox.hidden = false;
}
/**
* Fill 'Reopen in Container' menu.
*/
function createReopenInContainerMenu(event) {
let currentid = TabContextMenu.contextTab.getAttribute("usercontextid");
return createUserContextMenu(event, {
isContextMenu: true,
excludeUserContextId: currentid,
});
}
/**
* Reopen the tab in another container.
*/
function reopenInContainer(event) {
let userContextId = parseInt(event.target.getAttribute("data-usercontextid"));
let currentTab = TabContextMenu.contextTab;
let isSelected = (gBrowser.selectedTab == currentTab);
let uri = currentTab.linkedBrowser.currentURI.spec;
let newTab = gBrowser.addTab(uri, {
userContextId,
pinned: currentTab.pinned,
index: currentTab._tPos + 1,
});
// Carry over some configuration.
if (isSelected) {
gBrowser.selectedTab = newTab;
}
if (currentTab.muted) {
if (!newTab.muted) {
newTab.toggleMuteAudio(currentTab.muteReason);
}
}
}
/**
* Makes the Character Encoding menu enabled or disabled as appropriate.
* To be called when the View menu or the app menu is opened.
@ -7930,6 +7972,8 @@ var TabContextMenu = {
aPopupMenu.addEventListener("popuphiding", this);
gSync.updateTabContextMenu(aPopupMenu, this.contextTab);
updateTabMenuUserContextUIVisibility("context_reopenInContainer");
},
handleEvent(aEvent) {
switch (aEvent.type) {
@ -8314,39 +8358,6 @@ var PanicButtonNotifier = {
},
};
var AboutCapabilitiesListener = {
_topics: [
"AboutCapabilities:OpenPrivateWindow",
"AboutCapabilities:DontShowIntroPanelAgain",
],
init() {
let mm = window.messageManager;
for (let topic of this._topics) {
mm.addMessageListener(topic, this);
}
},
uninit() {
let mm = window.messageManager;
for (let topic of this._topics) {
mm.removeMessageListener(topic, this);
}
},
receiveMessage(aMsg) {
switch (aMsg.name) {
case "AboutCapabilities:OpenPrivateWindow":
OpenBrowserWindow({private: true});
break;
case "AboutCapabilities:DontShowIntroPanelAgain":
TrackingProtection.dontShowIntroPanelAgain();
break;
}
},
};
const SafeBrowsingNotificationBox = {
_currentURIBaseDomain: null,
show(title, buttons) {

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

@ -110,6 +110,13 @@
<menuitem id="context_duplicateTab" label="&duplicateTab.label;"
accesskey="&duplicateTab.accesskey;"
oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/>
<menu id="context_reopenInContainer"
label="&reopenInContainer.label;"
accesskey="&reopenInContainer.accesskey;"
hidden="true">
<menupopup oncommand="reopenInContainer(event);"
onpopupshowing="return createReopenInContainerMenu(event);" />
</menu>
<menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
accesskey="&moveToNewWindow.accesskey;"
tbattr="tabbrowser-multiple"

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

@ -0,0 +1,46 @@
/* 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/. */
"use strict";
var EXPORTED_SYMBOLS = ["AboutPrivateBrowsingHandler"];
ChromeUtils.import("resource://gre/modules/RemotePageManager.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
var AboutPrivateBrowsingHandler = {
_topics: [
"DontShowIntroPanelAgain",
"OpenPrivateWindow",
],
init() {
this.pageListener = new RemotePages("about:privatebrowsing");
for (let topic of this._topics) {
this.pageListener.addMessageListener(topic, this.receiveMessage.bind(this));
}
},
uninit() {
for (let topic of this._topics) {
this.pageListener.removeMessageListener(topic);
}
this.pageListener.destroy();
},
receiveMessage(aMessage) {
switch (aMessage.name) {
case "OpenPrivateWindow": {
let win = aMessage.target.browser.ownerGlobal;
win.OpenBrowserWindow({private: true});
break;
}
case "DontShowIntroPanelAgain": {
let win = aMessage.target.browser.ownerGlobal;
win.TrackingProtection.dontShowIntroPanelAgain();
break;
}
}
},
};

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

@ -1,2 +0,0 @@
component {4c2b1f46-e637-4a91-8108-8a9fb7aab91d} nsAboutCapabilities.js
contract @mozilla.org/aboutcapabilities;1 {4c2b1f46-e637-4a91-8108-8a9fb7aab91d}

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

@ -17,9 +17,8 @@ SOURCES += [
'AboutRedirector.cpp',
]
EXTRA_COMPONENTS += [
'aboutcapabilities.manifest',
'nsAboutCapabilities.js',
EXTRA_JS_MODULES.aboutpages = [
'AboutPrivateBrowsingHandler.jsm',
]
FINAL_LIBRARY = 'browsercomps'

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

@ -1,73 +0,0 @@
/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */
/* 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/. */
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
ChromeUtils.defineModuleGetter(this, "AsyncPrefs",
"resource://gre/modules/AsyncPrefs.jsm");
function nsAboutCapabilities() {
}
nsAboutCapabilities.prototype = {
init(window) {
this.window = window;
try {
let docShell = window.document.docShell
.QueryInterface(Ci.nsIInterfaceRequestor);
this.mm = docShell.getInterface(Ci.nsIContentFrameMessageManager);
} catch (e) {
Cu.reportError(e);
}
},
getBoolPref(aPref, aDefaultValue) {
return Services.prefs.getBoolPref(aPref, aDefaultValue);
},
setBoolPref(aPref, aValue) {
return new this.window.Promise(function(resolve) {
AsyncPrefs.set(aPref, aValue).then(function() {
resolve();
});
});
},
getCharPref(aPref, aDefaultValue) {
return Services.prefs.getCharPref(aPref, aDefaultValue);
},
setCharPref(aPref, aValue) {
return new this.window.Promise(function(resolve) {
AsyncPrefs.set(aPref, aValue).then(function() {
resolve();
});
});
},
getStringFromBundle(aStrBundle, aStr) {
let bundle = Services.strings.createBundle(aStrBundle);
return bundle.GetStringFromName(aStr);
},
formatURLPref(aFormatURL) {
return Services.urlFormatter.formatURLPref(aFormatURL);
},
sendAsyncMessage(aMessage, aParams) {
this.mm.sendAsyncMessage("AboutCapabilities:" + aMessage, aParams);
},
isWindowPrivate() {
return PrivateBrowsingUtils.isContentWindowPrivate(this.window);
},
contractID: "@mozilla.org/aboutcapabilities;1",
classID: Components.ID("{4c2b1f46-e637-4a91-8108-8a9fb7aab91d}"),
QueryInterface: ChromeUtils.generateQI([Ci.nsIDOMGlobalPropertyInitializer])
};
this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsAboutCapabilities]);

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

@ -35,3 +35,4 @@ tags = openwindow
support-files =
saveLink.sjs
!/toolkit/content/tests/browser/common/mockTransfer.js
[browser_reopenIn.js]

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

@ -0,0 +1,127 @@
"use strict";
const TEST_HOST = "example.com";
const TEST_URL = "http://" + TEST_HOST + "/browser/browser/components/contextualidentity/test/browser/";
async function openTabMenuFor(tab) {
let tabMenu = tab.ownerDocument.getElementById("tabContextMenu");
let tabMenuShown = BrowserTestUtils.waitForEvent(tabMenu, "popupshown");
EventUtils.synthesizeMouseAtCenter(tab, {type: "contextmenu"},
tab.ownerGlobal);
await tabMenuShown;
return tabMenu;
}
async function openReopenMenuForTab(tab) {
openTabMenuFor(tab);
let reopenItem = tab.ownerDocument.getElementById("context_reopenInContainer");
ok(!reopenItem.hidden, "Reopen in Container item should be shown");
let reopenMenu = reopenItem.getElementsByTagName("menupopup")[0];
let reopenMenuShown = BrowserTestUtils.waitForEvent(reopenMenu, "popupshown");
EventUtils.synthesizeMouseAtCenter(reopenItem, {type: "mousemove"},
tab.ownerGlobal);
await reopenMenuShown;
return reopenMenu;
}
function checkMenuItem(reopenMenu, shown, hidden) {
for (let id of shown) {
ok(reopenMenu.querySelector(`menuitem[data-usercontextid="${id}"]`),
`User context id ${id} should exist`);
}
for (let id of hidden) {
ok(!reopenMenu.querySelector(`menuitem[data-usercontextid="${id}"]`),
`User context id ${id} shouldn't exist`);
}
}
function openTabInContainer(gBrowser, reopenMenu, id) {
let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, TEST_URL, true);
let menuitem = reopenMenu.querySelector(`menuitem[data-usercontextid="${id}"]`);
EventUtils.synthesizeMouseAtCenter(menuitem, {}, menuitem.ownerGlobal);
return tabPromise;
}
add_task(async function testReopen() {
await SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
]});
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser,
url: TEST_URL,
});
ok(!tab.hasAttribute("usercontextid"), "Tab with No Container should be opened");
let reopenMenu = await openReopenMenuForTab(tab);
checkMenuItem(reopenMenu, [1, 2, 3, 4], [0]);
let containerTab = await openTabInContainer(gBrowser, reopenMenu, "1");
is(containerTab.getAttribute("usercontextid"), "1",
"Tab with UCI=1 should be opened");
is(containerTab.linkedBrowser.currentURI.spec, TEST_URL,
"Same page should be opened");
reopenMenu = await openReopenMenuForTab(containerTab);
checkMenuItem(reopenMenu, [0, 2, 3, 4], [1]);
let noContainerTab = await openTabInContainer(gBrowser, reopenMenu, "0");
ok(!noContainerTab.hasAttribute("usercontextid"),
"Tab with no UCI should be opened");
is(noContainerTab.linkedBrowser.currentURI.spec, TEST_URL,
"Same page should be opened");
BrowserTestUtils.removeTab(tab);
BrowserTestUtils.removeTab(containerTab);
BrowserTestUtils.removeTab(noContainerTab);
});
add_task(async function testDisabled() {
await SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", false],
]});
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser,
url: TEST_URL,
});
ok(!tab.hasAttribute("usercontextid"), "Tab with No Container should be opened");
openTabMenuFor(tab);
let reopenItem = document.getElementById("context_reopenInContainer");
ok(reopenItem.hidden, "Reopen in Container item should be hidden");
// Close the tab menu.
EventUtils.synthesizeKey("KEY_Escape");
BrowserTestUtils.removeTab(tab);
});
add_task(async function testPrivateMode() {
await SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
]});
let privateWindow = await BrowserTestUtils.openNewBrowserWindow({private: true});
let tab = await BrowserTestUtils.openNewForegroundTab({
gBrowser: privateWindow.gBrowser,
url: TEST_URL,
});
ok(!tab.hasAttribute("usercontextid"), "Tab with No Container should be opened");
openTabMenuFor(tab);
let reopenItem = privateWindow.document.getElementById("context_reopenInContainer");
ok(reopenItem.hidden, "Reopen in Container item should be hidden");
// Close the tab menu.
EventUtils.synthesizeKey("KEY_Escape");
await BrowserTestUtils.closeWindow(privateWindow);
});

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

@ -506,8 +506,8 @@ add_task(async function test_devtools_page_panels_switch_toolbox_host() {
const originalToolboxHostType = toolbox.hostType;
info("Switch the toolbox from docked on bottom to docked on side");
toolbox.switchHost("side");
info("Switch the toolbox from docked on bottom to docked on right");
toolbox.switchHost("right");
info("Wait for the panel to emit hide, show and load messages once docked on side");
await extension.awaitMessage("devtools_panel_hidden");

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

@ -89,6 +89,7 @@ XPCOMUtils.defineLazyGetter(this, "WeaveService", () =>
// lazy module getters
XPCOMUtils.defineLazyModuleGetters(this, {
AboutPrivateBrowsingHandler: "resource:///modules/aboutpages/AboutPrivateBrowsingHandler.jsm",
AddonManager: "resource://gre/modules/AddonManager.jsm",
AppMenuNotifications: "resource://gre/modules/AppMenuNotifications.jsm",
AsyncPrefs: "resource://gre/modules/AsyncPrefs.jsm",
@ -1054,6 +1055,8 @@ BrowserGlue.prototype = {
NewTabUtils.init();
AboutPrivateBrowsingHandler.init();
PageActions.init();
this._firstWindowTelemetry(aWindow);
@ -1106,6 +1109,7 @@ BrowserGlue.prototype = {
PageThumbs.uninit();
NewTabUtils.uninit();
AboutPrivateBrowsingHandler.uninit();
AutoCompletePopup.uninit();
DateTimePickerHelper.uninit();

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

@ -2,22 +2,21 @@
* 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/. */
/* eslint-env mozilla/frame-script */
const FAVICON_QUESTION = "chrome://global/skin/icons/question-32.png";
const STRING_BUNDLE = "chrome://browser/locale/aboutPrivateBrowsing.properties";
const TP_ENABLED_PREF = "privacy.trackingprotection.enabled";
const TP_PB_ENABLED_PREF = "privacy.trackingprotection.pbmode.enabled";
function updateTPInfo() {
let aboutCapabilities = document.aboutCapabilities;
let tpButton = document.getElementById("tpButton");
let tpToggle = document.getElementById("tpToggle");
let title = document.getElementById("title");
let titleTracking = document.getElementById("titleTracking");
let tpSubHeader = document.getElementById("tpSubHeader");
let globalTrackingEnabled = aboutCapabilities.getBoolPref(TP_ENABLED_PREF, null);
let trackingEnabled = globalTrackingEnabled ||
aboutCapabilities.getBoolPref(TP_PB_ENABLED_PREF, null);
let globalTrackingEnabled = RPMGetBoolPref(TP_ENABLED_PREF);
let trackingEnabled = globalTrackingEnabled || RPMGetBoolPref(TP_PB_ENABLED_PREF);
// if tracking protection is enabled globally we don't even give the user
// a choice here by hiding the toggle completely.
@ -29,31 +28,31 @@ function updateTPInfo() {
}
document.addEventListener("DOMContentLoaded", function() {
let aboutCapabilities = document.aboutCapabilities;
if (!aboutCapabilities.isWindowPrivate()) {
if (!RPMIsWindowPrivate()) {
document.documentElement.classList.remove("private");
document.documentElement.classList.add("normal");
document.getElementById("favicon").setAttribute("href", FAVICON_QUESTION);
document.getElementById("startPrivateBrowsing").addEventListener("click", function() {
aboutCapabilities.sendAsyncMessage("OpenPrivateWindow", null);
sendAsyncMessage("OpenPrivateWindow");
});
return;
}
document.getElementById("startTour").addEventListener("click", function() {
aboutCapabilities.sendAsyncMessage("DontShowIntroPanelAgain", null);
sendAsyncMessage("DontShowIntroPanelAgain");
});
document.getElementById("startTour").setAttribute("href",
aboutCapabilities.formatURLPref("privacy.trackingprotection.introURL"));
RPMGetFormatURLPref("privacy.trackingprotection.introURL"));
document.getElementById("learnMore").setAttribute("href",
aboutCapabilities.formatURLPref("app.support.baseURL") + "private-browsing");
RPMGetFormatURLPref("app.support.baseURL") + "private-browsing");
let tpToggle = document.getElementById("tpToggle");
document.getElementById("tpButton").addEventListener("click", () => {
tpToggle.click();
});
tpToggle.addEventListener("change", function() {
aboutCapabilities.setBoolPref(TP_PB_ENABLED_PREF, tpToggle.checked).then(function() {
RPMSetBoolPref(TP_PB_ENABLED_PREF, tpToggle.checked).then(function() {
updateTPInfo();
});
});

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

@ -189,8 +189,6 @@
@RESPATH@/browser/components/aboutdevtools.manifest
@RESPATH@/browser/components/aboutdevtoolstoolbox-registration.js
@RESPATH@/browser/components/aboutdevtoolstoolbox.manifest
@RESPATH@/browser/components/nsAboutCapabilities.js
@RESPATH@/browser/components/aboutcapabilities.manifest
@RESPATH@/browser/components/aboutNewTabService.js
@RESPATH@/browser/components/NewTabComponents.manifest
@RESPATH@/browser/components/EnterprisePolicies.js

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

@ -56,6 +56,8 @@ can reach it easily. -->
<!ENTITY sendToDeviceOfflineFeedback.label "Queued (offline)">
<!ENTITY moveToNewWindow.label "Move to New Window">
<!ENTITY moveToNewWindow.accesskey "W">
<!ENTITY reopenInContainer.label "Reopen in Container">
<!ENTITY reopenInContainer.accesskey "e">
<!ENTITY bookmarkAllTabs.label "Bookmark All Tabs…">
<!ENTITY bookmarkAllTabs.accesskey "T">
<!ENTITY undoCloseTab.label "Undo Close Tab">

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

@ -51,7 +51,7 @@ var DevTools = {
sideToolbox: {
selectors: [selectToolbox],
async applyConfig() {
await gDevTools.showToolbox(getTargetForSelectedTab(), "inspector", "side");
await gDevTools.showToolbox(getTargetForSelectedTab(), "inspector", "right");
await new Promise(resolve => setTimeout(resolve, 500));
},
},

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -123,9 +123,9 @@ extern "C" {
** [sqlite3_libversion_number()], [sqlite3_sourceid()],
** [sqlite_version()] and [sqlite_source_id()].
*/
#define SQLITE_VERSION "3.23.1"
#define SQLITE_VERSION_NUMBER 3023001
#define SQLITE_SOURCE_ID "2018-04-10 17:39:29 4bb2294022060e61de7da5c227a69ccd846ba330e31626ebcd59a94efd148b3b"
#define SQLITE_VERSION "3.24.0"
#define SQLITE_VERSION_NUMBER 3024000
#define SQLITE_SOURCE_ID "2018-06-04 19:24:41 c7ee0833225bfd8c5ec2f9bf62b97c4e04d03bd9566366d5221ac8fb199a87ca"
/*
** CAPI3REF: Run-Time Library Version Numbers
@ -504,6 +504,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_IOERR_COMMIT_ATOMIC (SQLITE_IOERR | (30<<8))
#define SQLITE_IOERR_ROLLBACK_ATOMIC (SQLITE_IOERR | (31<<8))
#define SQLITE_LOCKED_SHAREDCACHE (SQLITE_LOCKED | (1<<8))
#define SQLITE_LOCKED_VTAB (SQLITE_LOCKED | (2<<8))
#define SQLITE_BUSY_RECOVERY (SQLITE_BUSY | (1<<8))
#define SQLITE_BUSY_SNAPSHOT (SQLITE_BUSY | (2<<8))
#define SQLITE_CANTOPEN_NOTEMPDIR (SQLITE_CANTOPEN | (1<<8))
@ -511,6 +512,7 @@ SQLITE_API int sqlite3_exec(
#define SQLITE_CANTOPEN_FULLPATH (SQLITE_CANTOPEN | (3<<8))
#define SQLITE_CANTOPEN_CONVPATH (SQLITE_CANTOPEN | (4<<8))
#define SQLITE_CORRUPT_VTAB (SQLITE_CORRUPT | (1<<8))
#define SQLITE_CORRUPT_SEQUENCE (SQLITE_CORRUPT | (2<<8))
#define SQLITE_READONLY_RECOVERY (SQLITE_READONLY | (1<<8))
#define SQLITE_READONLY_CANTLOCK (SQLITE_READONLY | (2<<8))
#define SQLITE_READONLY_ROLLBACK (SQLITE_READONLY | (3<<8))
@ -1930,6 +1932,22 @@ struct sqlite3_mem_methods {
** I/O required to support statement rollback.
** The default value for this setting is controlled by the
** [SQLITE_STMTJRNL_SPILL] compile-time option.
**
** [[SQLITE_CONFIG_SORTERREF_SIZE]]
** <dt>SQLITE_CONFIG_SORTERREF_SIZE
** <dd>The SQLITE_CONFIG_SORTERREF_SIZE option accepts a single parameter
** of type (int) - the new value of the sorter-reference size threshold.
** Usually, when SQLite uses an external sort to order records according
** to an ORDER BY clause, all fields required by the caller are present in the
** sorted records. However, if SQLite determines based on the declared type
** of a table column that its values are likely to be very large - larger
** than the configured sorter-reference size threshold - then a reference
** is stored in each sorted record and the required column values loaded
** from the database as records are returned in sorted order. The default
** value for this option is to never use this optimization. Specifying a
** negative value for this option restores the default behaviour.
** This option is only available if SQLite is compiled with the
** [SQLITE_ENABLE_SORTER_REFERENCES] compile-time option.
** </dl>
*/
#define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */
@ -1959,6 +1977,7 @@ struct sqlite3_mem_methods {
#define SQLITE_CONFIG_PMASZ 25 /* unsigned int szPma */
#define SQLITE_CONFIG_STMTJRNL_SPILL 26 /* int nByte */
#define SQLITE_CONFIG_SMALL_MALLOC 27 /* boolean */
#define SQLITE_CONFIG_SORTERREF_SIZE 28 /* int nByte */
/*
** CAPI3REF: Database Connection Configuration Options
@ -2095,6 +2114,21 @@ struct sqlite3_mem_methods {
** 0 or 1 to indicate whether output-for-triggers has been disabled - 0 if
** it is not disabled, 1 if it is.
** </dd>
**
** <dt>SQLITE_DBCONFIG_RESET_DATABASE</dt>
** <dd> Set the SQLITE_DBCONFIG_RESET_DATABASE flag and then run
** [VACUUM] in order to reset a database back to an empty database
** with no schema and no content. The following process works even for
** a badly corrupted database file:
** <ol>
** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 1, 0);
** <li> [sqlite3_exec](db, "[VACUUM]", 0, 0, 0);
** <li> sqlite3_db_config(db, SQLITE_DBCONFIG_RESET_DATABASE, 0, 0);
** </ol>
** Because resetting a database is destructive and irreversible, the
** process requires the use of this obscure API and multiple steps to help
** ensure that it does not happen by accident.
** </dd>
** </dl>
*/
#define SQLITE_DBCONFIG_MAINDBNAME 1000 /* const char* */
@ -2106,7 +2140,8 @@ struct sqlite3_mem_methods {
#define SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE 1006 /* int int* */
#define SQLITE_DBCONFIG_ENABLE_QPSG 1007 /* int int* */
#define SQLITE_DBCONFIG_TRIGGER_EQP 1008 /* int int* */
#define SQLITE_DBCONFIG_MAX 1008 /* Largest DBCONFIG */
#define SQLITE_DBCONFIG_RESET_DATABASE 1009 /* int int* */
#define SQLITE_DBCONFIG_MAX 1009 /* Largest DBCONFIG */
/*
** CAPI3REF: Enable Or Disable Extended Result Codes
@ -5492,6 +5527,41 @@ SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory;
*/
SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory;
/*
** CAPI3REF: Win32 Specific Interface
**
** These interfaces are available only on Windows. The
** [sqlite3_win32_set_directory] interface is used to set the value associated
** with the [sqlite3_temp_directory] or [sqlite3_data_directory] variable, to
** zValue, depending on the value of the type parameter. The zValue parameter
** should be NULL to cause the previous value to be freed via [sqlite3_free];
** a non-NULL value will be copied into memory obtained from [sqlite3_malloc]
** prior to being used. The [sqlite3_win32_set_directory] interface returns
** [SQLITE_OK] to indicate success, [SQLITE_ERROR] if the type is unsupported,
** or [SQLITE_NOMEM] if memory could not be allocated. The value of the
** [sqlite3_data_directory] variable is intended to act as a replacement for
** the current directory on the sub-platforms of Win32 where that concept is
** not present, e.g. WinRT and UWP. The [sqlite3_win32_set_directory8] and
** [sqlite3_win32_set_directory16] interfaces behave exactly the same as the
** sqlite3_win32_set_directory interface except the string parameter must be
** UTF-8 or UTF-16, respectively.
*/
SQLITE_API int sqlite3_win32_set_directory(
unsigned long type, /* Identifier for directory being set or reset */
void *zValue /* New value for directory being set or reset */
);
SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue);
SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue);
/*
** CAPI3REF: Win32 Directory Types
**
** These macros are only available on Windows. They define the allowed values
** for the type argument to the [sqlite3_win32_set_directory] interface.
*/
#define SQLITE_WIN32_DATA_DIRECTORY_TYPE 1
#define SQLITE_WIN32_TEMP_DIRECTORY_TYPE 2
/*
** CAPI3REF: Test For Auto-Commit Mode
** KEYWORDS: {autocommit mode}
@ -6224,6 +6294,10 @@ struct sqlite3_index_info {
/*
** CAPI3REF: Virtual Table Scan Flags
**
** Virtual table implementations are allowed to set the
** [sqlite3_index_info].idxFlags field to some combination of
** these bits.
*/
#define SQLITE_INDEX_SCAN_UNIQUE 1 /* Scan visits at most 1 row */
@ -6999,7 +7073,7 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_ALWAYS 13
#define SQLITE_TESTCTRL_RESERVE 14
#define SQLITE_TESTCTRL_OPTIMIZATIONS 15
#define SQLITE_TESTCTRL_ISKEYWORD 16
#define SQLITE_TESTCTRL_ISKEYWORD 16 /* NOT USED */
#define SQLITE_TESTCTRL_SCRATCHMALLOC 17 /* NOT USED */
#define SQLITE_TESTCTRL_LOCALTIME_FAULT 18
#define SQLITE_TESTCTRL_EXPLAIN_STMT 19 /* NOT USED */
@ -7013,6 +7087,189 @@ SQLITE_API int sqlite3_test_control(int op, ...);
#define SQLITE_TESTCTRL_PARSER_COVERAGE 26
#define SQLITE_TESTCTRL_LAST 26 /* Largest TESTCTRL */
/*
** CAPI3REF: SQL Keyword Checking
**
** These routines provide access to the set of SQL language keywords
** recognized by SQLite. Applications can uses these routines to determine
** whether or not a specific identifier needs to be escaped (for example,
** by enclosing in double-quotes) so as not to confuse the parser.
**
** The sqlite3_keyword_count() interface returns the number of distinct
** keywords understood by SQLite.
**
** The sqlite3_keyword_name(N,Z,L) interface finds the N-th keyword and
** makes *Z point to that keyword expressed as UTF8 and writes the number
** of bytes in the keyword into *L. The string that *Z points to is not
** zero-terminated. The sqlite3_keyword_name(N,Z,L) routine returns
** SQLITE_OK if N is within bounds and SQLITE_ERROR if not. If either Z
** or L are NULL or invalid pointers then calls to
** sqlite3_keyword_name(N,Z,L) result in undefined behavior.
**
** The sqlite3_keyword_check(Z,L) interface checks to see whether or not
** the L-byte UTF8 identifier that Z points to is a keyword, returning non-zero
** if it is and zero if not.
**
** The parser used by SQLite is forgiving. It is often possible to use
** a keyword as an identifier as long as such use does not result in a
** parsing ambiguity. For example, the statement
** "CREATE TABLE BEGIN(REPLACE,PRAGMA,END);" is accepted by SQLite, and
** creates a new table named "BEGIN" with three columns named
** "REPLACE", "PRAGMA", and "END". Nevertheless, best practice is to avoid
** using keywords as identifiers. Common techniques used to avoid keyword
** name collisions include:
** <ul>
** <li> Put all identifier names inside double-quotes. This is the official
** SQL way to escape identifier names.
** <li> Put identifier names inside &#91;...&#93;. This is not standard SQL,
** but it is what SQL Server does and so lots of programmers use this
** technique.
** <li> Begin every identifier with the letter "Z" as no SQL keywords start
** with "Z".
** <li> Include a digit somewhere in every identifier name.
** </ul>
**
** Note that the number of keywords understood by SQLite can depend on
** compile-time options. For example, "VACUUM" is not a keyword if
** SQLite is compiled with the [-DSQLITE_OMIT_VACUUM] option. Also,
** new keywords may be added to future releases of SQLite.
*/
SQLITE_API int sqlite3_keyword_count(void);
SQLITE_API int sqlite3_keyword_name(int,const char**,int*);
SQLITE_API int sqlite3_keyword_check(const char*,int);
/*
** CAPI3REF: Dynamic String Object
** KEYWORDS: {dynamic string}
**
** An instance of the sqlite3_str object contains a dynamically-sized
** string under construction.
**
** The lifecycle of an sqlite3_str object is as follows:
** <ol>
** <li> ^The sqlite3_str object is created using [sqlite3_str_new()].
** <li> ^Text is appended to the sqlite3_str object using various
** methods, such as [sqlite3_str_appendf()].
** <li> ^The sqlite3_str object is destroyed and the string it created
** is returned using the [sqlite3_str_finish()] interface.
** </ol>
*/
typedef struct sqlite3_str sqlite3_str;
/*
** CAPI3REF: Create A New Dynamic String Object
** CONSTRUCTOR: sqlite3_str
**
** ^The [sqlite3_str_new(D)] interface allocates and initializes
** a new [sqlite3_str] object. To avoid memory leaks, the object returned by
** [sqlite3_str_new()] must be freed by a subsequent call to
** [sqlite3_str_finish(X)].
**
** ^The [sqlite3_str_new(D)] interface always returns a pointer to a
** valid [sqlite3_str] object, though in the event of an out-of-memory
** error the returned object might be a special singleton that will
** silently reject new text, always return SQLITE_NOMEM from
** [sqlite3_str_errcode()], always return 0 for
** [sqlite3_str_length()], and always return NULL from
** [sqlite3_str_finish(X)]. It is always safe to use the value
** returned by [sqlite3_str_new(D)] as the sqlite3_str parameter
** to any of the other [sqlite3_str] methods.
**
** The D parameter to [sqlite3_str_new(D)] may be NULL. If the
** D parameter in [sqlite3_str_new(D)] is not NULL, then the maximum
** length of the string contained in the [sqlite3_str] object will be
** the value set for [sqlite3_limit](D,[SQLITE_LIMIT_LENGTH]) instead
** of [SQLITE_MAX_LENGTH].
*/
SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3*);
/*
** CAPI3REF: Finalize A Dynamic String
** DESTRUCTOR: sqlite3_str
**
** ^The [sqlite3_str_finish(X)] interface destroys the sqlite3_str object X
** and returns a pointer to a memory buffer obtained from [sqlite3_malloc64()]
** that contains the constructed string. The calling application should
** pass the returned value to [sqlite3_free()] to avoid a memory leak.
** ^The [sqlite3_str_finish(X)] interface may return a NULL pointer if any
** errors were encountered during construction of the string. ^The
** [sqlite3_str_finish(X)] interface will also return a NULL pointer if the
** string in [sqlite3_str] object X is zero bytes long.
*/
SQLITE_API char *sqlite3_str_finish(sqlite3_str*);
/*
** CAPI3REF: Add Content To A Dynamic String
** METHOD: sqlite3_str
**
** These interfaces add content to an sqlite3_str object previously obtained
** from [sqlite3_str_new()].
**
** ^The [sqlite3_str_appendf(X,F,...)] and
** [sqlite3_str_vappendf(X,F,V)] interfaces uses the [built-in printf]
** functionality of SQLite to append formatted text onto the end of
** [sqlite3_str] object X.
**
** ^The [sqlite3_str_append(X,S,N)] method appends exactly N bytes from string S
** onto the end of the [sqlite3_str] object X. N must be non-negative.
** S must contain at least N non-zero bytes of content. To append a
** zero-terminated string in its entirety, use the [sqlite3_str_appendall()]
** method instead.
**
** ^The [sqlite3_str_appendall(X,S)] method appends the complete content of
** zero-terminated string S onto the end of [sqlite3_str] object X.
**
** ^The [sqlite3_str_appendchar(X,N,C)] method appends N copies of the
** single-byte character C onto the end of [sqlite3_str] object X.
** ^This method can be used, for example, to add whitespace indentation.
**
** ^The [sqlite3_str_reset(X)] method resets the string under construction
** inside [sqlite3_str] object X back to zero bytes in length.
**
** These methods do not return a result code. ^If an error occurs, that fact
** is recorded in the [sqlite3_str] object and can be recovered by a
** subsequent call to [sqlite3_str_errcode(X)].
*/
SQLITE_API void sqlite3_str_appendf(sqlite3_str*, const char *zFormat, ...);
SQLITE_API void sqlite3_str_vappendf(sqlite3_str*, const char *zFormat, va_list);
SQLITE_API void sqlite3_str_append(sqlite3_str*, const char *zIn, int N);
SQLITE_API void sqlite3_str_appendall(sqlite3_str*, const char *zIn);
SQLITE_API void sqlite3_str_appendchar(sqlite3_str*, int N, char C);
SQLITE_API void sqlite3_str_reset(sqlite3_str*);
/*
** CAPI3REF: Status Of A Dynamic String
** METHOD: sqlite3_str
**
** These interfaces return the current status of an [sqlite3_str] object.
**
** ^If any prior errors have occurred while constructing the dynamic string
** in sqlite3_str X, then the [sqlite3_str_errcode(X)] method will return
** an appropriate error code. ^The [sqlite3_str_errcode(X)] method returns
** [SQLITE_NOMEM] following any out-of-memory error, or
** [SQLITE_TOOBIG] if the size of the dynamic string exceeds
** [SQLITE_MAX_LENGTH], or [SQLITE_OK] if there have been no errors.
**
** ^The [sqlite3_str_length(X)] method returns the current length, in bytes,
** of the dynamic string under construction in [sqlite3_str] object X.
** ^The length returned by [sqlite3_str_length(X)] does not include the
** zero-termination byte.
**
** ^The [sqlite3_str_value(X)] method returns a pointer to the current
** content of the dynamic string under construction in X. The value
** returned by [sqlite3_str_value(X)] is managed by the sqlite3_str object X
** and might be freed or altered by any subsequent method on the same
** [sqlite3_str] object. Applications must not used the pointer returned
** [sqlite3_str_value(X)] after any subsequent method call on the same
** object. ^Applications may change the content of the string returned
** by [sqlite3_str_value(X)] as long as they do not write into any bytes
** outside the range of 0 to [sqlite3_str_length(X)] and do not read or
** write any byte after any subsequent sqlite3_str method call.
*/
SQLITE_API int sqlite3_str_errcode(sqlite3_str*);
SQLITE_API int sqlite3_str_length(sqlite3_str*);
SQLITE_API char *sqlite3_str_value(sqlite3_str*);
/*
** CAPI3REF: SQLite Runtime Status
**
@ -8282,11 +8539,11 @@ SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *);
** method of a [virtual table], then it returns true if and only if the
** column is being fetched as part of an UPDATE operation during which the
** column value will not change. Applications might use this to substitute
** a lighter-weight value to return that the corresponding [xUpdate] method
** understands as a "no-change" value.
** a return value that is less expensive to compute and that the corresponding
** [xUpdate] method understands as a "no-change" value.
**
** If the [xColumn] method calls sqlite3_vtab_nochange() and finds that
** the column is not changed by the UPDATE statement, they the xColumn
** the column is not changed by the UPDATE statement, then the xColumn
** method can optionally return without setting a result, without calling
** any of the [sqlite3_result_int|sqlite3_result_xxxxx() interfaces].
** In that case, [sqlite3_value_nochange(X)] will return true for the
@ -8781,7 +9038,7 @@ SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const c
** been a prior call to [sqlite3_deserialize(D,S,...)] with the same
** values of D and S.
** The size of the database is written into *P even if the
** SQLITE_SERIALIZE_NOCOPY bit is set but no contigious copy
** SQLITE_SERIALIZE_NOCOPY bit is set but no contiguous copy
** of the database exists.
**
** A call to sqlite3_serialize(D,S,P,F) might return NULL even if the

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

@ -179,7 +179,7 @@ var DebuggerView = {
_destroyPanes: function () {
dumpn("Destroying the DebuggerView panes");
if (gHostType != "side") {
if (gHostType != "right" && gHostType != "left") {
Prefs.workersAndSourcesWidth = this._workersAndSourcesPane.getAttribute("width");
Prefs.instrumentsWidth = this._instrumentsPane.getAttribute("width");
}
@ -703,7 +703,7 @@ var DebuggerView = {
* Handles a host change event issued by the parent toolbox.
*
* @param string aType
* The host type, either "bottom", "side" or "window".
* The host type, either "bottom", "left", "right" or "window".
*/
handleHostChanged: function (hostType) {
this._hostType = hostType;
@ -723,7 +723,9 @@ var DebuggerView = {
* Set the layout to "vertical" or "horizontal" depending on the host type.
*/
updateLayoutMode: function () {
if (this._isSmallWindowHost() || this._hostType == "side") {
if (this._isSmallWindowHost() ||
this._hostType == "left" ||
this._hostType == "right") {
this._setLayoutMode("vertical");
} else {
this._setLayoutMode("horizontal");

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

@ -3066,7 +3066,6 @@ html .breakpoints-list .breakpoint.paused {
color: var(--theme-comment);
min-width: 16px;
text-align: right;
margin-top: -1px;
}
html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
@ -3089,7 +3088,7 @@ html[dir="rtl"] .breakpoints-list .breakpoint .breakpoint-line {
flex-grow: 1;
text-overflow: ellipsis;
overflow: hidden;
padding-top: 3px;
padding-top: 2px;
font-size: 11px;
}

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

@ -160,21 +160,12 @@ class SourcesTree extends _react.Component {
const {
projectRoot
} = this.props;
const {
sourceTree
} = this.state;
if (!projectRoot) {
return null;
}
const sourceContents = sourceTree.contents[0];
let rootLabel = projectRoot.split("/").pop();
if (sourceContents && sourceContents.name !== rootLabel) {
rootLabel = sourceContents.contents[0].name;
}
const rootLabel = projectRoot.split("/").pop();
return _react2.default.createElement("div", {
key: "root",
className: "sources-clear-root-container"
@ -452,7 +443,7 @@ const mapStateToProps = state => {
debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state),
expanded: (0, _selectors.getExpandedState)(state),
projectRoot: (0, _selectors.getProjectDirectoryRoot)(state),
sources: (0, _selectors.getSources)(state)
sources: (0, _selectors.getRelativeSources)(state)
};
};

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

@ -468,7 +468,7 @@ function mapStateToProps(state) {
const selectedSource = (0, _selectors.getSelectedSource)(state);
return {
enabled: (0, _selectors.getQuickOpenEnabled)(state),
sources: (0, _quickOpen.formatSources)((0, _selectors.getRelativeSources)(state).toArray(), (0, _selectors.getTabs)(state).toArray()),
sources: (0, _quickOpen.formatSources)((0, _selectors.getRelativeSources)(state), (0, _selectors.getTabs)(state).toArray()),
selectedSource,
symbols: (0, _quickOpen.formatSymbols)((0, _selectors.getSymbols)(state, selectedSource)),
symbolsLoading: (0, _selectors.isSymbolsLoading)(state, selectedSource),

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

@ -137,7 +137,7 @@ class Breakpoint extends _react.PureComponent {
}
highlightText() {
const text = this.getBreakpointText();
const text = this.getBreakpointText() || "";
const editor = (0, _editor.getEditor)();
if (!editor.CodeMirror) {

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

@ -34,5 +34,5 @@ function formatSource(source, root) {
const getRelativeSources = exports.getRelativeSources = (0, _reselect.createSelector)(_selectors.getSources, _selectors.getProjectDirectoryRoot, (sources, root) => {
return sources.valueSeq().filter(source => source.url && source.url.includes(root)).map(source => formatSource(source, root));
return sources.filter(source => source.url && source.url.includes(root)).map(source => formatSource(source, root));
});

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

@ -28,6 +28,8 @@ require("codemirror/mode/elm/elm/index");
require("codemirror/mode/clojure/clojure/index");
require("codemirror/mode/haxe/haxe/index");
require("codemirror/addon/search/searchcursor/index");
require("codemirror/addon/fold/foldcode/index");

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

@ -123,7 +123,7 @@ function formatShortcutResults() {
}
function formatSources(sources, tabs) {
return sources.filter(source => !(0, _source.isPretty)(source)).filter(({
return sources.valueSeq().toArray().filter(source => !(0, _source.isPretty)(source)).filter(({
relativeUrl
}) => !!relativeUrl).map(source => formatSourcesForList(source, tabs));
}

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

@ -355,6 +355,9 @@ function getMode(source, symbols) {
}, {
ext: ".rs",
mode: "text/x-rustsrc"
}, {
ext: ".hx",
mode: "text/x-haxe"
}]; // check for C and other non JS languages
if (url) {

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

@ -14,19 +14,6 @@ var _getURL = require("./getURL");
/* 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/>. */
function isUnderRoot(url, projectRoot) {
if (!projectRoot) {
return true;
}
return `${url.group}${url.path}`.startsWith(projectRoot);
}
function removeProjectRoot(parts, projectRoot) {
const rootParts = projectRoot.replace("://", "").split("/");
return parts.splice(0, rootParts.length - 2);
}
function createNodeInTree(part, path, tree, index) {
const node = (0, _utils.createNode)(part, path, []); // we are modifying the tree
@ -72,15 +59,10 @@ function findOrCreateNode(parts, subTree, path, part, index, url, debuggeeHost)
*/
function traverseTree(url, tree, debuggeeHost, projectRoot) {
function traverseTree(url, tree, debuggeeHost) {
url.path = decodeURIComponent(url.path);
const parts = url.path.split("/").filter(p => p !== "");
parts.unshift(url.group);
if (projectRoot) {
removeProjectRoot(parts, projectRoot);
}
let path = "";
return parts.reduce((subTree, part, index) => {
path = path ? `${path}/${part}` : part;
@ -129,13 +111,13 @@ function addSourceToNode(node, url, source) {
function addToTree(tree, source, debuggeeUrl, projectRoot) {
const url = (0, _getURL.getURL)(source.get ? source.get("url") : source.url, debuggeeUrl);
const url = (0, _getURL.getURL)(source.url, debuggeeUrl);
const debuggeeHost = (0, _treeOrder.getDomain)(debuggeeUrl);
if ((0, _utils.isInvalidUrl)(url, source) || !isUnderRoot(url, projectRoot)) {
if ((0, _utils.isInvalidUrl)(url, source)) {
return;
}
const finalNode = traverseTree(url, tree, debuggeeHost, projectRoot);
const finalNode = traverseTree(url, tree, debuggeeHost);
finalNode.contents = addSourceToNode(finalNode, url, source);
}

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

@ -62,7 +62,7 @@ function isNotJavaScript(source) {
}
function isInvalidUrl(url, source) {
return IGNORED_URLS.indexOf(url) != -1 || !(source.get ? source.get("url") : source.url) || !url.group || (0, _source.isPretty)(source) || isNotJavaScript(source);
return IGNORED_URLS.indexOf(url) != -1 || !source.url || !url.group || (0, _source.isPretty)(source) || isNotJavaScript(source);
}
function partIsFile(index, parts, url) {

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

@ -16,7 +16,7 @@ add_task(async function() {
const layouts = [
["vertical", "window:small"],
["horizontal", "bottom"],
["vertical", "side"],
["vertical", "right"],
["horizontal", "window:big"]
];

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

@ -349,6 +349,7 @@ skip-if = true # non-named eval sources turned off for now, bug 1124106
uses-unsafe-cpows = true
[browser_dbg_sources-iframe-reload.js]
uses-unsafe-cpows = true
skip-if = (os == "linux" && debug && bits == 64) #Bug 1455225, disable on Linux x64 debug for frequent failures
[browser_dbg_sources-keybindings.js]
uses-unsafe-cpows = true
subsuite = clipboard

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

@ -17,12 +17,12 @@ function test() {
requestLongerTimeout(3);
(async function() {
await testHosts(["bottom", "side", "window:big"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["side", "bottom", "side"], ["vertical", "horizontal", "vertical"]);
await testHosts(["bottom", "side", "bottom"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["side", "window:big", "side"], ["vertical", "horizontal", "vertical"]);
await testHosts(["window:big", "side", "window:big"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["window:small", "bottom", "side"], ["vertical", "horizontal", "vertical"]);
await testHosts(["bottom", "right", "window:big"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["right", "bottom", "right"], ["vertical", "horizontal", "vertical"]);
await testHosts(["bottom", "right", "bottom"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["right", "window:big", "right"], ["vertical", "horizontal", "vertical"]);
await testHosts(["window:big", "right", "window:big"], ["horizontal", "vertical", "horizontal"]);
await testHosts(["window:small", "bottom", "right"], ["vertical", "horizontal", "vertical"]);
await testHosts(["window:small", "window:big", "window:small"], ["vertical", "horizontal", "vertical"]);
finish();
})();

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

@ -441,7 +441,7 @@ DevTools.prototype = {
* @param {string} toolId
* The id of the tool to show
* @param {Toolbox.HostType} hostType
* The type of host (bottom, window, side)
* The type of host (bottom, window, left, right)
* @param {object} hostOptions
* Options for host specifically
* @param {Number} startTime

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

@ -24,8 +24,8 @@ add_task(async function() {
const target = TargetFactory.forTab(tab);
const toolbox = await gDevTools.showToolbox(target, "webconsole");
const {SIDE, BOTTOM} = Toolbox.HostType;
for (const type of [SIDE, BOTTOM, SIDE]) {
const {RIGHT, BOTTOM} = Toolbox.HostType;
for (const type of [RIGHT, BOTTOM, RIGHT]) {
info("Switch to host type " + type);
await toolbox.switchHost(type);

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

@ -23,20 +23,20 @@ add_task(async function() {
const shortcut = L10N.getStr("toolbox.toggleHost.key");
const {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
checkHostType(toolbox, BOTTOM, SIDE);
const {RIGHT, BOTTOM, WINDOW} = Toolbox.HostType;
checkHostType(toolbox, BOTTOM, RIGHT);
info("Switching from bottom to side");
info("Switching from bottom to right");
let onHostChanged = toolbox.once("host-changed");
synthesizeKeyShortcut(shortcut, toolbox.win);
await onHostChanged;
checkHostType(toolbox, SIDE, BOTTOM);
checkHostType(toolbox, RIGHT, BOTTOM);
info("Switching from side to bottom");
info("Switching from right to bottom");
onHostChanged = toolbox.once("host-changed");
synthesizeKeyShortcut(shortcut, toolbox.win);
await onHostChanged;
checkHostType(toolbox, BOTTOM, SIDE);
checkHostType(toolbox, BOTTOM, RIGHT);
info("Switching to window");
await toolbox.switchHost(WINDOW);

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

@ -6,7 +6,7 @@
"use strict";
var {Toolbox} = require("devtools/client/framework/toolbox");
var {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
var {LEFT, RIGHT, BOTTOM, WINDOW} = Toolbox.HostType;
var toolbox, target;
const URL = "data:text/html;charset=utf8,test for opening toolbox in different hosts";
@ -18,7 +18,8 @@ add_task(async function runTest() {
toolbox = await gDevTools.showToolbox(target, "webconsole");
await testBottomHost();
await testSidebarHost();
await testLeftHost();
await testRightHost();
await testWindowHost();
await testToolSelect();
await testDestroy();
@ -42,9 +43,24 @@ function testBottomHost() {
checkToolboxLoaded(iframe);
}
async function testSidebarHost() {
await toolbox.switchHost(SIDE);
checkHostType(toolbox, SIDE);
async function testLeftHost() {
await toolbox.switchHost(LEFT);
checkHostType(toolbox, LEFT);
// test UI presence
const nbox = gBrowser.getNotificationBox();
const bottom = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
ok(!bottom, "toolbox bottom iframe doesn't exist");
const iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
ok(iframe, "toolbox side iframe exists");
checkToolboxLoaded(iframe);
}
async function testRightHost() {
await toolbox.switchHost(RIGHT);
checkHostType(toolbox, RIGHT);
// test UI presence
const nbox = gBrowser.getNotificationBox();
@ -95,21 +111,25 @@ async function testPreviousHost() {
// last host was the window - make sure it's the same when re-opening
is(toolbox.hostType, WINDOW, "host remembered");
info("Switching to side");
await toolbox.switchHost(SIDE);
checkHostType(toolbox, SIDE, WINDOW);
info("Switching to left");
await toolbox.switchHost(LEFT);
checkHostType(toolbox, LEFT, WINDOW);
info("Switching to right");
await toolbox.switchHost(RIGHT);
checkHostType(toolbox, RIGHT, LEFT);
info("Switching to bottom");
await toolbox.switchHost(BOTTOM);
checkHostType(toolbox, BOTTOM, SIDE);
checkHostType(toolbox, BOTTOM, RIGHT);
info("Switching from bottom to side");
info("Switching from bottom to right");
await toolbox.switchToPreviousHost();
checkHostType(toolbox, SIDE, BOTTOM);
checkHostType(toolbox, RIGHT, BOTTOM);
info("Switching from side to bottom");
info("Switching from right to bottom");
await toolbox.switchToPreviousHost();
checkHostType(toolbox, BOTTOM, SIDE);
checkHostType(toolbox, BOTTOM, RIGHT);
info("Switching to window");
await toolbox.switchHost(WINDOW);
@ -122,15 +142,15 @@ async function testPreviousHost() {
info("Forcing the previous host to match the current (bottom)");
Services.prefs.setCharPref("devtools.toolbox.previousHost", BOTTOM);
info("Switching from bottom to side (since previous=current=bottom");
info("Switching from bottom to right (since previous=current=bottom");
await toolbox.switchToPreviousHost();
checkHostType(toolbox, SIDE, BOTTOM);
checkHostType(toolbox, RIGHT, BOTTOM);
info("Forcing the previous host to match the current (side)");
Services.prefs.setCharPref("devtools.toolbox.previousHost", SIDE);
info("Switching from side to bottom (since previous=current=side");
info("Forcing the previous host to match the current (right)");
Services.prefs.setCharPref("devtools.toolbox.previousHost", RIGHT);
info("Switching from right to bottom (since previous=current=side");
await toolbox.switchToPreviousHost();
checkHostType(toolbox, BOTTOM, SIDE);
checkHostType(toolbox, BOTTOM, RIGHT);
}
function checkToolboxLoaded(iframe) {

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

@ -27,7 +27,7 @@ add_task(async function() {
let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
is(iframe.clientHeight, nboxHeight - 25, "The iframe fits within the available space");
await toolbox.switchHost(Toolbox.HostType.SIDE);
await toolbox.switchHost(Toolbox.HostType.RIGHT);
iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
iframe.style.minWidth = "1px"; // Disable the min width set in css
is(iframe.clientWidth, nboxWidth - 25, "The iframe fits within the available space");
@ -52,7 +52,7 @@ add_task(async function() {
let iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-bottom-iframe");
is(iframe.clientHeight, 100, "The iframe is resized properly");
await toolbox.switchHost(Toolbox.HostType.SIDE);
await toolbox.switchHost(Toolbox.HostType.RIGHT);
iframe = document.getAnonymousElementByAttribute(nbox, "class", "devtools-toolbox-side-iframe");
iframe.style.minWidth = "1px"; // Disable the min width set in css
is(iframe.clientWidth, 100, "The iframe is resized properly");

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

@ -6,7 +6,7 @@
"use strict";
const {Toolbox} = require("devtools/client/framework/toolbox");
const {SIDE, BOTTOM, WINDOW} = Toolbox.HostType;
const {LEFT, RIGHT, BOTTOM, WINDOW} = Toolbox.HostType;
const URL = "data:text/html;charset=utf8,browser_toolbox_hosts_telemetry.js";
@ -24,18 +24,22 @@ add_task(async function() {
async function changeToolboxHost(toolbox) {
info("Switch toolbox host");
await toolbox.switchHost(SIDE);
await toolbox.switchHost(RIGHT);
await toolbox.switchHost(WINDOW);
await toolbox.switchHost(BOTTOM);
await toolbox.switchHost(SIDE);
await toolbox.switchHost(LEFT);
await toolbox.switchHost(RIGHT);
await toolbox.switchHost(WINDOW);
await toolbox.switchHost(BOTTOM);
await toolbox.switchHost(LEFT);
await toolbox.switchHost(RIGHT);
}
function checkResults() {
// Check for:
// - 3 "bottom" entries.
// - 2 "side" entries.
// - 2 "left" entries.
// - 3 "right" entries.
// - 2 "window" entries.
checkTelemetry("DEVTOOLS_TOOLBOX_HOST", "", [3, 2, 2, 0, 0, 0, 0, 0, 0, 0], "array");
checkTelemetry("DEVTOOLS_TOOLBOX_HOST", "", [3, 3, 2, 0, 2, 0, 0, 0, 0, 0], "array");
}

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

@ -25,7 +25,7 @@ add_task(async function() {
await testToolSelectEvent("styleeditor");
await toolbox.destroy();
toolbox = await openToolboxForTab(tab, "webconsole", "side");
toolbox = await openToolboxForTab(tab, "webconsole", "right");
await testSelectEvent("inspector");
await testSelectEvent("webconsole");
await testSelectEvent("styleeditor");

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

@ -7,7 +7,7 @@ const { Toolbox } = require("devtools/client/framework/toolbox");
const URL = "data:text/html;charset=utf8,browser_toolbox_telemetry_close.js";
const OPTOUT = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT;
const { SIDE, BOTTOM } = Toolbox.HostType;
const { RIGHT, BOTTOM } = Toolbox.HostType;
const DATA = [
{
timestamp: null,
@ -16,7 +16,7 @@ const DATA = [
object: "tools",
value: null,
extra: {
host: "side",
host: "right",
width: "1440"
}
},
@ -41,7 +41,7 @@ add_task(async function() {
const snapshot = Services.telemetry.snapshotEvents(OPTOUT, true);
ok(!snapshot.parent, "No events have been logged for the main process");
await openAndCloseToolbox("webconsole", SIDE);
await openAndCloseToolbox("webconsole", RIGHT);
await openAndCloseToolbox("webconsole", BOTTOM);
checkResults();

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

@ -20,7 +20,7 @@ add_task(async function(pickerEnable, commandsEnable) {
const tab = await addTab("about:blank");
info("Open devtools on the Inspector in a side dock");
const toolbox = await openToolboxForTab(tab, "inspector", Toolbox.HostType.SIDE);
const toolbox = await openToolboxForTab(tab, "inspector", Toolbox.HostType.RIGHT);
await waitUntil(() => toolbox.doc.querySelector(".tools-chevron-menu"));
const menuPopup = await openChevronMenu(toolbox);

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

@ -158,10 +158,10 @@ ToolboxHostManager.prototype = {
hostType = Services.prefs.getCharPref(PREVIOUS_HOST);
// Handle the case where the previous host happens to match the current
// host. If so, switch to bottom if it's not already used, and side if not.
// host. If so, switch to bottom if it's not already used, and right side if not.
if (hostType === this.hostType) {
if (hostType === Toolbox.HostType.BOTTOM) {
hostType = Toolbox.HostType.SIDE;
hostType = Toolbox.HostType.RIGHT;
} else {
hostType = Toolbox.HostType.BOTTOM;
}

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

@ -30,13 +30,6 @@ const MIN_PAGE_SIZE = 25;
* destroy() - destroy the host's UI
*/
exports.Hosts = {
"bottom": BottomHost,
"side": SidebarHost,
"window": WindowHost,
"custom": CustomHost
};
/**
* Host object for the dock on the bottom of the browser
*/
@ -128,27 +121,25 @@ BottomHost.prototype = {
};
/**
* Host object for the in-browser sidebar
* Base Host object for the in-browser sidebar
*/
function SidebarHost(hostTab) {
this.hostTab = hostTab;
class SidebarHost {
constructor(hostTab, hostType) {
this.hostTab = hostTab;
this.type = hostType;
this.widthPref = "devtools.toolbox.sidebar.width";
EventEmitter.decorate(this);
}
SidebarHost.prototype = {
type: "side",
widthPref: "devtools.toolbox.sidebar.width",
EventEmitter.decorate(this);
}
/**
* Create a box in the sidebar of the host tab.
*/
create: async function() {
async create() {
await gDevToolsBrowser.loadBrowserStyleSheet(this.hostTab.ownerGlobal);
const gBrowser = this.hostTab.ownerDocument.defaultView.gBrowser;
const ownerDocument = gBrowser.ownerDocument;
this._browser = gBrowser.getBrowserContainer(this.hostTab.linkedBrowser);
this._sidebar = gBrowser.getSidebarContainer(this.hostTab.linkedBrowser);
this._splitter = ownerDocument.createElement("splitter");
@ -163,8 +154,13 @@ SidebarHost.prototype = {
this._sidebar.clientWidth - MIN_PAGE_SIZE
);
this._sidebar.appendChild(this._splitter);
this._sidebar.appendChild(this.frame);
if (this.hostType == "right") {
this._sidebar.appendChild(this._splitter);
this._sidebar.appendChild(this.frame);
} else {
this._sidebar.insertBefore(this.frame, this._browser);
this._sidebar.insertBefore(this._splitter, this._browser);
}
this.frame.tooltip = "aHTMLTooltip";
this.frame.setAttribute("src", "about:blank");
@ -180,25 +176,25 @@ SidebarHost.prototype = {
});
return frame;
},
}
/**
* Raise the host.
*/
raise: function() {
raise() {
focusTab(this.hostTab);
},
}
/**
* Set the toolbox title.
* Nothing to do for this host type.
*/
setTitle: function() {},
setTitle() {}
/**
* Destroy the sidebar.
*/
destroy: function() {
destroy() {
if (!this._destroyed) {
this._destroyed = true;
@ -209,7 +205,25 @@ SidebarHost.prototype = {
return promise.resolve(null);
}
};
}
/**
* Host object for the in-browser left sidebar
*/
class LeftHost extends SidebarHost {
constructor(hostTab) {
super(hostTab, "left");
}
}
/**
* Host object for the in-browser right sidebar
*/
class RightHost extends SidebarHost {
constructor(hostTab) {
super(hostTab, "right");
}
}
/**
* Host object for the toolbox in a separate window
@ -369,3 +383,12 @@ function focusTab(tab) {
browserWindow.focus();
browserWindow.gBrowser.selectedTab = tab;
}
exports.Hosts = {
"bottom": BottomHost,
"left": LeftHost,
"right": RightHost,
"window": WindowHost,
"custom": CustomHost
};

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

@ -211,7 +211,8 @@ exports.Toolbox = Toolbox;
*/
Toolbox.HostType = {
BOTTOM: "bottom",
SIDE: "side",
RIGHT: "right",
LEFT: "left",
WINDOW: "window",
CUSTOM: "custom"
};
@ -691,9 +692,10 @@ Toolbox.prototype = {
_getTelemetryHostId: function() {
switch (this.hostType) {
case Toolbox.HostType.BOTTOM: return 0;
case Toolbox.HostType.SIDE: return 1;
case Toolbox.HostType.RIGHT: return 1;
case Toolbox.HostType.WINDOW: return 2;
case Toolbox.HostType.CUSTOM: return 3;
case Toolbox.HostType.LEFT: return 4;
default: return 9;
}
},
@ -702,7 +704,8 @@ Toolbox.prototype = {
_getTelemetryHostString: function() {
switch (this.hostType) {
case Toolbox.HostType.BOTTOM: return "bottom";
case Toolbox.HostType.SIDE: return "side";
case Toolbox.HostType.LEFT: return "left";
case Toolbox.HostType.RIGHT: return "right";
case Toolbox.HostType.WINDOW: return "window";
case Toolbox.HostType.CUSTOM: return "other";
default: return "bottom";
@ -1074,7 +1077,8 @@ Toolbox.prototype = {
for (const type in Toolbox.HostType) {
const position = Toolbox.HostType[type];
if (position == Toolbox.HostType.CUSTOM ||
(!sideEnabled && position == Toolbox.HostType.SIDE)) {
(!sideEnabled &&
(position == Toolbox.HostType.LEFT || position == Toolbox.HostType.RIGHT))) {
continue;
}
@ -1248,7 +1252,8 @@ Toolbox.prototype = {
*/
_onPickerClick: function() {
const focus = this.hostType === Toolbox.HostType.BOTTOM ||
this.hostType === Toolbox.HostType.SIDE;
this.hostType === Toolbox.HostType.LEFT ||
this.hostType === Toolbox.HostType.RIGHT;
const currentPanel = this.getCurrentPanel();
if (currentPanel.togglePicker) {
currentPanel.togglePicker(focus);

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

@ -179,8 +179,7 @@ class GridInspector {
* The color to use.
*/
getInitialGridColor(nodeFront, customColor, fallbackColor) {
const highlighted = this._highlighters &&
nodeFront == this.highlighters.gridHighlighterShown;
const highlighted = nodeFront == this.highlighters.gridHighlighterShown;
let color;
if (customColor) {
@ -318,8 +317,7 @@ class GridInspector {
const colorForHost = customColors[hostname] ? customColors[hostname][i] : null;
const fallbackColor = GRID_COLORS[i % GRID_COLORS.length];
const color = this.getInitialGridColor(nodeFront, colorForHost, fallbackColor);
const highlighted = this._highlighters &&
nodeFront == this.highlighters.gridHighlighterShown;
const highlighted = nodeFront == this.highlighters.gridHighlighterShown;
grids.push({
id: i,
@ -452,8 +450,7 @@ class GridInspector {
oldNodeFronts.sort().join(",") == newNodeFronts.sort().join(",")) {
// Same list of containers, but let's check if the geometry of the current grid has
// changed, if it hasn't we can safely abort.
if (!this._highlighters ||
!this.highlighters.gridHighlighterShown ||
if (!this.highlighters.gridHighlighterShown ||
(this.highlighters.gridHighlighterShown &&
!this.haveCurrentFragmentsChanged(newGridFronts))) {
return;

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

@ -509,7 +509,9 @@ Inspector.prototype = {
}
const { clientWidth } = this.panelDoc.getElementById("inspector-splitter-box");
return this.is3PaneModeEnabled && this.toolbox.hostType == Toolbox.HostType.SIDE ?
return this.is3PaneModeEnabled &&
(this.toolbox.hostType == Toolbox.HostType.LEFT ||
this.toolbox.hostType == Toolbox.HostType.RIGHT) ?
clientWidth > SIDE_PORTAIT_MODE_WIDTH_THRESHOLD :
clientWidth > PORTRAIT_MODE_WIDTH_THRESHOLD;
},

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

@ -58,5 +58,5 @@ async function hasRightLabelsContent(highlighterFront, inspector, testActor) {
async function resizeInspector(highlighterFront, inspector, testActor) {
info("Docking the toolbox to the side of the browser to change the window size");
const toolbox = inspector.toolbox;
await toolbox.switchHost(Toolbox.HostType.SIDE);
await toolbox.switchHost(Toolbox.HostType.RIGHT);
}

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

@ -20,8 +20,8 @@ add_task(async function() {
ok(button.classList.contains("pane-collapsed"), "The button is in collapsed state");
ok(!!button.getClientRects().length, "The button is visible");
info("Switch the host to side type");
await toolbox.switchHost("side");
info("Switch the host to the right");
await toolbox.switchHost("right");
ok(!!button.getClientRects().length, "The button is still visible");
ok(button.classList.contains("pane-collapsed"),

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

@ -14,8 +14,8 @@ add_task(async function() {
const { inspector, toolbox } = await openInspectorForURL("about:blank");
const { panelDoc: doc } = inspector;
info("Switch the host to side type");
await toolbox.switchHost("side");
info("Switch the host to the right");
await toolbox.switchHost("right");
const button = doc.querySelector(".sidebar-toggle");
const toolboxWidth = doc.getElementById("inspector-splitter-box").clientWidth;

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

@ -126,7 +126,8 @@ toolbox.meatballMenu.button.tooltip=Customize Developer Tools and get help
# in the "..." menu in the toolbox and represent the different arrangements for
# docking (or undocking) the developer tools toolbox.
toolbox.meatballMenu.dock.bottom.label=Dock to bottom
toolbox.meatballMenu.dock.side.label=Dock to side
toolbox.meatballMenu.dock.left.label=Dock to left
toolbox.meatballMenu.dock.right.label=Dock to right
toolbox.meatballMenu.dock.separateWindow.label=Separate window
# LOCALIZATION NOTE (toolbox.meatballMenu.{splitconsole,hideconsole}.label):

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

@ -213,10 +213,10 @@ add_task(async function() {
async function testSide() {
await restartNetMonitorAndSetupEnv();
info("Moving toolbox to the side...");
info("Moving toolbox to the right...");
await monitor.toolbox.switchHost("side");
info("Testing prefs reload for a side host.");
await monitor.toolbox.switchHost("right");
info("Testing prefs reload for a right host.");
storeFirstPrefValues();
// Validate and modify frontend while toolbox is on the side.

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

@ -9,7 +9,7 @@ pref("devtools.webide.enabled", true);
pref("devtools.toolbox.footer.height", 250);
pref("devtools.toolbox.sidebar.width", 500);
pref("devtools.toolbox.host", "bottom");
pref("devtools.toolbox.previousHost", "side");
pref("devtools.toolbox.previousHost", "right");
pref("devtools.toolbox.selectedTool", "webconsole");
pref("devtools.toolbox.sideEnabled", true);
pref("devtools.toolbox.zoomValue", "1");

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

@ -126,7 +126,7 @@ var EventsHandler = {
* Handles a host change event on the parent toolbox.
*/
_onHostChanged: function() {
if (gToolbox.hostType == "side") {
if (gToolbox.hostType == "right" || gToolbox.hostType == "left") {
$("#shaders-pane").removeAttribute("height");
}
},
@ -265,7 +265,8 @@ var ShadersListView = extend(WidgetMethods, {
// Prevent this container from growing indefinitely in height when the
// toolbox is docked to the side.
if (gToolbox.hostType == "side" && this.itemCount == SHADERS_AUTOGROW_ITEMS) {
if ((gToolbox.hostType == "left" || gToolbox.hostType == "right") &&
this.itemCount == SHADERS_AUTOGROW_ITEMS) {
this._pane.setAttribute("height", this._pane.getBoundingClientRect().height);
}
},

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

@ -22,7 +22,7 @@ const TOOLTIP_HEIGHT = 30;
add_task(async function() {
await pushPref("devtools.toolbox.sidebar.width", TOOLBOX_WIDTH);
const [,, doc] = await createHost("side", TEST_URI);
const [,, doc] = await createHost("right", TEST_URI);
info("Test a tooltip is not closed when clicking inside itself");

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

@ -25,8 +25,8 @@ add_task(async function() {
info("Testing host types");
checkHostType(Toolbox.HostType.BOTTOM);
await checkToolboxUI();
await toolbox.switchHost(Toolbox.HostType.SIDE);
checkHostType(Toolbox.HostType.SIDE);
await toolbox.switchHost(Toolbox.HostType.RIGHT);
checkHostType(Toolbox.HostType.RIGHT);
await checkToolboxUI();
await toolbox.switchHost(Toolbox.HostType.WINDOW);

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

@ -348,7 +348,7 @@ const DATA = [
object: "tools",
value: null,
extra: {
host: "side",
host: "right",
width: "1440"
}
},

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

@ -1069,7 +1069,7 @@ ShouldIncludeEdge(JS::CompartmentSet* compartments,
// Shape's getter/setter JSObjects). However, we do not serialize nodes in other
// compartments that are reachable from these non-compartment nodes.
JSCompartment* compartment = edge.referent.compartment();
JS::Compartment* compartment = edge.referent.compartment();
if (!compartment || compartments->has(compartment)) {
return true;

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

@ -30,7 +30,7 @@ using namespace testing;
struct DevTools : public ::testing::Test {
bool _initialized;
JSContext* cx;
JSCompartment* compartment;
JS::Compartment* compartment;
JS::Zone* zone;
JS::PersistentRootedObject global;
@ -130,7 +130,7 @@ class MOZ_STACK_CLASS FakeNode
{
public:
JS::ubi::EdgeVector edges;
JSCompartment* compartment;
JS::Compartment* compartment;
JS::Zone* zone;
size_t size;
@ -164,7 +164,7 @@ class Concrete<FakeNode> : public Base
return get().zone;
}
JSCompartment* compartment() const override {
JS::Compartment* compartment() const override {
return get().compartment;
}

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

@ -16,7 +16,7 @@ DEF_TEST(DoesCrossCompartmentBoundaries, {
JS::FireOnNewGlobalHook,
options));
ASSERT_TRUE(newGlobal);
JSCompartment* newCompartment = nullptr;
JS::Compartment* newCompartment = nullptr;
{
JSAutoRealm ar(cx, newGlobal);
ASSERT_TRUE(JS_InitStandardClasses(cx, newGlobal));

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

@ -16,7 +16,7 @@ DEF_TEST(DoesntCrossCompartmentBoundaries, {
JS::FireOnNewGlobalHook,
options));
ASSERT_TRUE(newGlobal);
JSCompartment* newCompartment = nullptr;
JS::Compartment* newCompartment = nullptr;
{
JSAutoRealm ar(cx, newGlobal);
ASSERT_TRUE(JS_InitStandardClasses(cx, newGlobal));

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

@ -15,7 +15,7 @@ namespace mozilla {
// with principals that are either the system principal or an expanded principal.
// This may not return true for all non-web-content compartments.
struct BrowserCompartmentMatcher : public js::CompartmentFilter {
bool match(JSCompartment* aC) const override
bool match(JS::Compartment* aC) const override
{
nsCOMPtr<nsIPrincipal> pc = nsJSPrincipals::get(JS_GetCompartmentPrincipals(aC));
return nsContentUtils::IsSystemOrExpandedPrincipal(pc);
@ -111,7 +111,7 @@ WindowDestroyedEvent::Run()
AutoSafeJSContext cx;
JS::Rooted<JSObject*> obj(cx, currentInner->FastGetGlobalJSObject());
if (obj && !js::IsSystemRealm(js::GetNonCCWObjectRealm(obj))) {
JSCompartment* cpt = js::GetObjectCompartment(obj);
JS::Compartment* cpt = js::GetObjectCompartment(obj);
nsCOMPtr<nsIPrincipal> pc = nsJSPrincipals::get(JS_GetCompartmentPrincipals(cpt));
if (BasePrincipal::Cast(pc)->AddonPolicy()) {

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

@ -3146,8 +3146,8 @@ nsContentUtils::ObjectPrincipal(JSObject* aObj)
// This is duplicated from nsScriptSecurityManager. We don't call through there
// because the API unnecessarily requires a JSContext for historical reasons.
JSCompartment *compartment = js::GetObjectCompartment(aObj);
JSPrincipals *principals = JS_GetCompartmentPrincipals(compartment);
JS::Compartment* compartment = js::GetObjectCompartment(aObj);
JSPrincipals* principals = JS_GetCompartmentPrincipals(compartment);
return nsJSPrincipals::get(principals);
}

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

@ -52,7 +52,6 @@
#include "nsScreen.h"
#include "ChildIterator.h"
#include "mozilla/dom/AboutCapabilitiesBinding.h"
#include "mozilla/AsyncEventDispatcher.h"
#include "mozilla/BasicEvents.h"
#include "mozilla/EventListenerManager.h"
@ -1860,7 +1859,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(nsDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mDisplayDocument)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mFontFaceSet)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mReadyForIdle)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mAboutCapabilities)
// Traverse all nsDocument nsCOMPtrs.
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParser)
@ -2015,7 +2013,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mOrientationPendingPromise)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mFontFaceSet)
NS_IMPL_CYCLE_COLLECTION_UNLINK(mReadyForIdle);
NS_IMPL_CYCLE_COLLECTION_UNLINK(mAboutCapabilities)
tmp->mParentDocument = nullptr;
@ -3297,62 +3294,6 @@ nsIDocument::GetAllowPlugins()
return true;
}
bool
nsDocument::CallerIsTrustedAboutPage(JSContext* aCx, JSObject* aObject)
{
/*
* If you want an about: page to have access to AboutCapabilities,
* please add it to the list of trusted about: pages underneath.
*/
static const char* kTrustedAboutPages[] = {
"about:privatebrowsing",
};
nsIPrincipal* principal = nsContentUtils::SubjectPrincipal(aCx);
if (!principal) {
return false;
}
nsCOMPtr<nsIURI> uri;
principal->GetURI(getter_AddRefs(uri));
if (!uri) {
return false;
}
// getSpec is an expensive operation, hence we first check the scheme
// to see if the caller is actually an about: page.
bool isAboutScheme = false;
uri->SchemeIs("about", &isAboutScheme);
if (!isAboutScheme) {
return false;
}
nsAutoCString aboutSpec;
uri->GetSpec(aboutSpec);
for (auto & aboutPageEntry : kTrustedAboutPages) {
if (aboutSpec.EqualsIgnoreCase(aboutPageEntry)) {
return true;
}
}
return false;
}
already_AddRefed<AboutCapabilities>
nsIDocument::GetAboutCapabilities(ErrorResult& aRv)
{
if (!mAboutCapabilities) {
AutoJSContext cx;
JS::Rooted<JSObject*> jsImplObj(cx);
nsIGlobalObject* sgo = GetScopeObject();
ConstructJSImplementation("@mozilla.org/aboutcapabilities;1", sgo, &jsImplObj, aRv);
if (aRv.Failed()) {
return nullptr;
}
mAboutCapabilities = new AboutCapabilities(jsImplObj, sgo);
}
RefPtr<AboutCapabilities> aboutCapabilities =
static_cast<AboutCapabilities*>(mAboutCapabilities.get());
return aboutCapabilities.forget();
}
bool
nsDocument::IsElementAnimateEnabled(JSContext* aCx, JSObject* /*unused*/)
{

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

@ -158,7 +158,6 @@ public:
virtual void StopDocumentLoad() override;
static bool CallerIsTrustedAboutPage(JSContext* aCx, JSObject* aObject);
static bool IsElementAnimateEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
static bool IsWebAnimationsEnabled(mozilla::dom::CallerType aCallerType);

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

@ -1412,7 +1412,7 @@ nsMessageManagerScriptExecutor::InitChildGlobalInternal(const nsACString& aID)
nsContentUtils::GetSecurityManager()->GetSystemPrincipal(getter_AddRefs(mPrincipal));
JS::RealmOptions options;
options.creationOptions().setSystemZone();
options.creationOptions().setNewCompartmentInSystemZone();
xpc::InitGlobalObjectOptions(options, mPrincipal);
JS::Rooted<JSObject*> global(cx);

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

@ -1564,11 +1564,11 @@ SelectZone(nsGlobalWindowInner* aNewInner,
// If we have a top-level window, use its zone.
if (top && top->GetGlobalJSObject()) {
return aOptions.setExistingZone(top->GetGlobalJSObject());
return aOptions.setNewCompartmentInExistingZone(top->GetGlobalJSObject());
}
}
return aOptions.setNewZone();
return aOptions.setNewCompartmentAndZone();
}
/**

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

@ -137,7 +137,6 @@ class Rule;
} // namespace css
namespace dom {
class AboutCapabilities;
class Animation;
class AnonymousContent;
class Attr;
@ -3142,9 +3141,6 @@ public:
void GetLastModified(nsAString& aLastModified) const;
void GetReadyState(nsAString& aReadyState) const;
already_AddRefed<mozilla::dom::AboutCapabilities> GetAboutCapabilities(
ErrorResult& aRv);
void GetTitle(nsAString& aTitle);
void SetTitle(const nsAString& aTitle, mozilla::ErrorResult& rv);
void GetDir(nsAString& aDirection) const;
@ -3817,8 +3813,6 @@ protected:
RefPtr<mozilla::dom::Promise> mReadyForIdle;
RefPtr<mozilla::dom::AboutCapabilities> mAboutCapabilities;
// True if BIDI is enabled.
bool mBidiEnabled : 1;
// True if a MathML element has ever been owned by this document.

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

@ -1233,6 +1233,14 @@ nsINode::Traverse(nsINode *tmp, nsCycleCollectionTraversalCallback &cb)
cb.NoteXPCOMChild(objects->ObjectAt(i));
}
}
#ifdef ACCESSIBILITY
AccessibleNode* anode =
static_cast<AccessibleNode*>(tmp->GetProperty(nsGkAtoms::accessiblenode));
if (anode) {
cb.NoteXPCOMChild(anode);
}
#endif
}
if (tmp->NodeType() != DOCUMENT_NODE &&
@ -1262,6 +1270,7 @@ nsINode::Unlink(nsINode* tmp)
if (tmp->HasProperties()) {
tmp->DeleteProperty(nsGkAtoms::keepobjectsalive);
tmp->DeleteProperty(nsGkAtoms::accessiblenode);
}
}
@ -2297,7 +2306,20 @@ already_AddRefed<AccessibleNode>
nsINode::GetAccessibleNode()
{
#ifdef ACCESSIBILITY
RefPtr<AccessibleNode> anode = new AccessibleNode(this);
nsresult rv = NS_OK;
RefPtr<AccessibleNode> anode =
static_cast<AccessibleNode*>(GetProperty(nsGkAtoms::accessiblenode, &rv));
if (NS_FAILED(rv)) {
anode = new AccessibleNode(this);
RefPtr<AccessibleNode> temp = anode;
rv = SetProperty(nsGkAtoms::accessiblenode, temp.forget().take(),
nsPropertyTable::SupportsDtorFunc, true);
if (NS_FAILED(rv)) {
NS_WARNING("SetProperty failed");
return nullptr;
}
}
return anode.forget();
#else
return nullptr;

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

@ -101,7 +101,7 @@ nsJSUtils::CompileFunction(AutoJSAPI& jsapi,
JSObject** aFunctionObject)
{
JSContext* cx = jsapi.cx();
MOZ_ASSERT(js::GetEnterRealmDepth(cx) > 0);
MOZ_ASSERT(js::GetContextRealm(cx));
MOZ_ASSERT_IF(aScopeChain.length() != 0,
js::IsObjectInContextCompartment(aScopeChain[0], cx));

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

@ -2281,8 +2281,8 @@ ReparentWrapper(JSContext* aCx, JS::Handle<JSObject*> aObjArg, ErrorResult& aErr
JSAutoRealm oldAr(aCx, oldParent);
JSCompartment* oldCompartment = js::GetObjectCompartment(oldParent);
JSCompartment* newCompartment = js::GetObjectCompartment(newParent);
JS::Compartment* oldCompartment = js::GetObjectCompartment(oldParent);
JS::Compartment* newCompartment = js::GetObjectCompartment(newParent);
if (oldCompartment == newCompartment) {
MOZ_ASSERT(oldParent == newParent);
return;

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

@ -15050,7 +15050,7 @@ class CGJSImplMethod(CGJSImplMember):
def getArgs(self, returnType, argList):
if self.isConstructor:
# Skip the JSCompartment bits for constructors; it's handled
# Skip the JS::Compartment bits for constructors; it's handled
# manually in getImpl. But we do need our aGivenProto argument. We
# allow it to be omitted if the default proto is desired.
return (CGNativeMember.getArgs(self, returnType, argList) +

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

@ -115,7 +115,7 @@ SimpleGlobalObject::Create(GlobalType globalType, JS::Handle<JS::Value> proto)
// lots of zones for what are probably very short-lived
// compartments. This should help them be GCed quicker and take up
// less memory before they're GCed.
.setSystemZone();
.setNewCompartmentInSystemZone();
if (NS_IsMainThread()) {
nsCOMPtr<nsIPrincipal> principal = NullPrincipal::CreateWithoutOriginAttributes();

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

@ -2663,7 +2663,8 @@ CreateDeclarationForServo(nsCSSPropertyID aProperty,
data,
ParsingMode::Default,
aDocument->GetCompatibilityMode(),
aDocument->CSSLoader());
aDocument->CSSLoader(),
{ });
}
return servoDeclarations.forget();

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

@ -210,7 +210,7 @@ private:
const Sequence<JS::Value>& aData,
MethodName aMethodName, const nsAString& aMethodString);
// This method must receive aCx and aArguments in the same JSCompartment.
// This method must receive aCx and aArguments in the same JS::Compartment.
void
ProcessCallData(JSContext* aCx,
ConsoleCallData* aData,

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

@ -20,7 +20,6 @@
#include "mozilla/LinkedList.h"
#include "mozilla/dom/EventTarget.h"
struct JSCompartment;
class nsIDocument;
namespace mozilla {

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

@ -1560,8 +1560,10 @@ ContentParent::ProcessingError(Result aCode, const char* aReason)
if (MsgDropped == aCode) {
return;
}
#ifndef FUZZING
// Other errors are big deals.
KillHard(aReason);
#endif
}
/* static */

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

@ -78,6 +78,9 @@ class OptionalURIParams;
class PFileDescriptorSetParent;
class URIParams;
class TestShellParent;
#ifdef FUZZING
class ProtocolFuzzerHelper;
#endif
} // namespace ipc
namespace jsipc {
@ -123,6 +126,9 @@ class ContentParent final : public PContentParent
friend class ContentProcessHost;
friend class mozilla::PreallocatedProcessManagerImpl;
#ifdef FUZZING
friend class mozilla::ipc::ProtocolFuzzerHelper;
#endif
public:

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

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* 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/. */
#include "gtest/gtest.h"
#include "FuzzingInterface.h"
#include "ProtocolFuzzer.h"
#include "mozilla/RefPtr.h"
#include "mozilla/devtools/PHeapSnapshotTempFileHelper.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/gfx/gfxVars.h"
int
FuzzingInitContentParentIPC(int* argc, char*** argv)
{
return 0;
}
static int
RunContentParentIPCFuzzing(const uint8_t* data, size_t size)
{
static mozilla::dom::ContentParent* p =
mozilla::ipc::ProtocolFuzzerHelper::CreateContentParent(
nullptr, NS_LITERAL_STRING(DEFAULT_REMOTE_TYPE));
static nsTArray<nsCString> ignored = mozilla::ipc::LoadIPCMessageBlacklist(
getenv("MOZ_IPC_MESSAGE_FUZZ_BLACKLIST"));
mozilla::ipc::FuzzProtocol(p, data, size, ignored);
return 0;
}
MOZ_FUZZING_INTERFACE_RAW(FuzzingInitContentParentIPC,
RunContentParentIPCFuzzing,
ContentParentIPC);

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

@ -0,0 +1,22 @@
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# 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/.
Library('FuzzingContentParentIPC')
LOCAL_INCLUDES += [
'/dom/base',
]
SOURCES += [
'content_parent_ipc_libfuzz.cpp'
]
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul-gtest'
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -178,3 +178,11 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ASYNC_CONTENTPROC_LAUNCH'] = True
if CONFIG['FUZZING'] and CONFIG['FUZZING_INTERFACES']:
TEST_DIRS += [
'fuzztest'
]
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -1801,7 +1801,10 @@ class PeerConnectionObserver {
break;
case "IceConnectionState":
this.handleIceConnectionStateChange(this._dompc._pc.iceConnectionState);
let connState = this._dompc._pc.iceConnectionState;
this._dompc._queueTaskWithClosedCheck(() => {
this.handleIceConnectionStateChange(connState);
});
break;
case "IceGatheringState":

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

@ -84,7 +84,7 @@ skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulato
[test_getUserMedia_mediaElementCapture_video.html]
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_mediaStreamClone.html]
skip-if = toolkit == 'android' && debug # Bug 1282262
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_getUserMedia_mediaStreamConstructors.html]
[test_getUserMedia_mediaStreamTrackClone.html]
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)

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

@ -260,7 +260,7 @@ ReadExpires(JSContext* aCx, const ObjectOrString& aOptions,
already_AddRefed<Promise>
RTCCertificate::GenerateCertificate(
const GlobalObject& aGlobal, const ObjectOrString& aOptions,
ErrorResult& aRv, JSCompartment* aCompartment)
ErrorResult& aRv, JS::Compartment* aCompartment)
{
nsIGlobalObject* global = xpc::NativeGlobal(aGlobal.Get());
RefPtr<Promise> p = Promise::Create(global, aRv);

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

@ -38,7 +38,7 @@ public:
// WebIDL method that implements RTCPeerConnection.generateCertificate.
static already_AddRefed<Promise> GenerateCertificate(
const GlobalObject& aGlobal, const ObjectOrString& aOptions,
ErrorResult& aRv, JSCompartment* aCompartment = nullptr);
ErrorResult& aRv, JS::Compartment* aCompartment = nullptr);
explicit RTCCertificate(nsIGlobalObject* aGlobal);
RTCCertificate(nsIGlobalObject* aGlobal, SECKEYPrivateKey* aPrivateKey,

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

@ -520,7 +520,7 @@ Promise::GlobalJSObject() const
return mGlobal->GetGlobalJSObject();
}
JSCompartment*
JS::Compartment*
Promise::Compartment() const
{
return js::GetObjectCompartment(GlobalJSObject());

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

@ -150,7 +150,7 @@ public:
JSObject* GlobalJSObject() const;
JSCompartment* Compartment() const;
JS::Compartment* Compartment() const;
// Create a dom::Promise from a given SpiderMonkey Promise object.
// aPromiseObj MUST be in the compartment of aGlobal's global JS object.

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

@ -1202,7 +1202,8 @@ MappedAttrParser::ParseMappedAttrValue(nsAtom* aMappedAttrName,
mElement->NodePrincipal());
changed = Servo_DeclarationBlock_SetPropertyById(
mDecl->Raw(), propertyID, &value, false, data,
ParsingMode::AllowUnitlessLength, mElement->OwnerDoc()->GetCompatibilityMode(), mLoader);
ParsingMode::AllowUnitlessLength,
mElement->OwnerDoc()->GetCompatibilityMode(), mLoader, { });
if (changed) {
// The normal reporting of use counters by the nsCSSParser won't happen

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

@ -1,32 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/.
*/
[NoInterfaceObject, JSImplementation="@mozilla.org/aboutcapabilities;1"]
interface AboutCapabilities
{
/**
* When using setBoolPref, one also has to whitelist the
* pref to be updated within AsyncPrefs.jsm
*/
Promise<void> setBoolPref(DOMString aPref, boolean aValue);
boolean getBoolPref(DOMString aPref, boolean? aDefaultValue);
/**
* When using setCharPref, one also has to whitelist the
* pref to be updated within AsyncPrefs.jsm
*/
Promise<void> setCharPref(DOMString aPref, DOMString aValue);
DOMString getCharPref(DOMString aPref, DOMString? aDefaultValue);
DOMString getStringFromBundle(DOMString aStrBundle, DOMString aStr);
DOMString formatURLPref(DOMString aFormatURL);
void sendAsyncMessage(DOMString aMessage, object? aParams);
/* about:privatebrowsing */
boolean isWindowPrivate();
};

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

@ -497,11 +497,6 @@ partial interface Document {
readonly attribute FlashClassification documentFlashClassification;
};
// Allows about: pages to query aboutCapabilities
partial interface Document {
[Throws, Func="nsDocument::CallerIsTrustedAboutPage"] readonly attribute AboutCapabilities aboutCapabilities;
};
Document implements XPathEvaluator;
Document implements GlobalEventHandlers;
Document implements DocumentAndElementEventHandlers;

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

@ -208,7 +208,7 @@ interface Node : EventTarget {
Promise<void> localize(L10nCallback l10nCallback);
#ifdef ACCESSIBILITY
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled"]
[Func="mozilla::dom::AccessibleNode::IsAOMEnabled", SameObject]
readonly attribute AccessibleNode? accessibleNode;
#endif
};

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

@ -358,7 +358,6 @@ PREPROCESSED_WEBIDL_FILES = [
WEBIDL_FILES = [
'AbortController.webidl',
'AbortSignal.webidl',
'AboutCapabilities.webidl',
'AbstractWorker.webidl',
'AddonManager.webidl',
'AnalyserNode.webidl',

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

@ -23,6 +23,25 @@ enum class Orient
FLIP_VERTICALLY
};
static void
InitializeRowBuffer(uint32_t* aBuffer,
size_t aSize,
size_t aStartPixel,
size_t aEndPixel,
uint32_t aSetPixel)
{
uint32_t transparentPixel = BGRAColor::Transparent().AsPixel();
for (size_t i = 0; i < aStartPixel && i < aSize; ++i) {
aBuffer[i] = transparentPixel;
}
for (size_t i = aStartPixel; i < aEndPixel && i < aSize; ++i) {
aBuffer[i] = aSetPixel;
}
for (size_t i = aEndPixel; i < aSize; ++i) {
aBuffer[i] = transparentPixel;
}
}
template <Orient Orientation, typename Func> void
WithSurfaceSink(Func aFunc)
{
@ -384,10 +403,7 @@ TEST(ImageSurfaceSink, SurfaceSinkWriteBuffer)
// containing 60 pixels of green in the middle and 20 transparent pixels on
// either side.
uint32_t buffer[100];
for (int i = 0; i < 100; ++i) {
buffer[i] = 20 <= i && i < 80 ? BGRAColor::Green().AsPixel()
: BGRAColor::Transparent().AsPixel();
}
InitializeRowBuffer(buffer, 100, 20, 80, BGRAColor::Green().AsPixel());
// Write the buffer to every row of the surface and check that the generated
// image is correct.
@ -609,10 +625,7 @@ TEST(ImageSurfaceSink, SurfaceSinkWritePixelBlocks)
// containing 60 pixels of green in the middle and 20 transparent pixels on
// either side.
uint32_t buffer[100];
for (int i = 0; i < 100; ++i) {
buffer[i] = 20 <= i && i < 80 ? BGRAColor::Green().AsPixel()
: BGRAColor::Transparent().AsPixel();
}
InitializeRowBuffer(buffer, 100, 20, 80, BGRAColor::Green().AsPixel());
uint32_t count = 0;
WriteState result = aSink->WritePixelBlocks<uint32_t>([&](uint32_t* aBlockStart,
@ -660,10 +673,7 @@ TEST(ImageSurfaceSink, SurfaceSinkWritePixelBlocksPartialRow)
// containing 60 pixels of green in the middle and 20 transparent pixels on
// either side.
uint32_t buffer[100];
for (int i = 0; i < 100; ++i) {
buffer[i] = 20 <= i && i < 80 ? BGRAColor::Green().AsPixel()
: BGRAColor::Transparent().AsPixel();
}
InitializeRowBuffer(buffer, 100, 20, 80, BGRAColor::Green().AsPixel());
// Write the first 99 rows of our 100x100 surface and verify that even
// though our lambda will yield pixels forever, only one row is written per

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

@ -69,3 +69,7 @@ else:
else:
DEFINES['OS_LINUX'] = 1
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -151,3 +151,6 @@ DIRS += [
if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
CXXFLAGS += ['-Wno-error=shadow']
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -94,6 +94,9 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
{
friend class ProcessLink;
friend class ThreadLink;
#ifdef FUZZING
friend class ProtocolFuzzerHelper;
#endif
class CxxStackFrame;
class InterruptFrame;

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

@ -311,7 +311,9 @@ LogicError(const char* aMsg)
void
ActorIdReadError(const char* aActorDescription)
{
#ifndef FUZZING
MOZ_CRASH_UNSAFE_PRINTF("Error deserializing id for %s", aActorDescription);
#endif
}
void

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

@ -231,3 +231,6 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc'):
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ASYNC_CONTENTPROC_LAUNCH'] = True
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -16,3 +16,6 @@ FINAL_LIBRARY = 'xul'
# We #include some things in the dom/plugins/ directory that rely on
# toolkit libraries.
CXXFLAGS += CONFIG['TK_CFLAGS']
# Add libFuzzer configuration directives
include('/tools/fuzzing/libfuzzer-config.mozbuild')

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

@ -429,7 +429,7 @@ XPCShellEnvironment::Init()
}
JS::RealmOptions options;
options.creationOptions().setSystemZone();
options.creationOptions().setNewCompartmentInSystemZone();
if (xpc::SharedMemoryEnabled())
options.creationOptions().setSharedMemoryAndAtomicsEnabled(true);

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше