mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 22:05:44 +00:00
Merge autoland to mozilla-central. a=merge
This commit is contained in:
commit
22d5a6c371
@ -62,7 +62,7 @@ module.exports = {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "local",
|
||||
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS"
|
||||
"varsIgnorePattern": "^EXPORTED_SYMBOLS$"
|
||||
}]
|
||||
}
|
||||
}, {
|
||||
|
@ -537,11 +537,11 @@ const gStoragePressureObserver = {
|
||||
} else {
|
||||
// The firefox-used space >= 5GB, then guide users to about:preferences
|
||||
// to clear some data stored on firefox by websites.
|
||||
let descriptionStringID = "spaceAlert.over5GB.message";
|
||||
let descriptionStringID = "spaceAlert.over5GB.message1";
|
||||
let prefButtonLabelStringID = "spaceAlert.over5GB.prefButton.label";
|
||||
let prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButton.accesskey";
|
||||
if (AppConstants.platform == "win") {
|
||||
descriptionStringID = "spaceAlert.over5GB.messageWin";
|
||||
descriptionStringID = "spaceAlert.over5GB.messageWin1";
|
||||
prefButtonLabelStringID = "spaceAlert.over5GB.prefButtonWin.label";
|
||||
prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButtonWin.accesskey";
|
||||
}
|
||||
@ -553,7 +553,7 @@ const gStoragePressureObserver = {
|
||||
// The advanced subpanes are only supported in the old organization, which will
|
||||
// be removed by bug 1349689.
|
||||
let win = gBrowser.ownerGlobal;
|
||||
win.openPreferences("panePrivacy", { origin: "storagePressure" });
|
||||
win.openPreferences("privacy-sitedata", { origin: "storagePressure" });
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -6076,7 +6076,7 @@ function stripUnsafeProtocolOnPaste(pasteData) {
|
||||
try {
|
||||
scheme = Services.io.extractScheme(pasteData);
|
||||
} catch (ex) { }
|
||||
if (scheme.toLowerCase() != "javascript") {
|
||||
if (scheme != "javascript") {
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ async function getAllTheFiles(extension) {
|
||||
}
|
||||
let urisGreD = await generateURIsFromDirTree(appDirGreD, [extension]);
|
||||
let urisXCurProcD = await generateURIsFromDirTree(appDirXCurProcD, [extension]);
|
||||
return Array.from(new Set(urisGreD.concat(appDirXCurProcD)));
|
||||
return Array.from(new Set(urisGreD.concat(urisXCurProcD)));
|
||||
}
|
||||
|
||||
add_task(async function checkAllTheProperties() {
|
||||
|
@ -15,7 +15,7 @@ module.exports = {
|
||||
"no-sequences": "error",
|
||||
"no-shadow": "error",
|
||||
"no-throw-literal": "error",
|
||||
"no-unused-vars": ["error", { "varsIgnorePattern": "^EXPORTED_SYMBOLS$" }],
|
||||
"no-unused-vars": ["error", { "args": "after-used", "varsIgnorePattern": "^EXPORTED_SYMBOLS$", "vars": "all" }],
|
||||
"padded-blocks": ["error", "never"],
|
||||
"semi-spacing": ["error", {"before": false, "after": true}],
|
||||
"space-in-parens": ["error", "never"],
|
||||
|
@ -170,7 +170,7 @@
|
||||
<groupbox id="siteDataGroup" hidden="true" data-category="panePrivacy" data-hidden-from-search="true">
|
||||
<caption><label>&siteData1.label;</label></caption>
|
||||
|
||||
<hbox align="baseline">
|
||||
<hbox data-subcategory="sitedata" align="baseline">
|
||||
<vbox flex="1">
|
||||
<radiogroup id="acceptCookies"
|
||||
preference="network.cookie.cookieBehavior"
|
||||
|
@ -198,15 +198,15 @@ add_task(async function() {
|
||||
|
||||
let columns = site1.querySelectorAll(".item-box > label");
|
||||
is(columns[0].value, "example.com", "Should show the correct host.");
|
||||
is(columns[2].value, "2", "Should show the correct number of cookies.");
|
||||
is(columns[3].value, "", "Should show no site data.");
|
||||
is(columns[4].value, args.creationDate1, "Should show the correct date.");
|
||||
is(columns[1].value, "2", "Should show the correct number of cookies.");
|
||||
is(columns[2].value, "", "Should show no site data.");
|
||||
is(columns[3].value, args.creationDate1, "Should show the correct date.");
|
||||
|
||||
columns = site2.querySelectorAll(".item-box > label");
|
||||
is(columns[0].value, "example.org", "Should show the correct host.");
|
||||
is(columns[2].value, "1", "Should show the correct number of cookies.");
|
||||
is(columns[3].value, "", "Should show no site data.");
|
||||
is(columns[4].value, args.creationDate2, "Should show the correct date.");
|
||||
is(columns[1].value, "1", "Should show the correct number of cookies.");
|
||||
is(columns[2].value, "", "Should show no site data.");
|
||||
is(columns[3].value, args.creationDate2, "Should show the correct date.");
|
||||
|
||||
let removeBtn = frameDoc.getElementById("removeSelected");
|
||||
let saveBtn = frameDoc.getElementById("save");
|
||||
@ -232,9 +232,9 @@ add_task(async function() {
|
||||
|
||||
let columns = site1.querySelectorAll(".item-box > label");
|
||||
is(columns[0].value, "example.com", "Should show the correct host.");
|
||||
is(columns[2].value, "2", "Should show the correct number of cookies.");
|
||||
is(columns[3].value, "", "Should show no site data.");
|
||||
is(columns[4].value, args.creationDate1, "Should show the correct date.");
|
||||
is(columns[1].value, "2", "Should show the correct number of cookies.");
|
||||
is(columns[2].value, "", "Should show no site data.");
|
||||
is(columns[3].value, args.creationDate1, "Should show the correct date.");
|
||||
|
||||
let removeBtn = frameDoc.getElementById("removeSelected");
|
||||
let saveBtn = frameDoc.getElementById("save");
|
||||
|
@ -94,15 +94,12 @@ add_task(async function() {
|
||||
let expected = "account.xyz.com";
|
||||
is(columns[0].value, expected, "Should group and list sites by host");
|
||||
|
||||
is(columns[1].value, "5", "Should group cookies across scheme, port and origin attributes");
|
||||
|
||||
let prefStrBundle = frameDoc.getElementById("bundlePreferences");
|
||||
expected = prefStrBundle.getString("persistent");
|
||||
is(columns[1].value, expected, "Should mark persisted status across scheme, port and origin attributes");
|
||||
|
||||
is(columns[2].value, "5", "Should group cookies across scheme, port and origin attributes");
|
||||
|
||||
expected = prefStrBundle.getFormattedString("siteUsage",
|
||||
expected = prefStrBundle.getFormattedString("siteUsagePersistent",
|
||||
DownloadUtils.convertByteUnits(quotaUsage * mockSiteDataManager.fakeSites.length));
|
||||
is(columns[3].value, expected, "Should sum up usages across scheme, port and origin attributes");
|
||||
is(columns[2].value, expected, "Should sum up usages across scheme, port, origin attributes and persistent status");
|
||||
|
||||
await mockSiteDataManager.unregister();
|
||||
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
@ -143,7 +140,6 @@ add_task(async function() {
|
||||
let frameDoc = dialogFrame.contentDocument;
|
||||
let hostCol = frameDoc.getElementById("hostCol");
|
||||
let usageCol = frameDoc.getElementById("usageCol");
|
||||
let statusCol = frameDoc.getElementById("statusCol");
|
||||
let cookiesCol = frameDoc.getElementById("cookiesCol");
|
||||
let sitesList = frameDoc.getElementById("sitesList");
|
||||
|
||||
@ -162,18 +158,12 @@ add_task(async function() {
|
||||
hostCol.click();
|
||||
assertSortByBaseDomain("descending");
|
||||
|
||||
// Test sorting on the permission status column
|
||||
// Test sorting on the cookies column
|
||||
cookiesCol.click();
|
||||
assertSortByCookies("ascending");
|
||||
cookiesCol.click();
|
||||
assertSortByCookies("descending");
|
||||
|
||||
// Test sorting on the cookies column
|
||||
statusCol.click();
|
||||
assertSortByStatus("ascending");
|
||||
statusCol.click();
|
||||
assertSortByStatus("descending");
|
||||
|
||||
await mockSiteDataManager.unregister();
|
||||
await BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
|
||||
@ -193,27 +183,6 @@ add_task(async function() {
|
||||
}
|
||||
}
|
||||
|
||||
function assertSortByStatus(order) {
|
||||
let siteItems = sitesList.getElementsByTagName("richlistitem");
|
||||
for (let i = 0; i < siteItems.length - 1; ++i) {
|
||||
let aHost = siteItems[i].getAttribute("host");
|
||||
let bHost = siteItems[i + 1].getAttribute("host");
|
||||
let a = findSiteByHost(aHost);
|
||||
let b = findSiteByHost(bHost);
|
||||
let result = 0;
|
||||
if (a.persisted && !b.persisted) {
|
||||
result = 1;
|
||||
} else if (!a.persisted && b.persisted) {
|
||||
result = -1;
|
||||
}
|
||||
if (order == "ascending") {
|
||||
Assert.lessOrEqual(result, 0, "Should sort sites in the ascending order by permission status");
|
||||
} else {
|
||||
Assert.greaterOrEqual(result, 0, "Should sort sites in the descending order by permission status");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function assertSortByUsage(order) {
|
||||
let siteItems = sitesList.getElementsByTagName("richlistitem");
|
||||
for (let i = 0; i < siteItems.length - 1; ++i) {
|
||||
|
@ -18,7 +18,6 @@ let gSiteDataSettings = {
|
||||
// - uri: uri of site; instance of nsIURI
|
||||
// - baseDomain: base domain of the site
|
||||
// - cookies: array of cookies of that site
|
||||
// - status: persistent-storage permission status
|
||||
// - usage: disk usage which site uses
|
||||
// - userAction: "remove" or "update-permission"; the action user wants to take.
|
||||
_sites: null,
|
||||
@ -50,21 +49,17 @@ let gSiteDataSettings = {
|
||||
// Add "Host" column.
|
||||
addColumnItem(site.host, "4");
|
||||
|
||||
// Add "Status" column
|
||||
addColumnItem(site.persisted ?
|
||||
this._prefStrBundle.getString("persistent") : null, "2");
|
||||
|
||||
// Add "Cookies" column.
|
||||
addColumnItem(site.cookies.length, "1");
|
||||
|
||||
// Add "Storage" column
|
||||
if (site.usage > 0) {
|
||||
if (site.usage > 0 || site.persisted) {
|
||||
let size = DownloadUtils.convertByteUnits(site.usage);
|
||||
let str = this._prefStrBundle.getFormattedString("siteUsage", size);
|
||||
addColumnItem(str, "1");
|
||||
let strName = site.persisted ? "siteUsagePersistent" : "siteUsage";
|
||||
addColumnItem(this._prefStrBundle.getFormattedString(strName, size), "2");
|
||||
} else {
|
||||
// Pass null to avoid showing "0KB" when there is no site data stored.
|
||||
addColumnItem(null, "1");
|
||||
addColumnItem(null, "2");
|
||||
}
|
||||
|
||||
// Add "Last Used" column.
|
||||
@ -105,7 +100,6 @@ let gSiteDataSettings = {
|
||||
setEventListener("usageCol", "click", this.onClickTreeCol);
|
||||
setEventListener("lastAccessedCol", "click", this.onClickTreeCol);
|
||||
setEventListener("cookiesCol", "click", this.onClickTreeCol);
|
||||
setEventListener("statusCol", "click", this.onClickTreeCol);
|
||||
setEventListener("cancel", "command", this.close);
|
||||
setEventListener("save", "command", this.saveChanges);
|
||||
setEventListener("searchBox", "command", this.onCommandSearch);
|
||||
@ -152,17 +146,6 @@ let gSiteDataSettings = {
|
||||
};
|
||||
break;
|
||||
|
||||
case "statusCol":
|
||||
sortFunc = (a, b) => {
|
||||
if (a.persisted && !b.persisted) {
|
||||
return 1;
|
||||
} else if (!a.persisted && b.persisted) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
break;
|
||||
|
||||
case "cookiesCol":
|
||||
sortFunc = (a, b) => a.cookies.length - b.cookies.length;
|
||||
break;
|
||||
|
@ -38,10 +38,9 @@
|
||||
<richlistbox id="sitesList" orient="vertical" flex="1">
|
||||
<listheader>
|
||||
<treecol flex="4" width="50" label="&hostCol.label;" id="hostCol"/>
|
||||
<treecol flex="2" width="50" label="&statusCol.label;" id="statusCol"/>
|
||||
<treecol flex="1" width="50" label="&cookiesCol.label;" id="cookiesCol"/>
|
||||
<!-- Sorted by usage so the user can quickly see which sites use the most data. -->
|
||||
<treecol flex="1" width="50" label="&usageCol.label;" id="usageCol" data-isCurrentSortCol="true"/>
|
||||
<treecol flex="2" width="50" label="&usageCol.label;" id="usageCol" data-isCurrentSortCol="true"/>
|
||||
<treecol flex="2" width="50" label="&lastAccessedCol.label;" id="lastAccessedCol" />
|
||||
</listheader>
|
||||
</richlistbox>
|
||||
|
@ -3,9 +3,9 @@
|
||||
module.exports = {
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "all",
|
||||
"varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
|
||||
"args": "none"
|
||||
"varsIgnorePattern": "^EXPORTED_SYMBOLS$",
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
@ -44,7 +44,9 @@ module.exports = {
|
||||
"no-unused-expressions": "error",
|
||||
|
||||
// No declaring variables that are never used
|
||||
"no-unused-vars": ["error", {"args": "none", "varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$"}],
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none", "vars": "all", "varsIgnorePattern": "^EXPORTED_SYMBOLS$"
|
||||
}],
|
||||
|
||||
// No using variables before defined
|
||||
"no-use-before-define": "error",
|
||||
|
@ -166,14 +166,16 @@ removeSelectedCookies.accesskey=R
|
||||
|
||||
defaultUserContextLabel=None
|
||||
|
||||
#LOCALIZATION NOTE: The next string is for the total usage of site data.
|
||||
# e.g., "The total usage is currently using 200 MB"
|
||||
# LOCALIZATION NOTE (totalSiteDataSize1, siteUsage, siteUsagePersistent):
|
||||
# This is the total usage of site data, where we insert storage size and unit.
|
||||
# e.g., "The total usage is currently 200 MB"
|
||||
# %1$S = size
|
||||
# %2$S = unit (MB, KB, etc.)
|
||||
totalSiteDataSize1=Your stored site data and cache are currently using %1$S %2$S of disk space
|
||||
loadingSiteDataSize1=Calculating site data and cache size…
|
||||
persistent=Persistent
|
||||
siteUsage=%1$S %2$S
|
||||
siteUsagePersistent=%1$S %2$S (Persistent)
|
||||
loadingSiteDataSize1=Calculating site data and cache size…
|
||||
|
||||
acceptRemove=Remove
|
||||
# LOCALIZATION NOTE (siteDataSettings2.description): %S = brandShortName
|
||||
siteDataSettings2.description=The following websites store site data on your computer. %S keeps data from websites with persistent storage until you delete it, and deletes data from websites with non-persistent storage as space is needed.
|
||||
@ -194,12 +196,12 @@ spaceAlert.over5GB.prefButton.accesskey=O
|
||||
# LOCALIZATION NOTE (spaceAlert.over5GB.prefButtonWin.label): On Windows Preferences is called Options
|
||||
spaceAlert.over5GB.prefButtonWin.label=Open Options
|
||||
spaceAlert.over5GB.prefButtonWin.accesskey=O
|
||||
# LOCALIZATION NOTE (spaceAlert.over5GB.message): %S = brandShortName
|
||||
spaceAlert.over5GB.message=%S is running out of disk space. Website contents may not display properly. You can clear stored site data in Preferences > Advanced > Site Data.
|
||||
# LOCALIZATION NOTE (spaceAlert.over5GB.messageWin):
|
||||
# LOCALIZATION NOTE (spaceAlert.over5GB.message1): %S = brandShortName
|
||||
spaceAlert.over5GB.message1=%S is running out of disk space. Website contents may not display properly. You can clear stored data in Preferences > Privacy & Security > Cookies and Site Data.
|
||||
# LOCALIZATION NOTE (spaceAlert.over5GB.messageWin1):
|
||||
# - On Windows Preferences is called Options
|
||||
# - %S = brandShortName
|
||||
spaceAlert.over5GB.messageWin=%S is running out of disk space. Website contents may not display properly. You can clear stored site data in Options > Advanced > Site Data.
|
||||
spaceAlert.over5GB.messageWin1=%S is running out of disk space. Website contents may not display properly. You can clear stored data in Options > Privacy & Security > Cookies and Site Data.
|
||||
spaceAlert.under5GB.okButton.label=OK, Got it
|
||||
spaceAlert.under5GB.okButton.accesskey=K
|
||||
# LOCALIZATION NOTE (spaceAlert.under5GB.message): %S = brandShortName
|
||||
|
@ -70,6 +70,7 @@ nb-NO
|
||||
ne-NP
|
||||
nl
|
||||
nn-NO
|
||||
oc
|
||||
or
|
||||
pa-IN
|
||||
pl
|
||||
|
@ -7,9 +7,9 @@ module.exports = {
|
||||
|
||||
"rules": {
|
||||
"no-unused-vars": ["error", {
|
||||
"args": "none",
|
||||
"vars": "all",
|
||||
"varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$",
|
||||
"args": "none"
|
||||
"varsIgnorePattern": "^EXPORTED_SYMBOLS$",
|
||||
}]
|
||||
}
|
||||
};
|
||||
|
@ -215,7 +215,7 @@ module.exports = {
|
||||
"no-undefined": "off",
|
||||
// Disallow global and local variables that aren't used, but allow unused
|
||||
// function arguments.
|
||||
"no-unused-vars": ["error", {"vars": "all", "args": "none"}],
|
||||
"no-unused-vars": ["error", {"args": "none", "vars": "all"}],
|
||||
// Allow using variables before they are defined.
|
||||
"no-use-before-define": "off",
|
||||
// We use var-only-at-top-level instead of no-var as we allow top level
|
||||
|
@ -52,12 +52,14 @@ class MainToolbar extends Component {
|
||||
return (
|
||||
Toolbar({},
|
||||
ToolbarButton({
|
||||
key: "refresh",
|
||||
className: "refresh devtools-button",
|
||||
id: "dom-refresh-button",
|
||||
title: l10n.getStr("dom.refresh"),
|
||||
onClick: this.onRefresh
|
||||
}),
|
||||
SearchBox({
|
||||
key: "filter",
|
||||
delay: 250,
|
||||
onChange: this.onSearch,
|
||||
placeholder: l10n.getStr("dom.filterDOMPanel"),
|
||||
|
@ -102,19 +102,18 @@ class ToolboxController extends Component {
|
||||
}
|
||||
|
||||
setCurrentToolId(currentToolId) {
|
||||
this.setState({currentToolId});
|
||||
// Also set the currently focused button to this tool.
|
||||
this.setFocusedButton(currentToolId);
|
||||
this.setState({currentToolId}, () => {
|
||||
// Also set the currently focused button to this tool.
|
||||
this.setFocusedButton(currentToolId);
|
||||
});
|
||||
}
|
||||
|
||||
setCanRender() {
|
||||
this.setState({ canRender: true });
|
||||
this.updateButtonIds();
|
||||
this.setState({ canRender: true }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
setOptionsPanel(optionsPanel) {
|
||||
this.setState({ optionsPanel });
|
||||
this.updateButtonIds();
|
||||
this.setState({ optionsPanel }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
highlightTool(highlightedTool) {
|
||||
@ -132,23 +131,19 @@ class ToolboxController extends Component {
|
||||
}
|
||||
|
||||
setDockButtonsEnabled(areDockButtonsEnabled) {
|
||||
this.setState({ areDockButtonsEnabled });
|
||||
this.updateButtonIds();
|
||||
this.setState({ areDockButtonsEnabled }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
setHostTypes(hostTypes) {
|
||||
this.setState({ hostTypes });
|
||||
this.updateButtonIds();
|
||||
this.setState({ hostTypes }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
setCanCloseToolbox(canCloseToolbox) {
|
||||
this.setState({ canCloseToolbox });
|
||||
this.updateButtonIds();
|
||||
this.setState({ canCloseToolbox }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
setPanelDefinitions(panelDefinitions) {
|
||||
this.setState({ panelDefinitions });
|
||||
this.updateButtonIds();
|
||||
this.setState({ panelDefinitions }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
get panelDefinitions() {
|
||||
@ -164,8 +159,7 @@ class ToolboxController extends Component {
|
||||
button.on("updatechecked", this.state.checkedButtonsUpdated);
|
||||
});
|
||||
|
||||
this.setState({ toolboxButtons });
|
||||
this.updateButtonIds();
|
||||
this.setState({ toolboxButtons }, this.updateButtonIds);
|
||||
}
|
||||
|
||||
setCanMinimize(canMinimize) {
|
||||
|
@ -94,6 +94,7 @@ class ToolboxTabs extends Component {
|
||||
} = this.props;
|
||||
|
||||
let tabs = panelDefinitions.map(panelDefinition => ToolboxTab({
|
||||
key: panelDefinition.id,
|
||||
currentToolId,
|
||||
focusButton,
|
||||
focusedButton,
|
||||
|
@ -230,7 +230,6 @@ function renderDockButtons(props) {
|
||||
title: L10N.getStr("toolbox.closebutton.tooltip"),
|
||||
onClick: () => {
|
||||
closeToolbox();
|
||||
focusButton(closeButtonId);
|
||||
},
|
||||
tabIndex: focusedButton === "toolbox-close" ? "0" : "-1",
|
||||
})
|
||||
|
@ -63,10 +63,11 @@ class BoxModelProperties extends PureComponent {
|
||||
return {};
|
||||
}
|
||||
|
||||
onToggleExpander() {
|
||||
onToggleExpander(event) {
|
||||
this.setState({
|
||||
isOpen: !this.state.isOpen,
|
||||
});
|
||||
event.stopPropagation();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
@ -38,6 +38,11 @@ class FontInspector {
|
||||
this.init();
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.store.dispatch(updatePreviewText(""));
|
||||
this.update(false, "");
|
||||
}
|
||||
|
||||
init() {
|
||||
if (!this.inspector) {
|
||||
return;
|
||||
@ -62,9 +67,6 @@ class FontInspector {
|
||||
|
||||
// Listen for theme changes as the color of the previews depend on the theme
|
||||
gDevTools.on("theme-switched", this.onThemeChanged);
|
||||
|
||||
this.store.dispatch(updatePreviewText(""));
|
||||
this.update(false, "");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -94,7 +94,6 @@ class SnapshotListItem extends Component {
|
||||
let deleteButton = !snapshot.path ? void 0 : dom.div({
|
||||
onClick: () => onDelete(snapshot),
|
||||
className: "delete",
|
||||
"aria-role": "button",
|
||||
title: L10N.getStr("snapshot.io.delete")
|
||||
});
|
||||
|
||||
|
@ -205,7 +205,6 @@ class Toolbar extends Component {
|
||||
{
|
||||
id: "select-view",
|
||||
onChange: e => onViewChange(e.target.value),
|
||||
defaultValue: view,
|
||||
value: view.state,
|
||||
},
|
||||
dom.option(
|
||||
|
@ -41,7 +41,7 @@ class MonitorPanel extends Component {
|
||||
networkDetailsOpen: PropTypes.bool.isRequired,
|
||||
openNetworkDetails: PropTypes.func.isRequired,
|
||||
request: PropTypes.object,
|
||||
selectedRequestVisible: PropTypes.func.isRequired,
|
||||
selectedRequestVisible: PropTypes.bool.isRequired,
|
||||
sourceMapService: PropTypes.object,
|
||||
openLink: PropTypes.func,
|
||||
updateRequest: PropTypes.func.isRequired,
|
||||
@ -113,8 +113,8 @@ class MonitorPanel extends Component {
|
||||
Toolbar({ connector }),
|
||||
SplitBox({
|
||||
className: "devtools-responsive-container",
|
||||
initialWidth: `${initialWidth}px`,
|
||||
initialHeight: `${initialHeight}px`,
|
||||
initialWidth: initialWidth,
|
||||
initialHeight: initialHeight,
|
||||
minSize: "50px",
|
||||
maxSize: "80%",
|
||||
splitterSize: 1,
|
||||
|
@ -63,7 +63,7 @@ class RequestListContent extends Component {
|
||||
scale: PropTypes.number,
|
||||
selectedRequest: PropTypes.object,
|
||||
sortedRequests: PropTypes.array.isRequired,
|
||||
requestFilterTypes: PropTypes.string.isRequired,
|
||||
requestFilterTypes: PropTypes.object.isRequired,
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ class RequestListItem extends Component {
|
||||
onMouseDown: PropTypes.func.isRequired,
|
||||
onSecurityIconMouseDown: PropTypes.func.isRequired,
|
||||
onWaterfallMouseDown: PropTypes.func.isRequired,
|
||||
requestFilterTypes: PropTypes.string.isRequired,
|
||||
requestFilterTypes: PropTypes.object.isRequired,
|
||||
waterfallWidth: PropTypes.number,
|
||||
};
|
||||
}
|
||||
|
@ -33,6 +33,7 @@ function WaterfallHeader(props) {
|
||||
let label = L10N.getFormatStr("timeline.tick", time);
|
||||
|
||||
let node = dom.div({
|
||||
key: x,
|
||||
className: "plain waterfall-header-tick",
|
||||
style: { transform: `translateX(${left}px)` }
|
||||
}, label);
|
||||
|
@ -25,7 +25,7 @@ class Frame extends Component {
|
||||
column: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
|
||||
}).isRequired,
|
||||
// Clicking on the frame link -- probably should link to the debugger.
|
||||
onClick: PropTypes.func.isRequired,
|
||||
onClick: PropTypes.func,
|
||||
// Option to display a function name before the source link.
|
||||
showFunctionName: PropTypes.bool,
|
||||
// Option to display a function name even if it's anonymous.
|
||||
|
@ -22,15 +22,27 @@ class SplitBox extends Component {
|
||||
// Initial size of controlled panel.
|
||||
initialSize: PropTypes.string,
|
||||
// Initial width of controlled panel.
|
||||
initialWidth: PropTypes.string,
|
||||
initialWidth: PropTypes.oneOfType([
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]),
|
||||
// Initial height of controlled panel.
|
||||
initialHeight: PropTypes.string,
|
||||
initialHeight: PropTypes.oneOfType([
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]),
|
||||
// Left/top panel
|
||||
startPanel: PropTypes.any,
|
||||
// Min panel size.
|
||||
minSize: PropTypes.string,
|
||||
minSize: PropTypes.oneOfType([
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]),
|
||||
// Max panel size.
|
||||
maxSize: PropTypes.string,
|
||||
maxSize: PropTypes.oneOfType([
|
||||
PropTypes.number,
|
||||
PropTypes.string
|
||||
]),
|
||||
// Right/bottom panel
|
||||
endPanel: PropTypes.any,
|
||||
// True if the right/bottom panel should be controlled.
|
||||
|
@ -11,9 +11,6 @@ const TEST_URI = "data:text/html;charset=utf-8,<head>" +
|
||||
"ets.css'></head><body><div></div><span></span></body>";
|
||||
const {TreeWidget} = require("devtools/client/shared/widgets/TreeWidget");
|
||||
|
||||
const kStrictKeyPressEvents = SpecialPowers.getBoolPref(
|
||||
"dom.keyboardevent.keypress.dispatch_non_printable_keys_only_system_group_in_content");
|
||||
|
||||
add_task(async function () {
|
||||
await addTab("about:blank");
|
||||
let [host, win, doc] = await createHost("bottom", TEST_URI);
|
||||
@ -146,8 +143,7 @@ async function testKeyboardInteraction(tree, win) {
|
||||
|
||||
// pressing left to check expand collapse feature.
|
||||
// This does not emit any event, so listening for keypress
|
||||
const eventToListen = kStrictKeyPressEvents ? "keydown" : "keypress";
|
||||
tree.root.children.addEventListener(eventToListen, () => {
|
||||
tree.root.children.addEventListener("keydown", () => {
|
||||
// executeSoon so that other listeners on the same method are executed first
|
||||
executeSoon(() => event.resolve(null));
|
||||
}, {once: true});
|
||||
@ -189,7 +185,7 @@ async function testKeyboardInteraction(tree, win) {
|
||||
|
||||
// collapsing the item to check expand feature.
|
||||
|
||||
tree.root.children.addEventListener(eventToListen, () => {
|
||||
tree.root.children.addEventListener("keydown", () => {
|
||||
executeSoon(() => event.resolve(null));
|
||||
}, {once: true});
|
||||
info("Pressing left key to collapse the item");
|
||||
@ -202,7 +198,7 @@ async function testKeyboardInteraction(tree, win) {
|
||||
|
||||
// pressing right should expand this now.
|
||||
|
||||
tree.root.children.addEventListener(eventToListen, () => {
|
||||
tree.root.children.addEventListener("keydown", () => {
|
||||
executeSoon(() => event.resolve(null));
|
||||
}, {once: true});
|
||||
info("Pressing right key to expend the collapsed item");
|
||||
@ -219,7 +215,7 @@ async function testKeyboardInteraction(tree, win) {
|
||||
node = tree._selectedLabel;
|
||||
// pressing down again should not change selection
|
||||
event = defer();
|
||||
tree.root.children.addEventListener(eventToListen, () => {
|
||||
tree.root.children.addEventListener("keydown", () => {
|
||||
executeSoon(() => event.resolve(null));
|
||||
}, {once: true});
|
||||
info("Pressing down key on last item of the tree");
|
||||
|
@ -9,13 +9,14 @@
|
||||
```bash
|
||||
git clone https://github.com/reactjs/react-redux
|
||||
cd react-redux
|
||||
git checkout v5.0.6 # checkout the right version tag
|
||||
git checkout v5.0.7 # checkout the right version tag
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run build:umd
|
||||
cp dist/react-redux.js <gecko-dev>/devtools/client/shared/vendor/react-redux.js
|
||||
```
|
||||
|
||||
@ -27,8 +28,8 @@ We no longer need the react-redux repo so feel free to delete it.
|
||||
- Add the version number to the top of the file:
|
||||
```
|
||||
/**
|
||||
* react-redux v5.0.6
|
||||
*/
|
||||
* react-redux v5.0.7
|
||||
*/
|
||||
```
|
||||
- Replace all instances of `'react'` with `'devtools/client/shared/vendor/react'` (including the quotes).
|
||||
- Replace all instances of `'redux'` with `'devtools/client/shared/vendor/redux'` (including the quotes).
|
||||
|
12
devtools/client/shared/vendor/REDUX_UPGRADING
vendored
12
devtools/client/shared/vendor/REDUX_UPGRADING
vendored
@ -1,12 +0,0 @@
|
||||
/* 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/. */
|
||||
|
||||
Current version of redux: 3.6.0 (last upgrade in bug 1326137)
|
||||
|
||||
How to upgrade:
|
||||
1. git clone https://github.com/reactjs/redux - clone the repo
|
||||
2. git checkout v3.6.0 - checkout the right version tag
|
||||
3. npm install - compile the sources to a JS module file
|
||||
4. cp dist/redux.js devtools/client/shared/vendor - copy the unminified JS file
|
||||
5. update the current version in this file
|
31
devtools/client/shared/vendor/REDUX_UPGRADING.md
vendored
Normal file
31
devtools/client/shared/vendor/REDUX_UPGRADING.md
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
[//]: # (
|
||||
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/.
|
||||
)
|
||||
|
||||
# Upgrading redux
|
||||
|
||||
## Getting the Source
|
||||
|
||||
```bash
|
||||
git clone https://github.com/reactjs/redux
|
||||
cd redux
|
||||
git checkout v3.7.2 # checkout the right version tag
|
||||
```
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
npm install
|
||||
npm run build:umd
|
||||
cp dist/redux.js <gecko-dev>/devtools/client/shared/vendor/redux.js
|
||||
```
|
||||
|
||||
## Patching react-redux
|
||||
|
||||
- open `redux.js`
|
||||
- Add the version number to the top of the file:
|
||||
```
|
||||
/**
|
||||
* react-redux v3.7.2
|
||||
*/
|
||||
```
|
344
devtools/client/shared/vendor/react-redux.js
vendored
344
devtools/client/shared/vendor/react-redux.js
vendored
@ -1,23 +1,24 @@
|
||||
/**
|
||||
* react-redux v5.0.6
|
||||
*/
|
||||
/**
|
||||
* react-redux v5.0.7
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('devtools/client/shared/vendor/react'), require('devtools/client/shared/vendor/redux')) :
|
||||
typeof define === 'function' && define.amd ? define(['exports', 'devtools/client/shared/vendor/react', 'devtools/client/shared/vendor/redux'], factory) :
|
||||
(factory((global.ReactRedux = global.ReactRedux || {}),global.React,global.Redux));
|
||||
(factory((global.ReactRedux = {}),global.React,global.Redux));
|
||||
}(this, (function (exports,react,redux) { 'use strict';
|
||||
|
||||
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
||||
|
||||
function createCommonjsModule(fn, module) {
|
||||
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ -50,11 +51,9 @@ var emptyFunction_1 = emptyFunction;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
@ -153,13 +152,100 @@ var warning = emptyFunction_1;
|
||||
|
||||
var warning_1 = warning;
|
||||
|
||||
/*
|
||||
object-assign
|
||||
(c) Sindre Sorhus
|
||||
@license MIT
|
||||
*/
|
||||
/* eslint-disable no-unused-vars */
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
|
||||
function toObject(val) {
|
||||
if (val === null || val === undefined) {
|
||||
throw new TypeError('Object.assign cannot be called with null or undefined');
|
||||
}
|
||||
|
||||
return Object(val);
|
||||
}
|
||||
|
||||
function shouldUseNative() {
|
||||
try {
|
||||
if (!Object.assign) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Detect buggy property enumeration order in older V8 versions.
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
||||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
||||
test1[5] = 'de';
|
||||
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test2 = {};
|
||||
for (var i = 0; i < 10; i++) {
|
||||
test2['_' + String.fromCharCode(i)] = i;
|
||||
}
|
||||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
||||
return test2[n];
|
||||
});
|
||||
if (order2.join('') !== '0123456789') {
|
||||
return false;
|
||||
}
|
||||
|
||||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
||||
var test3 = {};
|
||||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
||||
test3[letter] = letter;
|
||||
});
|
||||
if (Object.keys(Object.assign({}, test3)).join('') !==
|
||||
'abcdefghijklmnopqrst') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (err) {
|
||||
// We don't expect any of the above to throw, but better to be safe.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
||||
var from;
|
||||
var to = toObject(target);
|
||||
var symbols;
|
||||
|
||||
for (var s = 1; s < arguments.length; s++) {
|
||||
from = Object(arguments[s]);
|
||||
|
||||
for (var key in from) {
|
||||
if (hasOwnProperty.call(from, key)) {
|
||||
to[key] = from[key];
|
||||
}
|
||||
}
|
||||
|
||||
if (getOwnPropertySymbols) {
|
||||
symbols = getOwnPropertySymbols(from);
|
||||
for (var i = 0; i < symbols.length; i++) {
|
||||
if (propIsEnumerable.call(from, symbols[i])) {
|
||||
to[symbols[i]] = from[symbols[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return to;
|
||||
};
|
||||
|
||||
/**
|
||||
* Copyright 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
||||
@ -195,7 +281,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
||||
try {
|
||||
// This is intentionally an invariant that gets caught. It's the same
|
||||
// behavior as without this statement except with a better message.
|
||||
invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'React.PropTypes.', componentName || 'React class', location, typeSpecName);
|
||||
invariant$1(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);
|
||||
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
||||
} catch (ex) {
|
||||
error = ex;
|
||||
@ -311,7 +397,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
||||
objectOf: createObjectOfTypeChecker,
|
||||
oneOf: createEnumTypeChecker,
|
||||
oneOfType: createUnionTypeChecker,
|
||||
shape: createShapeTypeChecker
|
||||
shape: createShapeTypeChecker,
|
||||
exact: createStrictShapeTypeChecker,
|
||||
};
|
||||
|
||||
/**
|
||||
@ -526,7 +613,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
||||
if (typeof checker !== 'function') {
|
||||
warning_1(
|
||||
false,
|
||||
'Invalid argument supplid to oneOfType. Expected an array of check functions, but ' +
|
||||
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
||||
'received %s at index %s.',
|
||||
getPostfixForTypeWarning(checker),
|
||||
i
|
||||
@ -580,6 +667,36 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
||||
return createChainableTypeChecker(validate);
|
||||
}
|
||||
|
||||
function createStrictShapeTypeChecker(shapeTypes) {
|
||||
function validate(props, propName, componentName, location, propFullName) {
|
||||
var propValue = props[propName];
|
||||
var propType = getPropType(propValue);
|
||||
if (propType !== 'object') {
|
||||
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
||||
}
|
||||
// We need to check all keys in case some are required but missing from
|
||||
// props.
|
||||
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
||||
for (var key in allKeys) {
|
||||
var checker = shapeTypes[key];
|
||||
if (!checker) {
|
||||
return new PropTypeError(
|
||||
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
||||
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
||||
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
||||
);
|
||||
}
|
||||
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return createChainableTypeChecker(validate);
|
||||
}
|
||||
|
||||
function isNode(propValue) {
|
||||
switch (typeof propValue) {
|
||||
case 'number':
|
||||
@ -712,14 +829,12 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
||||
return ReactPropTypes;
|
||||
};
|
||||
|
||||
var index = createCommonjsModule(function (module) {
|
||||
var propTypes = createCommonjsModule(function (module) {
|
||||
/**
|
||||
* Copyright 2013-present, Facebook, Inc.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the BSD-style license found in the
|
||||
* LICENSE file in the root directory of this source tree. An additional grant
|
||||
* of patent rights can be found in the PATENTS file in the same directory.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
{
|
||||
@ -741,17 +856,17 @@ var index = createCommonjsModule(function (module) {
|
||||
}
|
||||
});
|
||||
|
||||
var subscriptionShape = index.shape({
|
||||
trySubscribe: index.func.isRequired,
|
||||
tryUnsubscribe: index.func.isRequired,
|
||||
notifyNestedSubs: index.func.isRequired,
|
||||
isSubscribed: index.func.isRequired
|
||||
var subscriptionShape = propTypes.shape({
|
||||
trySubscribe: propTypes.func.isRequired,
|
||||
tryUnsubscribe: propTypes.func.isRequired,
|
||||
notifyNestedSubs: propTypes.func.isRequired,
|
||||
isSubscribed: propTypes.func.isRequired
|
||||
});
|
||||
|
||||
var storeShape = index.shape({
|
||||
subscribe: index.func.isRequired,
|
||||
dispatch: index.func.isRequired,
|
||||
getState: index.func.isRequired
|
||||
var storeShape = propTypes.shape({
|
||||
subscribe: propTypes.func.isRequired,
|
||||
dispatch: propTypes.func.isRequired,
|
||||
getState: propTypes.func.isRequired
|
||||
});
|
||||
|
||||
/**
|
||||
@ -782,14 +897,6 @@ var classCallCheck = function (instance, Constructor) {
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var _extends = Object.assign || function (target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i];
|
||||
@ -804,8 +911,6 @@ var _extends = Object.assign || function (target) {
|
||||
return target;
|
||||
};
|
||||
|
||||
|
||||
|
||||
var inherits = function (subClass, superClass) {
|
||||
if (typeof superClass !== "function" && superClass !== null) {
|
||||
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass);
|
||||
@ -822,14 +927,6 @@ var inherits = function (subClass, superClass) {
|
||||
if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var objectWithoutProperties = function (obj, keys) {
|
||||
var target = {};
|
||||
|
||||
@ -903,7 +1000,7 @@ function createProvider() {
|
||||
|
||||
Provider.propTypes = {
|
||||
store: storeShape.isRequired,
|
||||
children: index.element.isRequired
|
||||
children: propTypes.element.isRequired
|
||||
};
|
||||
Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = storeShape.isRequired, _Provider$childContex[subscriptionKey] = subscriptionShape, _Provider$childContex);
|
||||
|
||||
@ -912,70 +1009,77 @@ function createProvider() {
|
||||
|
||||
var Provider = createProvider();
|
||||
|
||||
var hoistNonReactStatics = createCommonjsModule(function (module, exports) {
|
||||
/**
|
||||
* Copyright 2015, Yahoo! Inc.
|
||||
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
var REACT_STATICS = {
|
||||
childContextTypes: true,
|
||||
contextTypes: true,
|
||||
defaultProps: true,
|
||||
displayName: true,
|
||||
getDefaultProps: true,
|
||||
mixins: true,
|
||||
propTypes: true,
|
||||
type: true
|
||||
};
|
||||
(function (global, factory) {
|
||||
module.exports = factory();
|
||||
}(commonjsGlobal, (function () {
|
||||
|
||||
var KNOWN_STATICS = {
|
||||
name: true,
|
||||
length: true,
|
||||
prototype: true,
|
||||
caller: true,
|
||||
callee: true,
|
||||
arguments: true,
|
||||
arity: true
|
||||
};
|
||||
var REACT_STATICS = {
|
||||
childContextTypes: true,
|
||||
contextTypes: true,
|
||||
defaultProps: true,
|
||||
displayName: true,
|
||||
getDefaultProps: true,
|
||||
getDerivedStateFromProps: true,
|
||||
mixins: true,
|
||||
propTypes: true,
|
||||
type: true
|
||||
};
|
||||
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
||||
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
||||
var KNOWN_STATICS = {
|
||||
name: true,
|
||||
length: true,
|
||||
prototype: true,
|
||||
caller: true,
|
||||
callee: true,
|
||||
arguments: true,
|
||||
arity: true
|
||||
};
|
||||
|
||||
var index$1 = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
||||
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
||||
var defineProperty = Object.defineProperty;
|
||||
var getOwnPropertyNames = Object.getOwnPropertyNames;
|
||||
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
||||
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
||||
var getPrototypeOf = Object.getPrototypeOf;
|
||||
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
|
||||
|
||||
if (objectPrototype) {
|
||||
var inheritedComponent = getPrototypeOf(sourceComponent);
|
||||
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
||||
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
||||
return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
|
||||
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
|
||||
|
||||
if (objectPrototype) {
|
||||
var inheritedComponent = getPrototypeOf(sourceComponent);
|
||||
if (inheritedComponent && inheritedComponent !== objectPrototype) {
|
||||
hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var keys = getOwnPropertyNames(sourceComponent);
|
||||
var keys = getOwnPropertyNames(sourceComponent);
|
||||
|
||||
if (getOwnPropertySymbols) {
|
||||
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
||||
}
|
||||
if (getOwnPropertySymbols) {
|
||||
keys = keys.concat(getOwnPropertySymbols(sourceComponent));
|
||||
}
|
||||
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var key = keys[i];
|
||||
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
||||
// Only hoist enumerables and non-enumerable functions
|
||||
if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var key = keys[i];
|
||||
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
|
||||
var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
|
||||
try { // Avoid failures from read-only properties
|
||||
targetComponent[key] = sourceComponent[key];
|
||||
defineProperty(targetComponent, key, descriptor);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
return targetComponent;
|
||||
}
|
||||
|
||||
return targetComponent;
|
||||
}
|
||||
|
||||
return targetComponent;
|
||||
};
|
||||
};
|
||||
})));
|
||||
});
|
||||
|
||||
/**
|
||||
* Copyright 2013-2015, Facebook, Inc.
|
||||
@ -1184,7 +1288,7 @@ selectorFactory) {
|
||||
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes);
|
||||
|
||||
return function wrapWithConnect(WrappedComponent) {
|
||||
invariant_1$2(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + ('connect. Instead received ' + JSON.stringify(WrappedComponent)));
|
||||
invariant_1$2(typeof WrappedComponent == 'function', 'You must pass a component to the function returned by ' + (methodName + '. Instead received ' + JSON.stringify(WrappedComponent)));
|
||||
|
||||
var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
||||
|
||||
@ -1387,7 +1491,7 @@ selectorFactory) {
|
||||
};
|
||||
}
|
||||
|
||||
return index$1(Connect, WrappedComponent);
|
||||
return hoistNonReactStatics(Connect, WrappedComponent);
|
||||
};
|
||||
}
|
||||
|
||||
@ -1435,20 +1539,20 @@ var root = freeGlobal || freeSelf || Function('return this')();
|
||||
var Symbol$1 = root.Symbol;
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto$1 = Object.prototype;
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty$2 = objectProto$1.hasOwnProperty;
|
||||
var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var nativeObjectToString = objectProto$1.toString;
|
||||
var nativeObjectToString = objectProto.toString;
|
||||
|
||||
/** Built-in value references. */
|
||||
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
||||
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
||||
|
||||
/**
|
||||
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
||||
@ -1458,34 +1562,34 @@ var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
||||
* @returns {string} Returns the raw `toStringTag`.
|
||||
*/
|
||||
function getRawTag(value) {
|
||||
var isOwn = hasOwnProperty$2.call(value, symToStringTag$1),
|
||||
tag = value[symToStringTag$1];
|
||||
var isOwn = hasOwnProperty$1.call(value, symToStringTag),
|
||||
tag = value[symToStringTag];
|
||||
|
||||
try {
|
||||
value[symToStringTag$1] = undefined;
|
||||
value[symToStringTag] = undefined;
|
||||
var unmasked = true;
|
||||
} catch (e) {}
|
||||
|
||||
var result = nativeObjectToString.call(value);
|
||||
if (unmasked) {
|
||||
if (isOwn) {
|
||||
value[symToStringTag$1] = tag;
|
||||
value[symToStringTag] = tag;
|
||||
} else {
|
||||
delete value[symToStringTag$1];
|
||||
delete value[symToStringTag];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto$2 = Object.prototype;
|
||||
var objectProto$1 = Object.prototype;
|
||||
|
||||
/**
|
||||
* Used to resolve the
|
||||
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
||||
* of values.
|
||||
*/
|
||||
var nativeObjectToString$1 = objectProto$2.toString;
|
||||
var nativeObjectToString$1 = objectProto$1.toString;
|
||||
|
||||
/**
|
||||
* Converts `value` to a string using `Object.prototype.toString`.
|
||||
@ -1499,11 +1603,11 @@ function objectToString(value) {
|
||||
}
|
||||
|
||||
/** `Object#toString` result references. */
|
||||
var nullTag = '[object Null]';
|
||||
var undefinedTag = '[object Undefined]';
|
||||
var nullTag = '[object Null]',
|
||||
undefinedTag = '[object Undefined]';
|
||||
|
||||
/** Built-in value references. */
|
||||
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
||||
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
||||
|
||||
/**
|
||||
* The base implementation of `getTag` without fallbacks for buggy environments.
|
||||
@ -1516,7 +1620,7 @@ function baseGetTag(value) {
|
||||
if (value == null) {
|
||||
return value === undefined ? undefinedTag : nullTag;
|
||||
}
|
||||
return (symToStringTag && symToStringTag in Object(value))
|
||||
return (symToStringTag$1 && symToStringTag$1 in Object(value))
|
||||
? getRawTag(value)
|
||||
: objectToString(value);
|
||||
}
|
||||
@ -1570,14 +1674,14 @@ function isObjectLike(value) {
|
||||
var objectTag = '[object Object]';
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var funcProto = Function.prototype;
|
||||
var objectProto = Object.prototype;
|
||||
var funcProto = Function.prototype,
|
||||
objectProto$2 = Object.prototype;
|
||||
|
||||
/** Used to resolve the decompiled source of functions. */
|
||||
var funcToString = funcProto.toString;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
||||
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
||||
|
||||
/** Used to infer the `Object` constructor. */
|
||||
var objectCtorString = funcToString.call(Object);
|
||||
@ -1618,7 +1722,7 @@ function isPlainObject(value) {
|
||||
if (proto === null) {
|
||||
return true;
|
||||
}
|
||||
var Ctor = hasOwnProperty$1.call(proto, 'constructor') && proto.constructor;
|
||||
var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
||||
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
||||
funcToString.call(Ctor) == objectCtorString;
|
||||
}
|
||||
|
1860
devtools/client/shared/vendor/redux.js
vendored
1860
devtools/client/shared/vendor/redux.js
vendored
File diff suppressed because it is too large
Load Diff
@ -442,7 +442,7 @@ AbstractTreeItem.prototype = {
|
||||
this._onArrowClick = this._onArrowClick.bind(this);
|
||||
this._onClick = this._onClick.bind(this);
|
||||
this._onDoubleClick = this._onDoubleClick.bind(this);
|
||||
this._onKeyPress = this._onKeyPress.bind(this);
|
||||
this._onKeyDown = this._onKeyDown.bind(this);
|
||||
this._onFocus = this._onFocus.bind(this);
|
||||
this._onBlur = this._onBlur.bind(this);
|
||||
|
||||
@ -457,7 +457,7 @@ AbstractTreeItem.prototype = {
|
||||
|
||||
targetNode.addEventListener("mousedown", this._onClick);
|
||||
targetNode.addEventListener("dblclick", this._onDoubleClick);
|
||||
targetNode.addEventListener("keypress", this._onKeyPress);
|
||||
targetNode.addEventListener("keydown", this._onKeyDown);
|
||||
targetNode.addEventListener("focus", this._onFocus);
|
||||
targetNode.addEventListener("blur", this._onBlur);
|
||||
|
||||
@ -579,9 +579,9 @@ AbstractTreeItem.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler for the "keypress" event on the element displaying this tree item.
|
||||
* Handler for the "keydown" event on the element displaying this tree item.
|
||||
*/
|
||||
_onKeyPress: function (e) {
|
||||
_onKeyDown: function (e) {
|
||||
// Prevent scrolling when pressing navigation keys.
|
||||
ViewHelpers.preventScrolling(e);
|
||||
|
||||
|
@ -36,7 +36,7 @@ this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode, aOptions = {}) {
|
||||
this._list.setAttribute("orient", "horizontal");
|
||||
this._list.setAttribute("clicktoscroll", "true");
|
||||
this._list.setAttribute("smoothscroll", !!aOptions.smoothScroll);
|
||||
this._list.addEventListener("keypress", e => this.emit("keyPress", e));
|
||||
this._list.addEventListener("keydown", e => this.emit("keyDown", e));
|
||||
this._list.addEventListener("mousedown", e => this.emit("mousePress", e));
|
||||
this._parent.appendChild(this._list);
|
||||
|
||||
|
@ -32,7 +32,7 @@ const FastListWidget = module.exports = function FastListWidget(node) {
|
||||
this._list.setAttribute("flex", "1");
|
||||
this._list.setAttribute("orient", "vertical");
|
||||
this._list.setAttribute("tabindex", "0");
|
||||
this._list.addEventListener("keypress", e => this.emit("keyPress", e));
|
||||
this._list.addEventListener("keydown", e => this.emit("keyDown", e));
|
||||
this._list.addEventListener("mousedown", e => this.emit("mousePress", e));
|
||||
this._parent.appendChild(this._list);
|
||||
|
||||
|
@ -341,7 +341,7 @@ CSSFilterEditorWidget.prototype = {
|
||||
// Filters that have units are number-type filters. For them,
|
||||
// the value can be incremented/decremented simply.
|
||||
// For other types of filters (e.g. drop-shadow) we need to check
|
||||
// if the keypress happened close to a number first.
|
||||
// if the keydown happened close to a number first.
|
||||
if (filter.unit) {
|
||||
let startValue = parseFloat(e.target.value);
|
||||
let value = startValue + direction * multiplier;
|
||||
|
@ -185,7 +185,6 @@ function FlameGraph(parent, sharpness) {
|
||||
this._onAnimationFrame = this._onAnimationFrame.bind(this);
|
||||
this._onKeyDown = this._onKeyDown.bind(this);
|
||||
this._onKeyUp = this._onKeyUp.bind(this);
|
||||
this._onKeyPress = this._onKeyPress.bind(this);
|
||||
this._onMouseMove = this._onMouseMove.bind(this);
|
||||
this._onMouseDown = this._onMouseDown.bind(this);
|
||||
this._onMouseUp = this._onMouseUp.bind(this);
|
||||
@ -195,7 +194,6 @@ function FlameGraph(parent, sharpness) {
|
||||
|
||||
this._window.addEventListener("keydown", this._onKeyDown);
|
||||
this._window.addEventListener("keyup", this._onKeyUp);
|
||||
this._window.addEventListener("keypress", this._onKeyPress);
|
||||
this._window.addEventListener("mousemove", this._onMouseMove);
|
||||
this._window.addEventListener("mousedown", this._onMouseDown);
|
||||
this._window.addEventListener("mouseup", this._onMouseUp);
|
||||
@ -239,7 +237,6 @@ FlameGraph.prototype = {
|
||||
|
||||
this._window.removeEventListener("keydown", this._onKeyDown);
|
||||
this._window.removeEventListener("keyup", this._onKeyUp);
|
||||
this._window.removeEventListener("keypress", this._onKeyPress);
|
||||
this._window.removeEventListener("mousemove", this._onMouseMove);
|
||||
this._window.removeEventListener("mousedown", this._onMouseDown);
|
||||
this._window.removeEventListener("mouseup", this._onMouseUp);
|
||||
@ -938,13 +935,6 @@ FlameGraph.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener for the "keypress" event on the graph's container.
|
||||
*/
|
||||
_onKeyPress: function (e) {
|
||||
ViewHelpers.preventScrolling(e);
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener for the "mousemove" event on the graph's container.
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ this.SideMenuWidget = function SideMenuWidget(aNode, aOptions = {}) {
|
||||
this._list.setAttribute("with-group-checkboxes", this._showGroupCheckboxes);
|
||||
this._list.setAttribute("tabindex", "0");
|
||||
this._list.addEventListener("contextmenu", e => this._showContextMenu(e));
|
||||
this._list.addEventListener("keypress", e => this.emit("keyPress", e));
|
||||
this._list.addEventListener("keydown", e => this.emit("keyDown", e));
|
||||
this._list.addEventListener("mousedown", e => this.emit("mousePress", e));
|
||||
this._parent.appendChild(this._list);
|
||||
|
||||
|
@ -1760,7 +1760,7 @@ EditableFieldsEngine.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle keypresses when in edit mode:
|
||||
* Handle keydowns when in edit mode:
|
||||
* - <escape> revert the value and close the textbox.
|
||||
* - <return> apply the value and close the textbox.
|
||||
* - <tab> Handled by the consumer's `onTab` callback.
|
||||
|
@ -135,7 +135,7 @@ TreeWidget.prototype = {
|
||||
this._parent.appendChild(this.root.children);
|
||||
|
||||
this.root.children.addEventListener("mousedown", e => this.onClick(e));
|
||||
this.root.children.addEventListener("keypress", e => this.onKeypress(e));
|
||||
this.root.children.addEventListener("keydown", e => this.onKeydown(e));
|
||||
},
|
||||
|
||||
/**
|
||||
@ -341,10 +341,10 @@ TreeWidget.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Keypress handler for this tree. Used to select next and previous visible
|
||||
* Keydown handler for this tree. Used to select next and previous visible
|
||||
* items, as well as collapsing and expanding any item.
|
||||
*/
|
||||
onKeypress: function (event) {
|
||||
onKeydown: function (event) {
|
||||
switch (event.keyCode) {
|
||||
case KeyCodes.DOM_VK_UP:
|
||||
this.selectPreviousItem();
|
||||
|
@ -81,14 +81,12 @@ this.VariablesView = function VariablesView(aParentNode, aFlags = {}) {
|
||||
this._appendEmptyNotice();
|
||||
|
||||
this._onSearchboxInput = this._onSearchboxInput.bind(this);
|
||||
this._onSearchboxKeyPress = this._onSearchboxKeyPress.bind(this);
|
||||
this._onViewKeyPress = this._onViewKeyPress.bind(this);
|
||||
this._onSearchboxKeyDown = this._onSearchboxKeyDown.bind(this);
|
||||
this._onViewKeyDown = this._onViewKeyDown.bind(this);
|
||||
|
||||
// Create an internal scrollbox container.
|
||||
this._list = this.document.createElement("scrollbox");
|
||||
this._list.setAttribute("orient", "vertical");
|
||||
this._list.addEventListener("keypress", this._onViewKeyPress);
|
||||
this._list.addEventListener("keydown", this._onViewKeyDown);
|
||||
this._parent.appendChild(this._list);
|
||||
|
||||
@ -192,9 +190,7 @@ VariablesView.prototype = {
|
||||
let currList = this._list = this.document.createElement("scrollbox");
|
||||
|
||||
this.window.setTimeout(() => {
|
||||
prevList.removeEventListener("keypress", this._onViewKeyPress);
|
||||
prevList.removeEventListener("keydown", this._onViewKeyDown);
|
||||
currList.addEventListener("keypress", this._onViewKeyPress);
|
||||
currList.addEventListener("keydown", this._onViewKeyDown);
|
||||
currList.setAttribute("orient", "vertical");
|
||||
|
||||
@ -457,7 +453,7 @@ VariablesView.prototype = {
|
||||
searchbox.setAttribute("type", "search");
|
||||
searchbox.setAttribute("flex", "1");
|
||||
searchbox.addEventListener("command", this._onSearchboxInput);
|
||||
searchbox.addEventListener("keypress", this._onSearchboxKeyPress);
|
||||
searchbox.addEventListener("keydown", this._onSearchboxKeyDown);
|
||||
|
||||
container.appendChild(searchbox);
|
||||
ownerNode.insertBefore(container, this._parent);
|
||||
@ -474,7 +470,7 @@ VariablesView.prototype = {
|
||||
}
|
||||
this._searchboxContainer.remove();
|
||||
this._searchboxNode.removeEventListener("command", this._onSearchboxInput);
|
||||
this._searchboxNode.removeEventListener("keypress", this._onSearchboxKeyPress);
|
||||
this._searchboxNode.removeEventListener("keydown", this._onSearchboxKeyDown);
|
||||
|
||||
this._searchboxContainer = null;
|
||||
this._searchboxNode = null;
|
||||
@ -503,9 +499,9 @@ VariablesView.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener handling the searchbox key press event.
|
||||
* Listener handling the searchbox keydown event.
|
||||
*/
|
||||
_onSearchboxKeyPress: function (e) {
|
||||
_onSearchboxKeyDown: function (e) {
|
||||
switch (e.keyCode) {
|
||||
case KeyCodes.DOM_VK_RETURN:
|
||||
this._onSearchboxInput();
|
||||
@ -811,15 +807,25 @@ VariablesView.prototype = {
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener handling a key press event on the view.
|
||||
* Listener handling a key down event on the view.
|
||||
*/
|
||||
_onViewKeyPress: function (e) {
|
||||
_onViewKeyDown: function (e) {
|
||||
let item = this.getFocusedItem();
|
||||
|
||||
// Prevent scrolling when pressing navigation keys.
|
||||
ViewHelpers.preventScrolling(e);
|
||||
|
||||
switch (e.keyCode) {
|
||||
case KeyCodes.DOM_VK_C:
|
||||
// Copy current selection to clipboard.
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
let item = this.getFocusedItem();
|
||||
clipboardHelper.copyString(
|
||||
item._nameString + item.separatorStr + item._valueString
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
||||
case KeyCodes.DOM_VK_UP:
|
||||
// Always rewind focus.
|
||||
this.focusPrevItem(true);
|
||||
@ -899,21 +905,6 @@ VariablesView.prototype = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Listener handling a key down event on the view.
|
||||
*/
|
||||
_onViewKeyDown: function (e) {
|
||||
if (e.keyCode == KeyCodes.DOM_VK_C) {
|
||||
// Copy current selection to clipboard.
|
||||
if (e.ctrlKey || e.metaKey) {
|
||||
let item = this.getFocusedItem();
|
||||
clipboardHelper.copyString(
|
||||
item._nameString + item.separatorStr + item._valueString
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Sets the text displayed in this container when there are no available items.
|
||||
* @param string aValue
|
||||
@ -4016,9 +4007,9 @@ Editable.prototype = {
|
||||
input.selectionStart++;
|
||||
}
|
||||
|
||||
this._onKeypress = this._onKeypress.bind(this);
|
||||
this._onKeydown = this._onKeydown.bind(this);
|
||||
this._onBlur = this._onBlur.bind(this);
|
||||
input.addEventListener("keypress", this._onKeypress);
|
||||
input.addEventListener("keydown", this._onKeydown);
|
||||
input.addEventListener("blur", this._onBlur);
|
||||
|
||||
this._prevExpandable = this._variable.twisty;
|
||||
@ -4034,7 +4025,7 @@ Editable.prototype = {
|
||||
* state.
|
||||
*/
|
||||
deactivate: function () {
|
||||
this._input.removeEventListener("keypress", this._onKeypress);
|
||||
this._input.removeEventListener("keydown", this._onKeydown);
|
||||
this._input.removeEventListener("blur", this.deactivate);
|
||||
this._input.parentNode.replaceChild(this.label, this._input);
|
||||
this._input = null;
|
||||
@ -4087,7 +4078,7 @@ Editable.prototype = {
|
||||
/**
|
||||
* Event handler for when the input receives a key press.
|
||||
*/
|
||||
_onKeypress: function (e) {
|
||||
_onKeydown: function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
switch (e.keyCode) {
|
||||
|
@ -213,7 +213,7 @@ class SwatchBasedEditorTooltip {
|
||||
}
|
||||
|
||||
/**
|
||||
* This parent class only calls this on <esc> keypress
|
||||
* This parent class only calls this on <esc> keydown
|
||||
*/
|
||||
revert() {
|
||||
if (this.activeSwatch) {
|
||||
@ -226,7 +226,7 @@ class SwatchBasedEditorTooltip {
|
||||
}
|
||||
|
||||
/**
|
||||
* This parent class only calls this on <enter> keypress
|
||||
* This parent class only calls this on <enter> keydown
|
||||
*/
|
||||
commit() {
|
||||
if (this.activeSwatch) {
|
||||
@ -238,7 +238,7 @@ class SwatchBasedEditorTooltip {
|
||||
destroy() {
|
||||
this.swatches.clear();
|
||||
this.activeSwatch = null;
|
||||
this.tooltip.off("keypress", this._onTooltipKeypress);
|
||||
this.tooltip.off("keydown", this._onTooltipKeydown);
|
||||
this.tooltip.destroy();
|
||||
this.shortcuts.destroy();
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ const POPUP_EVENTS = ["shown", "hidden", "showing", "hiding"];
|
||||
* - shown : when the tooltip is shown
|
||||
* - hiding : just before the tooltip closes
|
||||
* - hidden : when the tooltip gets hidden
|
||||
* - keypress : when any key gets pressed, with keyCode
|
||||
* - keydown : when any key gets pressed, with keyCode
|
||||
*/
|
||||
|
||||
class Tooltip {
|
||||
@ -131,21 +131,21 @@ class Tooltip {
|
||||
this["_onPopup" + eventName]);
|
||||
}
|
||||
|
||||
// Listen to keypress events to close the tooltip if configured to do so
|
||||
// Listen to keydown events to close the tooltip if configured to do so
|
||||
let win = this.doc.querySelector("window");
|
||||
this._onKeyPress = event => {
|
||||
this._onKeyDown = event => {
|
||||
if (this.panel.hidden) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.emit("keypress", event.keyCode);
|
||||
this.emit("keydown", event.keyCode);
|
||||
if (this.closeOnKeys.includes(event.keyCode) &&
|
||||
this.isShown()) {
|
||||
event.stopPropagation();
|
||||
this.hide();
|
||||
}
|
||||
};
|
||||
win.addEventListener("keypress", this._onKeyPress);
|
||||
win.addEventListener("keydown", this._onKeyDown);
|
||||
|
||||
// Listen to custom emitters' events to close the tooltip
|
||||
this.hide = this.hide.bind(this);
|
||||
@ -234,7 +234,7 @@ class Tooltip {
|
||||
}
|
||||
|
||||
let win = this.doc.querySelector("window");
|
||||
win.removeEventListener("keypress", this._onKeyPress);
|
||||
win.removeEventListener("keydown", this._onKeyDown);
|
||||
|
||||
for (let {emitter, event, useCapture} of this.closeOnEvents) {
|
||||
for (let remove of ["removeEventListener", "off"]) {
|
||||
|
@ -197,7 +197,7 @@ const ViewHelpers = exports.ViewHelpers = {
|
||||
* Check if the enter key or space was pressed
|
||||
*
|
||||
* @param event event
|
||||
* The event triggered by a keypress on an element
|
||||
* The event triggered by a keydown or keypress on an element
|
||||
*/
|
||||
isSpaceOrReturn: function (event) {
|
||||
return event.keyCode === KeyCodes.DOM_VK_SPACE ||
|
||||
@ -507,7 +507,7 @@ Item.prototype = {
|
||||
*
|
||||
* For automagical keyboard and mouse accessibility, the widget should be an
|
||||
* event emitter with the following events:
|
||||
* - "keyPress" -> (aName:string, aEvent:KeyboardEvent)
|
||||
* - "keyDown" -> (aName:string, aEvent:KeyboardEvent)
|
||||
* - "mousePress" -> (aName:string, aEvent:MouseEvent)
|
||||
*/
|
||||
const WidgetMethods = exports.WidgetMethods = {
|
||||
@ -526,7 +526,7 @@ const WidgetMethods = exports.WidgetMethods = {
|
||||
|
||||
// Handle internal events emitted by the widget if necessary.
|
||||
if (ViewHelpers.isEventEmitter(widget)) {
|
||||
widget.on("keyPress", this._onWidgetKeyPress.bind(this));
|
||||
widget.on("keyDown", this._onWidgetKeyDown.bind(this));
|
||||
widget.on("mousePress", this._onWidgetMousePress.bind(this));
|
||||
}
|
||||
},
|
||||
@ -1489,11 +1489,11 @@ const WidgetMethods = exports.WidgetMethods = {
|
||||
},
|
||||
|
||||
/**
|
||||
* The keyPress event listener for this container.
|
||||
* The keyDown event listener for this container.
|
||||
* @param string name
|
||||
* @param KeyboardEvent event
|
||||
*/
|
||||
_onWidgetKeyPress: function (name, event) {
|
||||
_onWidgetKeyDown: function (name, event) {
|
||||
// Prevent scrolling when pressing navigation keys.
|
||||
ViewHelpers.preventScrolling(event);
|
||||
|
||||
|
@ -31,7 +31,7 @@ class ConsoleOutput extends Component {
|
||||
return {
|
||||
initialized: PropTypes.bool.isRequired,
|
||||
messages: PropTypes.object.isRequired,
|
||||
messagesUi: PropTypes.object.isRequired,
|
||||
messagesUi: PropTypes.array.isRequired,
|
||||
serviceContainer: PropTypes.shape({
|
||||
attachRefToHud: PropTypes.func.isRequired,
|
||||
openContextMenu: PropTypes.func.isRequired,
|
||||
|
@ -46,7 +46,6 @@ class Message extends Component {
|
||||
messageId: PropTypes.string,
|
||||
scrollToMessage: PropTypes.bool,
|
||||
exceptionDocURL: PropTypes.string,
|
||||
parameters: PropTypes.object,
|
||||
request: PropTypes.object,
|
||||
dispatch: PropTypes.func,
|
||||
timeStamp: PropTypes.number,
|
||||
@ -261,7 +260,7 @@ class Message extends Component {
|
||||
dom.span({ className: "message-body-wrapper" },
|
||||
dom.span({
|
||||
className: "message-flex-body",
|
||||
onClick: collapsible && this.toggleMessage,
|
||||
onClick: collapsible ? this.toggleMessage : undefined,
|
||||
},
|
||||
// Add whitespaces for formatting when copying to the clipboard.
|
||||
timestampEl ? " " : null,
|
||||
|
@ -180,11 +180,9 @@ skip-if = true # Bug 1437847
|
||||
[browser_console_filters.js]
|
||||
skip-if = true # Bug 1437848
|
||||
[browser_console_nsiconsolemessage.js]
|
||||
skip-if = true # Bug 1437850
|
||||
[browser_console_open_or_focus.js]
|
||||
[browser_console_restore.js]
|
||||
[browser_console_webconsole_ctrlw_close_tab.js]
|
||||
skip-if = true # Bug 1437854
|
||||
[browser_console_webconsole_iframe_messages.js]
|
||||
[browser_console_webconsole_private_browsing.js]
|
||||
skip-if = true # Bug 1403188
|
||||
|
@ -3,83 +3,87 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from head.js */
|
||||
|
||||
// Check that nsIConsoleMessages are displayed in the Browser Console.
|
||||
// See bug 859756.
|
||||
|
||||
"use strict";
|
||||
|
||||
const TEST_URI = "data:text/html;charset=utf8,<title>bug859756</title>\n" +
|
||||
"<p>hello world\n<p>nsIConsoleMessages ftw!";
|
||||
const TEST_URI =
|
||||
`data:text/html;charset=utf8,
|
||||
<title>browser_console_nsiconsolemessage.js</title>
|
||||
<p>hello world<p>
|
||||
nsIConsoleMessages ftw!`;
|
||||
|
||||
function test() {
|
||||
const FILTER_PREF = "devtools.browserconsole.filter.jslog";
|
||||
Services.prefs.setBoolPref(FILTER_PREF, true);
|
||||
add_task(async function () {
|
||||
// We don't use `openNewTabAndConsole()` here because we need to log a message
|
||||
// before opening the web console.
|
||||
await addTab(TEST_URI);
|
||||
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref(FILTER_PREF);
|
||||
// Test for cached nsIConsoleMessages.
|
||||
Services.console.logStringMessage("cachedBrowserConsoleMessage");
|
||||
|
||||
info("open web console");
|
||||
let hud = await openConsole();
|
||||
|
||||
ok(hud, "web console opened");
|
||||
|
||||
// This "liveBrowserConsoleMessage" message should not be displayed.
|
||||
Services.console.logStringMessage("liveBrowserConsoleMessage");
|
||||
|
||||
// Log a "foobarz" message so that we can be certain the previous message is
|
||||
// not displayed.
|
||||
let text = "foobarz";
|
||||
let onFooBarzMessage = waitForMessage(hud, text);
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, text, function (msg) {
|
||||
content.console.log(msg);
|
||||
});
|
||||
await onFooBarzMessage;
|
||||
ok(true, `"${text}" log is displayed in the Web Console as expected`);
|
||||
|
||||
Task.spawn(function* () {
|
||||
const {tab} = yield loadTab(TEST_URI);
|
||||
// Ensure the "liveBrowserConsoleMessage" and "cachedBrowserConsoleMessage"
|
||||
// messages are not displayed.
|
||||
text = hud.outputNode.textContent;
|
||||
ok(!text.includes("cachedBrowserConsoleMessage"),
|
||||
"cached nsIConsoleMessages are not displayed");
|
||||
ok(!text.includes("liveBrowserConsoleMessage"),
|
||||
"nsIConsoleMessages are not displayed");
|
||||
|
||||
// Test for cached nsIConsoleMessages.
|
||||
Services.console.logStringMessage("test1 for bug859756");
|
||||
await closeConsole();
|
||||
|
||||
info("open web console");
|
||||
let hud = yield openConsole(tab);
|
||||
info("web console closed");
|
||||
hud = await HUDService.toggleBrowserConsole();
|
||||
ok(hud, "browser console opened");
|
||||
|
||||
ok(hud, "web console opened");
|
||||
Services.console.logStringMessage("do-not-show-me");
|
||||
await waitFor(() => findMessage(hud, "cachedBrowserConsoleMessage"));
|
||||
Services.console.logStringMessage("liveBrowserConsoleMessage2");
|
||||
await waitFor(() => findMessage(hud, "liveBrowserConsoleMessage2"));
|
||||
|
||||
ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
|
||||
content.console.log("foobarz");
|
||||
});
|
||||
let msg = await waitFor(() => findMessage(hud, "liveBrowserConsoleMessage"));
|
||||
ok(msg, "message element for liveBrowserConsoleMessage (nsIConsoleMessage)");
|
||||
|
||||
yield waitForMessages({
|
||||
webconsole: hud,
|
||||
messages: [{
|
||||
text: "foobarz",
|
||||
category: CATEGORY_WEBDEV,
|
||||
severity: SEVERITY_LOG,
|
||||
}],
|
||||
});
|
||||
const outputNode = hud.ui.outputNode;
|
||||
const toolbar = outputNode.querySelector(".webconsole-filterbar-primary");
|
||||
|
||||
let text = hud.outputNode.textContent;
|
||||
is(text.indexOf("do-not-show-me"), -1,
|
||||
"nsIConsoleMessages are not displayed");
|
||||
is(text.indexOf("test1 for bug859756"), -1,
|
||||
"nsIConsoleMessages are not displayed (confirmed)");
|
||||
// Test that filtering is working by hiding log messages...
|
||||
// show the filter bar.
|
||||
toolbar.querySelector(".devtools-filter-icon").click();
|
||||
const filterBar = await waitFor(() => {
|
||||
return outputNode.querySelector(".webconsole-filterbar-secondary");
|
||||
});
|
||||
ok(filterBar, "Filter bar is shown when filter icon is clicked.");
|
||||
|
||||
yield closeConsole(tab);
|
||||
// Check that messages are not shown when their filter is turned off.
|
||||
filterBar.querySelector(".log").click();
|
||||
|
||||
info("web console closed");
|
||||
hud = yield HUDService.toggleBrowserConsole();
|
||||
ok(hud, "browser console opened");
|
||||
// And then checking that log messages are hidden.
|
||||
await waitFor(() => findMessages(hud, "cachedBrowserConsoleMessage").length === 0);
|
||||
await waitFor(() => findMessages(hud, "liveBrowserConsoleMessage").length === 0);
|
||||
await waitFor(() => findMessages(hud, "liveBrowserConsoleMessage2").length === 0);
|
||||
|
||||
Services.console.logStringMessage("test2 for bug859756");
|
||||
// Turn the log filter off.
|
||||
filterBar.querySelector(".log").click();
|
||||
|
||||
let results = yield waitForMessages({
|
||||
webconsole: hud,
|
||||
messages: [{
|
||||
text: "test1 for bug859756",
|
||||
category: CATEGORY_JS,
|
||||
}, {
|
||||
text: "test2 for bug859756",
|
||||
category: CATEGORY_JS,
|
||||
}, {
|
||||
text: "do-not-show-me",
|
||||
category: CATEGORY_JS,
|
||||
}],
|
||||
});
|
||||
|
||||
let msg = [...results[2].matched][0];
|
||||
ok(msg, "message element for do-not-show-me (nsIConsoleMessage)");
|
||||
isnot(msg.textContent.indexOf("do-not-show"), -1,
|
||||
"element content is correct");
|
||||
ok(!msg.classList.contains("filtered-by-type"), "element is not filtered");
|
||||
|
||||
hud.setFilterState("jslog", false);
|
||||
|
||||
ok(msg.classList.contains("filtered-by-type"), "element is filtered");
|
||||
}).then(finishTest);
|
||||
}
|
||||
// Hide the filter bar.
|
||||
toolbar.querySelector(".devtools-filter-icon").click();
|
||||
});
|
||||
|
@ -3,25 +3,21 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
/* import-globals-from head.js */
|
||||
|
||||
// Check that Ctrl-W closes the Browser Console and that Ctrl-W closes the
|
||||
// current tab when using the Web Console - bug 871156.
|
||||
|
||||
"use strict";
|
||||
|
||||
add_task(function* () {
|
||||
add_task(async function () {
|
||||
const TEST_URI = "data:text/html;charset=utf8,<title>bug871156</title>\n" +
|
||||
"<p>hello world";
|
||||
let firstTab = gBrowser.selectedTab;
|
||||
|
||||
Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", false);
|
||||
registerCleanupFunction(() => {
|
||||
Services.prefs.clearUserPref("toolkit.cosmeticAnimations.enabled");
|
||||
});
|
||||
await pushPref("toolkit.cosmeticAnimations.enabled", false);
|
||||
|
||||
yield loadTab(TEST_URI);
|
||||
|
||||
let hud = yield openConsole();
|
||||
ok(hud, "Web Console opened");
|
||||
let hud = await openNewTabAndConsole(TEST_URI);
|
||||
|
||||
let tabClosed = defer();
|
||||
let toolboxDestroyed = defer();
|
||||
@ -52,11 +48,11 @@ add_task(function* () {
|
||||
EventUtils.synthesizeKey("w", { accelKey: true });
|
||||
});
|
||||
|
||||
yield promise.all([tabClosed.promise, toolboxDestroyed.promise,
|
||||
await promise.all([tabClosed.promise, toolboxDestroyed.promise,
|
||||
tabSelected.promise]);
|
||||
info("promise.all resolved. start testing the Browser Console");
|
||||
|
||||
hud = yield HUDService.toggleBrowserConsole();
|
||||
hud = await HUDService.toggleBrowserConsole();
|
||||
ok(hud, "Browser Console opened");
|
||||
|
||||
let deferred = defer();
|
||||
@ -72,5 +68,5 @@ add_task(function* () {
|
||||
EventUtils.synthesizeKey("w", { accelKey: true }, hud.iframeWindow);
|
||||
}, hud.iframeWindow);
|
||||
|
||||
yield deferred.promise;
|
||||
await deferred.promise;
|
||||
});
|
||||
|
@ -53,7 +53,7 @@ const gFunctions = [
|
||||
// 2: French
|
||||
[2, (n) => n>1?1:0],
|
||||
// 3: Latvian
|
||||
[3, (n) => n%10==1&&n%100!=11?1:n!=0?2:0],
|
||||
[3, (n) => n%10==1&&n%100!=11?1:n%10==0?0:2],
|
||||
// 4: Scottish Gaelic
|
||||
[4, (n) => n==1||n==11?0:n==2||n==12?1:n>0&&n<20?2:3],
|
||||
// 5: Romanian
|
||||
@ -74,12 +74,16 @@ const gFunctions = [
|
||||
[6, (n) => n==0?5:n==1?0:n==2?1:n%100>=3&&n%100<=10?2:n%100>=11&&n%100<=99?3:4],
|
||||
// 13: Maltese
|
||||
[4, (n) => n==1?0:n==0||n%100>0&&n%100<=10?1:n%100>10&&n%100<20?2:3],
|
||||
// 14: Macedonian
|
||||
// 14: Unused
|
||||
[3, (n) => n%10==1?0:n%10==2?1:2],
|
||||
// 15: Icelandic
|
||||
// 15: Icelandic, Macedonian
|
||||
[2, (n) => n%10==1&&n%100!=11?0:1],
|
||||
// 16: Breton
|
||||
[5, (n) => n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:(n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:n%1000000==0&&n!=0?3:4],
|
||||
// 17: Shuar
|
||||
[2, (n) => n!=0?1:0],
|
||||
// 18: Welsh
|
||||
[6, (n) => n==0?0:n==1?1:n==2?2:n==3?3:n==6?4:5],
|
||||
];
|
||||
|
||||
const PluralForm = {
|
||||
|
@ -162,7 +162,7 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
||||
// after it. The easiest way to do that is to call this method again with the
|
||||
// "view-source:" lopped off and then prepend it again afterwards.
|
||||
|
||||
if (scheme.LowerCaseEqualsLiteral("view-source")) {
|
||||
if (scheme.EqualsLiteral("view-source")) {
|
||||
nsCOMPtr<nsIURIFixupInfo> uriInfo;
|
||||
// We disable keyword lookup and alternate URIs so that small typos don't
|
||||
// cause us to look at very different domains
|
||||
@ -177,7 +177,7 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
||||
innerURIString.Trim(" ");
|
||||
nsAutoCString innerScheme;
|
||||
ioService->ExtractScheme(innerURIString, innerScheme);
|
||||
if (innerScheme.LowerCaseEqualsLiteral("view-source")) {
|
||||
if (innerScheme.EqualsLiteral("view-source")) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
@ -233,47 +233,47 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
|
||||
if (sFixTypos && (aFixupFlags & FIXUP_FLAG_FIX_SCHEME_TYPOS)) {
|
||||
// Fast-path for common cases.
|
||||
if (scheme.IsEmpty() ||
|
||||
scheme.LowerCaseEqualsLiteral("http") ||
|
||||
scheme.LowerCaseEqualsLiteral("https") ||
|
||||
scheme.LowerCaseEqualsLiteral("ftp") ||
|
||||
scheme.LowerCaseEqualsLiteral("file")) {
|
||||
scheme.EqualsLiteral("http") ||
|
||||
scheme.EqualsLiteral("https") ||
|
||||
scheme.EqualsLiteral("ftp") ||
|
||||
scheme.EqualsLiteral("file")) {
|
||||
// Do nothing.
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ttp")) {
|
||||
} else if (scheme.EqualsLiteral("ttp")) {
|
||||
// ttp -> http.
|
||||
uriString.ReplaceLiteral(0, 3, "http");
|
||||
scheme.AssignLiteral("http");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("htp")) {
|
||||
} else if (scheme.EqualsLiteral("htp")) {
|
||||
// htp -> http.
|
||||
uriString.ReplaceLiteral(0, 3, "http");
|
||||
scheme.AssignLiteral("http");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ttps")) {
|
||||
} else if (scheme.EqualsLiteral("ttps")) {
|
||||
// ttps -> https.
|
||||
uriString.ReplaceLiteral(0, 4, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("tps")) {
|
||||
} else if (scheme.EqualsLiteral("tps")) {
|
||||
// tps -> https.
|
||||
uriString.ReplaceLiteral(0, 3, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ps")) {
|
||||
} else if (scheme.EqualsLiteral("ps")) {
|
||||
// ps -> https.
|
||||
uriString.ReplaceLiteral(0, 2, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("htps")) {
|
||||
} else if (scheme.EqualsLiteral("htps")) {
|
||||
// htps -> https.
|
||||
uriString.ReplaceLiteral(0, 4, "https");
|
||||
scheme.AssignLiteral("https");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("ile")) {
|
||||
} else if (scheme.EqualsLiteral("ile")) {
|
||||
// ile -> file.
|
||||
uriString.ReplaceLiteral(0, 3, "file");
|
||||
scheme.AssignLiteral("file");
|
||||
info->mFixupChangedProtocol = true;
|
||||
} else if (scheme.LowerCaseEqualsLiteral("le")) {
|
||||
} else if (scheme.EqualsLiteral("le")) {
|
||||
// le -> file.
|
||||
uriString.ReplaceLiteral(0, 2, "file");
|
||||
scheme.AssignLiteral("file");
|
||||
|
@ -44,7 +44,6 @@
|
||||
#include "nsNameSpaceManager.h"
|
||||
#include "nsIBaseWindow.h"
|
||||
#include "nsISelection.h"
|
||||
#include "nsITextControlElement.h"
|
||||
#include "nsFrameSelection.h"
|
||||
#include "nsPIDOMWindow.h"
|
||||
#include "nsPIWindowRoot.h"
|
||||
@ -2294,21 +2293,6 @@ GetParentFrameToScroll(nsIFrame* aFrame)
|
||||
return aFrame->GetParent();
|
||||
}
|
||||
|
||||
/*static*/ bool
|
||||
EventStateManager::CanVerticallyScrollFrameWithWheel(nsIFrame* aFrame)
|
||||
{
|
||||
nsIContent* c = aFrame->GetContent();
|
||||
if (!c) {
|
||||
return true;
|
||||
}
|
||||
nsCOMPtr<nsITextControlElement> ctrl =
|
||||
do_QueryInterface(c->IsInAnonymousSubtree() ? c->GetBindingParent() : c);
|
||||
if (ctrl && ctrl->IsSingleLineTextControl()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
EventStateManager::DispatchLegacyMouseScrollEvents(nsIFrame* aTargetFrame,
|
||||
WidgetWheelEvent* aEvent,
|
||||
@ -2608,17 +2592,29 @@ EventStateManager::ComputeScrollTarget(nsIFrame* aTargetFrame,
|
||||
nsIFrame* frameToScroll = do_QueryFrame(scrollableFrame);
|
||||
MOZ_ASSERT(frameToScroll);
|
||||
|
||||
// Don't scroll vertically by mouse-wheel on a single-line text control.
|
||||
if (checkIfScrollableY) {
|
||||
if (!CanVerticallyScrollFrameWithWheel(scrollFrame)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (!checkIfScrollableX && !checkIfScrollableY) {
|
||||
return frameToScroll;
|
||||
}
|
||||
|
||||
// If the frame disregards the direction the user is trying to scroll, then
|
||||
// it should just bubbles the scroll event up to its parental scroll frame
|
||||
Maybe<layers::ScrollDirection> disregardedDirection =
|
||||
WheelHandlingUtils::GetDisregardedWheelScrollDirection(scrollFrame);
|
||||
if (disregardedDirection) {
|
||||
switch (disregardedDirection.ref()) {
|
||||
case layers::ScrollDirection::eHorizontal:
|
||||
if (checkIfScrollableX) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
case layers::ScrollDirection::eVertical:
|
||||
if (checkIfScrollableY) {
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
|
||||
bool hiddenForV = (NS_STYLE_OVERFLOW_HIDDEN == ss.mVertical);
|
||||
bool hiddenForH = (NS_STYLE_OVERFLOW_HIDDEN == ss.mHorizontal);
|
||||
|
@ -311,10 +311,6 @@ public:
|
||||
double* aOutMultiplierX,
|
||||
double* aOutMultiplierY);
|
||||
|
||||
// Returns whether or not a frame can be vertically scrolled with a mouse
|
||||
// wheel (as opposed to, say, a selection or touch scroll).
|
||||
static bool CanVerticallyScrollFrameWithWheel(nsIFrame* aFrame);
|
||||
|
||||
// Holds the point in screen coords that a mouse event was dispatched to,
|
||||
// before we went into pointer lock mode. This is constantly updated while
|
||||
// the pointer is not locked, but we don't update it while the pointer is
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIPresShell.h"
|
||||
#include "nsIScrollableFrame.h"
|
||||
#include "nsITextControlElement.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsPluginFrame.h"
|
||||
#include "nsPresContext.h"
|
||||
@ -79,6 +80,31 @@ WheelHandlingUtils::CanScrollOn(nsIScrollableFrame* aScrollFrame,
|
||||
scrollRange.YMost(), aDirectionY));
|
||||
}
|
||||
|
||||
/*static*/ Maybe<layers::ScrollDirection>
|
||||
WheelHandlingUtils::GetDisregardedWheelScrollDirection(const nsIFrame* aFrame)
|
||||
{
|
||||
nsIContent* content = aFrame->GetContent();
|
||||
if (!content) {
|
||||
return Nothing();
|
||||
}
|
||||
nsCOMPtr<nsITextControlElement> ctrl =
|
||||
do_QueryInterface(content->IsInAnonymousSubtree()
|
||||
? content->GetBindingParent() : content);
|
||||
if (!ctrl || !ctrl->IsSingleLineTextControl()) {
|
||||
return Nothing();
|
||||
}
|
||||
// Disregard scroll in the block-flow direction by mouse wheel on a
|
||||
// single-line text control. For instance, in tranditional Chinese writing
|
||||
// system, a single-line text control cannot be scrolled horizontally with
|
||||
// mouse wheel even if they overflow at the right and left edges; Whereas in
|
||||
// latin-based writing system, a single-line text control cannot be scrolled
|
||||
// vertically with mouse wheel even if they overflow at the top and bottom
|
||||
// edges
|
||||
return Some(aFrame->GetWritingMode().IsVertical()
|
||||
? layers::ScrollDirection::eHorizontal
|
||||
: layers::ScrollDirection::eVertical);
|
||||
}
|
||||
|
||||
/******************************************************************/
|
||||
/* mozilla::WheelTransaction */
|
||||
/******************************************************************/
|
||||
@ -105,7 +131,7 @@ WheelTransaction::OwnScrollbars(bool aOwn)
|
||||
|
||||
/* static */ void
|
||||
WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
|
||||
WidgetWheelEvent* aEvent)
|
||||
const WidgetWheelEvent* aEvent)
|
||||
{
|
||||
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
|
||||
MOZ_ASSERT(aEvent->mMessage == eWheel,
|
||||
@ -120,7 +146,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
WheelTransaction::UpdateTransaction(WidgetWheelEvent* aEvent)
|
||||
WheelTransaction::UpdateTransaction(const WidgetWheelEvent* aEvent)
|
||||
{
|
||||
nsIFrame* scrollToFrame = GetTargetFrame();
|
||||
nsIScrollableFrame* scrollableFrame = scrollToFrame->GetScrollTargetFrame();
|
||||
|
@ -68,6 +68,12 @@ public:
|
||||
static bool CanScrollOn(nsIScrollableFrame* aScrollFrame,
|
||||
double aDirectionX, double aDirectionY);
|
||||
|
||||
// For more details about the concept of a disregarded direction, refer to the
|
||||
// code in struct mozilla::layers::ScrollMetadata which defines
|
||||
// mDisregardedDirection.
|
||||
static Maybe<layers::ScrollDirection>
|
||||
GetDisregardedWheelScrollDirection(const nsIFrame* aFrame);
|
||||
|
||||
private:
|
||||
static bool CanScrollInRange(nscoord aMin, nscoord aValue, nscoord aMax,
|
||||
double aDirection);
|
||||
@ -159,10 +165,10 @@ public:
|
||||
|
||||
protected:
|
||||
static void BeginTransaction(nsIFrame* aTargetFrame,
|
||||
WidgetWheelEvent* aEvent);
|
||||
const WidgetWheelEvent* aEvent);
|
||||
// Be careful, UpdateTransaction may fire a DOM event, therefore, the target
|
||||
// frame might be destroyed in the event handler.
|
||||
static bool UpdateTransaction(WidgetWheelEvent* aEvent);
|
||||
static bool UpdateTransaction(const WidgetWheelEvent* aEvent);
|
||||
static void MayEndTransaction();
|
||||
|
||||
static LayoutDeviceIntPoint GetScreenPoint(WidgetGUIEvent* aEvent);
|
||||
|
@ -4,8 +4,6 @@
|
||||
*/
|
||||
|
||||
function run_test() {
|
||||
const { "classes": Cc, "interfaces": Ci, "utils": Cu } = Components;
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
|
||||
const INDEXEDDB_HEAD_FILE = "xpcshell-head-parent-process.js";
|
||||
|
@ -39,6 +39,7 @@ using namespace std;
|
||||
|
||||
using namespace mozilla::dom; // for WebAudioUtils
|
||||
using mozilla::IsInfinite;
|
||||
using mozilla::PositiveInfinity;
|
||||
using mozilla::IsNaN;
|
||||
using mozilla::MakeUnique;
|
||||
|
||||
@ -321,7 +322,13 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
|
||||
bool isReleasing = scaledDesiredGain > m_compressorGain;
|
||||
|
||||
// compressionDiffDb is the difference between current compression level and the desired level.
|
||||
float compressionDiffDb = WebAudioUtils::ConvertLinearToDecibels(m_compressorGain / scaledDesiredGain, -1000.0f);
|
||||
float compressionDiffDb;
|
||||
if (scaledDesiredGain == 0.0) {
|
||||
compressionDiffDb = PositiveInfinity<float>();
|
||||
} else {
|
||||
compressionDiffDb = WebAudioUtils::ConvertLinearToDecibels(m_compressorGain / scaledDesiredGain, -1000.0f);
|
||||
}
|
||||
|
||||
|
||||
if (isReleasing) {
|
||||
// Release mode - compressionDiffDb should be negative dB
|
||||
|
@ -416,6 +416,12 @@ public:
|
||||
const nsString& aDeviceId,
|
||||
const char** aOutBadConstraint) override;
|
||||
|
||||
/**
|
||||
* Assigns the current settings of the capture to aOutSettings.
|
||||
* Main thread only.
|
||||
*/
|
||||
void GetSettings(dom::MediaTrackSettings& aOutSettings) const override;
|
||||
|
||||
void Pull(const RefPtr<const AllocationHandle>& aHandle,
|
||||
const RefPtr<SourceMediaStream>& aStream,
|
||||
TrackID aTrackID,
|
||||
|
@ -754,6 +754,13 @@ MediaEngineWebRTCMicrophoneSource::Stop(const RefPtr<const AllocationHandle>& aH
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void
|
||||
MediaEngineWebRTCMicrophoneSource::GetSettings(dom::MediaTrackSettings& aOutSettings) const
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
aOutSettings = *mSettings;
|
||||
}
|
||||
|
||||
void
|
||||
MediaEngineWebRTCMicrophoneSource::Pull(const RefPtr<const AllocationHandle>& aHandle,
|
||||
const RefPtr<SourceMediaStream>& aStream,
|
||||
|
@ -81,6 +81,7 @@
|
||||
#include "nsIFrame.h"
|
||||
#include "nsNodeInfoManager.h"
|
||||
#include "nsXBLBinding.h"
|
||||
#include "nsXULTooltipListener.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozAutoDocUpdate.h"
|
||||
#include "nsIDOMXULCommandEvent.h"
|
||||
@ -734,6 +735,19 @@ private:
|
||||
nsCOMPtr<nsIDocument> mDocument;
|
||||
};
|
||||
|
||||
static bool
|
||||
NeedTooltipSupport(const nsXULElement& aXULElement)
|
||||
{
|
||||
if (aXULElement.NodeInfo()->Equals(nsGkAtoms::treechildren)) {
|
||||
// treechildren always get tooltip support, since cropped tree cells show
|
||||
// their full text in a tooltip.
|
||||
return true;
|
||||
}
|
||||
|
||||
return aXULElement.GetBoolAttr(nsGkAtoms::tooltip) ||
|
||||
aXULElement.GetBoolAttr(nsGkAtoms::tooltiptext);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsXULElement::BindToTree(nsIDocument* aDocument,
|
||||
nsIContent* aParent,
|
||||
@ -786,6 +800,10 @@ nsXULElement::BindToTree(nsIDocument* aDocument,
|
||||
}
|
||||
}
|
||||
|
||||
if (doc && NeedTooltipSupport(*this)) {
|
||||
AddTooltipSupport();
|
||||
}
|
||||
|
||||
if (aDocument) {
|
||||
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
|
||||
"Missing a script blocker!");
|
||||
@ -799,6 +817,10 @@ nsXULElement::BindToTree(nsIDocument* aDocument,
|
||||
void
|
||||
nsXULElement::UnbindFromTree(bool aDeep, bool aNullParent)
|
||||
{
|
||||
if (NeedTooltipSupport(*this)) {
|
||||
RemoveTooltipSupport();
|
||||
}
|
||||
|
||||
// mControllers can own objects that are implemented
|
||||
// in JavaScript (such as some implementations of
|
||||
// nsIControllers. These objects prevent their global
|
||||
@ -1212,6 +1234,17 @@ nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
}
|
||||
}
|
||||
|
||||
if (aName == nsGkAtoms::tooltip || aName == nsGkAtoms::tooltiptext) {
|
||||
if (!!aValue != !!aOldValue &&
|
||||
IsInComposedDoc() &&
|
||||
!NodeInfo()->Equals(nsGkAtoms::treechildren)) {
|
||||
if (aValue) {
|
||||
AddTooltipSupport();
|
||||
} else {
|
||||
RemoveTooltipSupport();
|
||||
}
|
||||
}
|
||||
}
|
||||
// XXX need to check if they're changing an event handler: if
|
||||
// so, then we need to unhook the old one. Or something.
|
||||
}
|
||||
@ -1220,6 +1253,28 @@ nsXULElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
aValue, aOldValue, aSubjectPrincipal, aNotify);
|
||||
}
|
||||
|
||||
void
|
||||
nsXULElement::AddTooltipSupport()
|
||||
{
|
||||
nsXULTooltipListener* listener = nsXULTooltipListener::GetInstance();
|
||||
if (!listener) {
|
||||
return;
|
||||
}
|
||||
|
||||
listener->AddTooltipSupport(this);
|
||||
}
|
||||
|
||||
void
|
||||
nsXULElement::RemoveTooltipSupport()
|
||||
{
|
||||
nsXULTooltipListener* listener = nsXULTooltipListener::GetInstance();
|
||||
if (!listener) {
|
||||
return;
|
||||
}
|
||||
|
||||
listener->RemoveTooltipSupport(this);
|
||||
}
|
||||
|
||||
bool
|
||||
nsXULElement::ParseAttribute(int32_t aNamespaceID,
|
||||
nsAtom* aAttribute,
|
||||
|
@ -754,6 +754,9 @@ protected:
|
||||
void RemoveBroadcaster(const nsAString & broadcasterId);
|
||||
|
||||
protected:
|
||||
void AddTooltipSupport();
|
||||
void RemoveTooltipSupport();
|
||||
|
||||
// Internal accessor. This shadows the 'Slots', and returns
|
||||
// appropriate value.
|
||||
nsIControllers *Controllers() {
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef GFX_FRAMEMETRICS_H
|
||||
#define GFX_FRAMEMETRICS_H
|
||||
|
||||
#include <stdint.h> // for uint32_t, uint64_t
|
||||
#include <stdint.h> // for uint8_t, uint32_t, uint64_t
|
||||
#include "Units.h" // for CSSRect, CSSPixel, etc
|
||||
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
|
||||
#include "mozilla/HashFunctions.h" // for HashGeneric
|
||||
@ -16,6 +16,7 @@
|
||||
#include "mozilla/gfx/Rect.h" // for RoundedIn
|
||||
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
|
||||
#include "mozilla/gfx/Logging.h" // for Log
|
||||
#include "mozilla/layers/LayersTypes.h" // for ScrollDirection
|
||||
#include "mozilla/StaticPtr.h" // for StaticAutoPtr
|
||||
#include "mozilla/TimeStamp.h" // for TimeStamp
|
||||
#include "nsString.h"
|
||||
@ -819,7 +820,6 @@ public:
|
||||
, mPageScrollAmount(0, 0)
|
||||
, mScrollClip()
|
||||
, mHasScrollgrab(false)
|
||||
, mAllowVerticalScrollWithWheel(false)
|
||||
, mIsLayersIdRoot(false)
|
||||
, mUsesContainerScrolling(false)
|
||||
, mForceDisableApz(false)
|
||||
@ -837,10 +837,10 @@ public:
|
||||
mPageScrollAmount == aOther.mPageScrollAmount &&
|
||||
mScrollClip == aOther.mScrollClip &&
|
||||
mHasScrollgrab == aOther.mHasScrollgrab &&
|
||||
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
|
||||
mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
|
||||
mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
|
||||
mForceDisableApz == aOther.mForceDisableApz &&
|
||||
mDisregardedDirection == aOther.mDisregardedDirection &&
|
||||
mOverscrollBehavior == aOther.mOverscrollBehavior;
|
||||
}
|
||||
|
||||
@ -926,12 +926,6 @@ public:
|
||||
bool GetHasScrollgrab() const {
|
||||
return mHasScrollgrab;
|
||||
}
|
||||
bool AllowVerticalScrollWithWheel() const {
|
||||
return mAllowVerticalScrollWithWheel;
|
||||
}
|
||||
void SetAllowVerticalScrollWithWheel(bool aValue) {
|
||||
mAllowVerticalScrollWithWheel = aValue;
|
||||
}
|
||||
void SetIsLayersIdRoot(bool aValue) {
|
||||
mIsLayersIdRoot = aValue;
|
||||
}
|
||||
@ -951,6 +945,16 @@ public:
|
||||
return mForceDisableApz;
|
||||
}
|
||||
|
||||
// For more details about the concept of a disregarded direction, refer to the
|
||||
// code which defines mDisregardedDirection.
|
||||
Maybe<ScrollDirection> GetDisregardedDirection() const {
|
||||
return mDisregardedDirection;
|
||||
}
|
||||
void
|
||||
SetDisregardedDirection(const Maybe<ScrollDirection>& aValue) {
|
||||
mDisregardedDirection = aValue;
|
||||
}
|
||||
|
||||
void SetOverscrollBehavior(const OverscrollBehaviorInfo& aOverscrollBehavior) {
|
||||
mOverscrollBehavior = aOverscrollBehavior;
|
||||
}
|
||||
@ -992,9 +996,6 @@ private:
|
||||
// Whether or not this frame is for an element marked 'scrollgrab'.
|
||||
bool mHasScrollgrab:1;
|
||||
|
||||
// Whether or not the frame can be vertically scrolled with a mouse wheel.
|
||||
bool mAllowVerticalScrollWithWheel:1;
|
||||
|
||||
// Whether these framemetrics are for the root scroll frame (root element if
|
||||
// we don't have a root scroll frame) for its layers id.
|
||||
bool mIsLayersIdRoot:1;
|
||||
@ -1007,6 +1008,13 @@ private:
|
||||
// scrollframe.
|
||||
bool mForceDisableApz:1;
|
||||
|
||||
// The disregarded direction means the direction which is disregarded anyway,
|
||||
// even if the scroll frame overflows in that direction and the direction is
|
||||
// specified as scrollable. This could happen in some scenarios, for instance,
|
||||
// a single-line text control frame should disregard wheel scroll in
|
||||
// its block-flow direction even if it overflows in that direction.
|
||||
Maybe<ScrollDirection> mDisregardedDirection;
|
||||
|
||||
// The overscroll behavior for this scroll frame.
|
||||
OverscrollBehaviorInfo mOverscrollBehavior;
|
||||
|
||||
@ -1014,9 +1022,10 @@ private:
|
||||
//
|
||||
// When adding new fields to ScrollMetadata, the following places should be
|
||||
// updated to include them (as needed):
|
||||
// ScrollMetadata::operator ==
|
||||
// AsyncPanZoomController::NotifyLayersUpdated
|
||||
// The ParamTraits specialization in GfxMessageUtils.h
|
||||
// 1. ScrollMetadata::operator ==
|
||||
// 2. AsyncPanZoomController::NotifyLayersUpdated
|
||||
// 3. The ParamTraits specialization in GfxMessageUtils.h and/or
|
||||
// LayersMessageUtils.h
|
||||
//
|
||||
// Please add new fields above this comment.
|
||||
};
|
||||
|
@ -1965,10 +1965,17 @@ bool
|
||||
AsyncPanZoomController::CanScrollWithWheel(const ParentLayerPoint& aDelta) const
|
||||
{
|
||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||
if (mX.CanScroll(aDelta.x)) {
|
||||
|
||||
// For more details about the concept of a disregarded direction, refer to the
|
||||
// code in struct ScrollMetadata which defines mDisregardedDirection.
|
||||
Maybe<ScrollDirection> disregardedDirection =
|
||||
mScrollMetadata.GetDisregardedDirection();
|
||||
if (mX.CanScroll(aDelta.x) &&
|
||||
disregardedDirection != Some(ScrollDirection::eHorizontal)) {
|
||||
return true;
|
||||
}
|
||||
if (mY.CanScroll(aDelta.y) && mScrollMetadata.AllowVerticalScrollWithWheel()) {
|
||||
if (mY.CanScroll(aDelta.y) &&
|
||||
disregardedDirection != Some(ScrollDirection::eVertical)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@ -2713,15 +2720,20 @@ bool AsyncPanZoomController::AttemptScroll(ParentLayerPoint& aStartPoint,
|
||||
|
||||
if (scrollThisApzc) {
|
||||
RecursiveMutexAutoLock lock(mRecursiveMutex);
|
||||
bool forcesVerticalOverscroll =
|
||||
ScrollSource::Wheel == aOverscrollHandoffState.mScrollSource &&
|
||||
mScrollMetadata.GetDisregardedDirection() == Some(ScrollDirection::eVertical);
|
||||
bool forcesHorizontalOverscroll =
|
||||
ScrollSource::Wheel == aOverscrollHandoffState.mScrollSource &&
|
||||
mScrollMetadata.GetDisregardedDirection() == Some(ScrollDirection::eHorizontal);
|
||||
|
||||
ParentLayerPoint adjustedDisplacement;
|
||||
bool forceVerticalOverscroll =
|
||||
(aOverscrollHandoffState.mScrollSource == ScrollSource::Wheel &&
|
||||
!mScrollMetadata.AllowVerticalScrollWithWheel());
|
||||
bool yChanged = mY.AdjustDisplacement(displacement.y, adjustedDisplacement.y, overscroll.y,
|
||||
forceVerticalOverscroll);
|
||||
bool xChanged = mX.AdjustDisplacement(displacement.x, adjustedDisplacement.x, overscroll.x);
|
||||
|
||||
bool yChanged = mY.AdjustDisplacement(displacement.y, adjustedDisplacement.y,
|
||||
overscroll.y,
|
||||
forcesVerticalOverscroll);
|
||||
bool xChanged = mX.AdjustDisplacement(displacement.x, adjustedDisplacement.x,
|
||||
overscroll.x,
|
||||
forcesHorizontalOverscroll);
|
||||
if (xChanged || yChanged) {
|
||||
ScheduleComposite();
|
||||
}
|
||||
@ -3945,6 +3957,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
|
||||
mScrollMetadata.SetUsesContainerScrolling(aScrollMetadata.UsesContainerScrolling());
|
||||
mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer());
|
||||
mScrollMetadata.SetForceDisableApz(aScrollMetadata.IsApzForceDisabled());
|
||||
mScrollMetadata.SetDisregardedDirection(aScrollMetadata.GetDisregardedDirection());
|
||||
mScrollMetadata.SetOverscrollBehavior(aScrollMetadata.GetOverscrollBehavior());
|
||||
|
||||
if (scrollOffsetUpdated) {
|
||||
|
@ -83,9 +83,9 @@ public:
|
||||
* to prevent the viewport from overscrolling the page rect), and axis locking
|
||||
* (which might prevent any displacement from happening). If overscroll
|
||||
* ocurred, its amount is written to |aOverscrollAmountOut|.
|
||||
* The |aDisplacementOut| parameter is set to the adjusted
|
||||
* displacement, and the function returns true iff internal overscroll amounts
|
||||
* were changed.
|
||||
* The |aDisplacementOut| parameter is set to the adjusted displacement, and
|
||||
* the function returns true if and only if internal overscroll amounts were
|
||||
* changed.
|
||||
*/
|
||||
bool AdjustDisplacement(ParentLayerCoord aDisplacement,
|
||||
/* ParentLayerCoord */ float& aDisplacementOut,
|
||||
|
@ -21,7 +21,6 @@ GenericScrollAnimation::GenericScrollAnimation(AsyncPanZoomController& aApzc,
|
||||
const ScrollAnimationBezierPhysicsSettings& aSettings)
|
||||
: mApzc(aApzc)
|
||||
, mFinalDestination(aInitialPosition)
|
||||
, mForceVerticalOverscroll(false)
|
||||
{
|
||||
if (gfxPrefs::SmoothScrollMSDPhysicsEnabled()) {
|
||||
mAnimationPhysics = MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition);
|
||||
@ -86,9 +85,12 @@ GenericScrollAnimation::DoSample(FrameMetrics& aFrameMetrics, const TimeDuration
|
||||
|
||||
// Note: we ignore overscroll for generic animations.
|
||||
ParentLayerPoint adjustedOffset, overscroll;
|
||||
mApzc.mX.AdjustDisplacement(displacement.x, adjustedOffset.x, overscroll.x);
|
||||
mApzc.mX.AdjustDisplacement(displacement.x, adjustedOffset.x, overscroll.x,
|
||||
mDirectionForcedToOverscroll
|
||||
== Some(ScrollDirection::eHorizontal));
|
||||
mApzc.mY.AdjustDisplacement(displacement.y, adjustedOffset.y, overscroll.y,
|
||||
mForceVerticalOverscroll);
|
||||
mDirectionForcedToOverscroll
|
||||
== Some(ScrollDirection::eVertical));
|
||||
|
||||
// If we expected to scroll, but there's no more scroll range on either axis,
|
||||
// then end the animation early. Note that the initial displacement could be 0
|
||||
|
@ -42,7 +42,12 @@ protected:
|
||||
AsyncPanZoomController& mApzc;
|
||||
UniquePtr<ScrollAnimationPhysics> mAnimationPhysics;
|
||||
nsPoint mFinalDestination;
|
||||
bool mForceVerticalOverscroll;
|
||||
// If a direction is forced to overscroll, it means it's axis in that
|
||||
// direction is locked, and scroll in that direction is treated as overscroll
|
||||
// of an equal amount, which, for example, may then bubble up a scroll action
|
||||
// to its parent, or may behave as whatever an overscroll occurence requires
|
||||
// to behave
|
||||
Maybe<ScrollDirection> mDirectionForcedToOverscroll;
|
||||
};
|
||||
|
||||
} // namespace layers
|
||||
|
@ -46,7 +46,8 @@ WheelScrollAnimation::WheelScrollAnimation(AsyncPanZoomController& aApzc,
|
||||
ScrollWheelInput::ScrollDeltaType aDeltaType)
|
||||
: GenericScrollAnimation(aApzc, aInitialPosition, SettingsForDeltaType(aDeltaType))
|
||||
{
|
||||
mForceVerticalOverscroll = !mApzc.mScrollMetadata.AllowVerticalScrollWithWheel();
|
||||
mDirectionForcedToOverscroll =
|
||||
mApzc.mScrollMetadata.GetDisregardedDirection();
|
||||
}
|
||||
|
||||
} // namespace layers
|
||||
|
@ -72,7 +72,6 @@ protected:
|
||||
metrics.SetScrollOffset(CSSPoint(0, 0));
|
||||
metadata.SetPageScrollAmount(LayoutDeviceIntSize(50, 100));
|
||||
metadata.SetLineScrollAmount(LayoutDeviceIntSize(5, 10));
|
||||
metadata.SetAllowVerticalScrollWithWheel(true);
|
||||
return metadata;
|
||||
}
|
||||
|
||||
|
@ -289,10 +289,10 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
||||
WriteParam(aMsg, aParam.mPageScrollAmount);
|
||||
WriteParam(aMsg, aParam.mScrollClip);
|
||||
WriteParam(aMsg, aParam.mHasScrollgrab);
|
||||
WriteParam(aMsg, aParam.mAllowVerticalScrollWithWheel);
|
||||
WriteParam(aMsg, aParam.mIsLayersIdRoot);
|
||||
WriteParam(aMsg, aParam.mUsesContainerScrolling);
|
||||
WriteParam(aMsg, aParam.mForceDisableApz);
|
||||
WriteParam(aMsg, aParam.mDisregardedDirection);
|
||||
WriteParam(aMsg, aParam.mOverscrollBehavior);
|
||||
}
|
||||
|
||||
@ -317,10 +317,10 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
|
||||
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mScrollClip) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetHasScrollgrab) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetAllowVerticalScrollWithWheel) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetIsLayersIdRoot) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetUsesContainerScrolling) &&
|
||||
ReadBoolForBitfield(aMsg, aIter, aResult, ¶mType::SetForceDisableApz) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mDisregardedDirection) &&
|
||||
ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior));
|
||||
}
|
||||
};
|
||||
|
@ -394,19 +394,6 @@ GeckoRestyleManager::AttributeChanged(Element* aElement,
|
||||
tag == nsGkAtoms::listcell))
|
||||
return;
|
||||
}
|
||||
|
||||
if (aAttribute == nsGkAtoms::tooltiptext ||
|
||||
aAttribute == nsGkAtoms::tooltip)
|
||||
{
|
||||
nsIRootBox* rootBox = nsIRootBox::GetRootBox(PresContext()->GetPresShell());
|
||||
if (rootBox) {
|
||||
if (aModType == MutationEventBinding::REMOVAL)
|
||||
rootBox->RemoveTooltipSupport(aElement);
|
||||
if (aModType == MutationEventBinding::ADDITION)
|
||||
rootBox->AddTooltipSupport(aElement);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MOZ_XUL
|
||||
|
||||
if (primaryFrame) {
|
||||
|
@ -4275,19 +4275,6 @@ nsCSSFrameConstructor::ConstructFrameFromItemInternal(FrameConstructionItem& aIt
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
// More icky XUL stuff
|
||||
if (aItem.mNameSpaceID == kNameSpaceID_XUL &&
|
||||
(aItem.mTag == nsGkAtoms::treechildren || // trees always need titletips
|
||||
content->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltiptext) ||
|
||||
content->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::tooltip))) {
|
||||
nsIRootBox* rootBox = nsIRootBox::GetRootBox(mPresShell);
|
||||
if (rootBox) {
|
||||
rootBox->AddTooltipSupport(content);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) ==
|
||||
((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
|
||||
"Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits");
|
||||
|
@ -115,11 +115,11 @@
|
||||
#include "mozilla/layers/CompositorBridgeChild.h"
|
||||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/EventDispatcher.h"
|
||||
#include "mozilla/EventStateManager.h"
|
||||
#include "mozilla/RuleNodeCacheConditions.h"
|
||||
#include "mozilla/StyleAnimationValue.h"
|
||||
#include "mozilla/StyleSetHandle.h"
|
||||
#include "mozilla/StyleSetHandleInlines.h"
|
||||
#include "mozilla/WheelHandlingHelper.h" // for WheelHandlingUtils
|
||||
#include "RegionBuilder.h"
|
||||
#include "SVGViewportElement.h"
|
||||
#include "DisplayItemClip.h"
|
||||
@ -9403,10 +9403,10 @@ nsLayoutUtils::ComputeScrollMetadata(nsIFrame* aForFrame,
|
||||
LayoutDeviceIntSize::FromAppUnitsRounded(pageScrollAmount, presContext->AppUnitsPerDevPixel());
|
||||
metadata.SetPageScrollAmount(pageScrollAmountInDevPixels);
|
||||
|
||||
if (!aScrollFrame->GetParent() ||
|
||||
EventStateManager::CanVerticallyScrollFrameWithWheel(aScrollFrame->GetParent()))
|
||||
{
|
||||
metadata.SetAllowVerticalScrollWithWheel(true);
|
||||
if (aScrollFrame->GetParent()) {
|
||||
metadata.SetDisregardedDirection(
|
||||
WheelHandlingUtils::GetDisregardedWheelScrollDirection(
|
||||
aScrollFrame->GetParent()));
|
||||
}
|
||||
|
||||
metadata.SetUsesContainerScrolling(scrollableFrame->UsesContainerScrolling());
|
||||
|
@ -216,7 +216,7 @@ fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu)||skiaContent,1,800000) == fi
|
||||
== foreignObject-ancestor-style-change-01.svg foreignObject-ancestor-style-change-01-ref.svg
|
||||
== foreignObject-change-transform-01.svg pass.svg
|
||||
== foreignObject-display-01.svg pass.svg
|
||||
fuzzy-if(webrender,1,35) == foreignObject-form-theme.svg foreignObject-form-theme-ref.html
|
||||
fuzzy-if(webrender,190,229) == foreignObject-form-theme.svg foreignObject-form-theme-ref.html # Bug 1439980
|
||||
== foreignObject-img.html foreignObject-img-ref.html
|
||||
== foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html
|
||||
== foreignObject-move-repaint-01.svg pass.svg
|
||||
|
@ -267,12 +267,6 @@ function InitAndStartRefTests()
|
||||
g.focusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
|
||||
} catch(e) {}
|
||||
|
||||
try {
|
||||
g.startAfter = prefs.getCharPref("reftest.startAfter");
|
||||
} catch(e) {
|
||||
g.startAfter = undefined;
|
||||
}
|
||||
|
||||
try {
|
||||
g.compareRetainedDisplayLists = prefs.getBoolPref("reftest.compareRetainedDisplayLists");
|
||||
} catch (e) {}
|
||||
@ -509,7 +503,7 @@ function StartTests()
|
||||
g.urls = g.urls.slice(start, end);
|
||||
}
|
||||
|
||||
if (g.manageSuite && g.startAfter === undefined && !g.suiteStarted) {
|
||||
if (g.manageSuite && !g.suiteStarted) {
|
||||
var ids = g.urls.map(function(obj) {
|
||||
return obj.identifier;
|
||||
});
|
||||
@ -519,28 +513,10 @@ function StartTests()
|
||||
}
|
||||
|
||||
if (g.shuffle) {
|
||||
if (g.startAfter !== undefined) {
|
||||
logger.error("Can't resume from a crashed test when " +
|
||||
"--shuffle is enabled, continue by shuffling " +
|
||||
"all the tests");
|
||||
DoneTests();
|
||||
return;
|
||||
}
|
||||
Shuffle(g.urls);
|
||||
} else if (g.startAfter !== undefined) {
|
||||
// Skip through previously crashed test
|
||||
// We have to do this after chunking so we don't break the numbers
|
||||
var crash_idx = g.urls.map(function(url) {
|
||||
return url['url1']['spec'];
|
||||
}).indexOf(g.startAfter);
|
||||
if (crash_idx == -1) {
|
||||
throw "Can't find the previously crashed test";
|
||||
}
|
||||
g.urls = g.urls.slice(crash_idx + 1);
|
||||
}
|
||||
|
||||
g.totalTests = g.urls.length;
|
||||
|
||||
if (!g.totalTests && !g.verify)
|
||||
throw "No tests to run";
|
||||
|
||||
|
@ -143,12 +143,12 @@ class ReftestServer:
|
||||
|
||||
class RemoteReftest(RefTest):
|
||||
use_marionette = False
|
||||
parse_manifest = False
|
||||
remoteApp = ''
|
||||
resolver_cls = RemoteReftestResolver
|
||||
|
||||
def __init__(self, automation, devicemanager, options, scriptDir):
|
||||
RefTest.__init__(self)
|
||||
RefTest.__init__(self, options.suite)
|
||||
self.run_by_manifest = False
|
||||
self.automation = automation
|
||||
self._devicemanager = devicemanager
|
||||
self.scriptDir = scriptDir
|
||||
@ -259,17 +259,13 @@ class RemoteReftest(RefTest):
|
||||
# may not be able to access process info for all processes
|
||||
continue
|
||||
|
||||
def createReftestProfile(self, options, startAfter=None, **kwargs):
|
||||
def createReftestProfile(self, options, **kwargs):
|
||||
profile = RefTest.createReftestProfile(self,
|
||||
options,
|
||||
server=options.remoteWebServer,
|
||||
port=options.httpPort,
|
||||
**kwargs)
|
||||
if startAfter is not None:
|
||||
print ("WARNING: Continuing after a crash is not supported for remote "
|
||||
"reftest yet.")
|
||||
profileDir = profile.profile
|
||||
|
||||
prefs = {}
|
||||
prefs["app.update.url.android"] = ""
|
||||
prefs["browser.firstrun.show.localepicker"] = False
|
||||
@ -283,11 +279,6 @@ class RemoteReftest(RefTest):
|
||||
# reftest pages at 1.0 zoom, rather than zooming to fit the CSS viewport.
|
||||
prefs["apz.allow_zooming"] = False
|
||||
|
||||
if options.totalChunks:
|
||||
prefs['reftest.totalChunks'] = options.totalChunks
|
||||
if options.thisChunk:
|
||||
prefs['reftest.thisChunk'] = options.thisChunk
|
||||
|
||||
# Set the extra prefs.
|
||||
profile.set_preferences(prefs)
|
||||
|
||||
@ -353,21 +344,18 @@ class RemoteReftest(RefTest):
|
||||
env = self.buildBrowserEnv(options, profile.profile)
|
||||
|
||||
self.log.info("Running with e10s: {}".format(options.e10s))
|
||||
status, lastTestSeen = self.automation.runApp(None, env,
|
||||
binary,
|
||||
profile.profile,
|
||||
cmdargs,
|
||||
utilityPath=options.utilityPath,
|
||||
xrePath=options.xrePath,
|
||||
debuggerInfo=debuggerInfo,
|
||||
symbolsPath=symbolsPath,
|
||||
timeout=timeout)
|
||||
if status == 1:
|
||||
# when max run time exceeded, avoid restart
|
||||
lastTestSeen = RefTest.TEST_SEEN_FINAL
|
||||
status, self.lastTestSeen = self.automation.runApp(None, env,
|
||||
binary,
|
||||
profile.profile,
|
||||
cmdargs,
|
||||
utilityPath=options.utilityPath,
|
||||
xrePath=options.xrePath,
|
||||
debuggerInfo=debuggerInfo,
|
||||
symbolsPath=symbolsPath,
|
||||
timeout=timeout)
|
||||
|
||||
self.cleanup(profile.profile)
|
||||
return status, lastTestSeen, self.outputHandler.results
|
||||
return status
|
||||
|
||||
def cleanup(self, profileDir):
|
||||
# Pull results back from device
|
||||
|
@ -6,9 +6,7 @@
|
||||
Runs the reftest test harness.
|
||||
"""
|
||||
|
||||
import collections
|
||||
import copy
|
||||
import itertools
|
||||
import json
|
||||
import multiprocessing
|
||||
import os
|
||||
@ -20,6 +18,7 @@ import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
from collections import defaultdict
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
SCRIPT_DIRECTORY = os.path.abspath(
|
||||
@ -227,21 +226,23 @@ class ReftestResolver(object):
|
||||
|
||||
|
||||
class RefTest(object):
|
||||
TEST_SEEN_INITIAL = 'reftest'
|
||||
TEST_SEEN_FINAL = 'Main app process exited normally'
|
||||
oldcwd = os.getcwd()
|
||||
parse_manifest = True
|
||||
resolver_cls = ReftestResolver
|
||||
use_marionette = True
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, suite):
|
||||
update_mozinfo()
|
||||
self.lastTestSeen = self.TEST_SEEN_INITIAL
|
||||
self.lastTestSeen = None
|
||||
self.haveDumpedScreen = False
|
||||
self.resolver = self.resolver_cls()
|
||||
self.log = None
|
||||
self.outputHandler = None
|
||||
self.testDumpFile = os.path.join(tempfile.gettempdir(), 'reftests.json')
|
||||
|
||||
self.run_by_manifest = True
|
||||
if suite in ('crashtest', 'jstestbrowser'):
|
||||
self.run_by_manifest = False
|
||||
|
||||
def _populate_logger(self, options):
|
||||
if self.log:
|
||||
return
|
||||
@ -265,8 +266,7 @@ class RefTest(object):
|
||||
return os.path.normpath(os.path.join(self.oldcwd, os.path.expanduser(path)))
|
||||
|
||||
def createReftestProfile(self, options, tests=None, manifests=None,
|
||||
server='localhost', port=0, profile_to_clone=None,
|
||||
startAfter=None, prefs=None):
|
||||
server='localhost', port=0, profile_to_clone=None, prefs=None):
|
||||
"""Sets up a profile for reftest.
|
||||
|
||||
:param options: Object containing command line options
|
||||
@ -276,7 +276,6 @@ class RefTest(object):
|
||||
:param server: Server name to use for http tests
|
||||
:param profile_to_clone: Path to a profile to use as the basis for the
|
||||
test profile
|
||||
:param startAfter: Start running tests after the specified test id
|
||||
:param prefs: Extra preferences to set in the profile
|
||||
"""
|
||||
locations = mozprofile.permissions.ServerLocations()
|
||||
@ -306,16 +305,18 @@ class RefTest(object):
|
||||
prefs['reftest.logLevel'] = options.log_tbpl_level or 'info'
|
||||
prefs['reftest.suite'] = options.suite
|
||||
|
||||
if startAfter not in (None, self.TEST_SEEN_INITIAL, self.TEST_SEEN_FINAL):
|
||||
self.log.info("Setting reftest.startAfter to %s" % startAfter)
|
||||
prefs['reftest.startAfter'] = startAfter
|
||||
|
||||
# Unconditionally update the e10s pref.
|
||||
if options.e10s:
|
||||
prefs['browser.tabs.remote.autostart'] = True
|
||||
else:
|
||||
prefs['browser.tabs.remote.autostart'] = False
|
||||
|
||||
if not self.run_by_manifest:
|
||||
if options.totalChunks:
|
||||
prefs['reftest.totalChunks'] = options.totalChunks
|
||||
if options.thisChunk:
|
||||
prefs['reftest.thisChunk'] = options.thisChunk
|
||||
|
||||
# Bug 1262954: For winXP + e10s disable acceleration
|
||||
if platform.system() in ("Windows", "Microsoft") and \
|
||||
'5.1' in platform.version() and options.e10s:
|
||||
@ -532,6 +533,7 @@ class RefTest(object):
|
||||
def runTests(self, tests, options, cmdargs=None):
|
||||
cmdargs = cmdargs or []
|
||||
self._populate_logger(options)
|
||||
self.outputHandler = OutputHandler(self.log, options.utilityPath, options.symbolsPath)
|
||||
|
||||
if options.cleanupCrashes:
|
||||
mozcrash.cleanup_pending_crash_reports()
|
||||
@ -603,7 +605,7 @@ class RefTest(object):
|
||||
focusThread.join()
|
||||
|
||||
# Output the summaries that the ReftestThread filters suppressed.
|
||||
summaryObjects = [collections.defaultdict(int) for s in summaryLines]
|
||||
summaryObjects = [defaultdict(int) for s in summaryLines]
|
||||
for t in threads:
|
||||
for (summaryObj, (text, categories)) in zip(summaryObjects, summaryLines):
|
||||
threadMatches = t.summaryMatches[text]
|
||||
@ -677,6 +679,7 @@ class RefTest(object):
|
||||
|
||||
if cmdargs is None:
|
||||
cmdargs = []
|
||||
cmdargs = cmdargs[:]
|
||||
|
||||
if self.use_marionette:
|
||||
cmdargs.append('-marionette')
|
||||
@ -709,19 +712,17 @@ class RefTest(object):
|
||||
|
||||
self.log.add_handler(record_last_test)
|
||||
|
||||
outputHandler = OutputHandler(self.log, options.utilityPath, symbolsPath=symbolsPath)
|
||||
|
||||
kp_kwargs = {
|
||||
'kill_on_timeout': False,
|
||||
'cwd': SCRIPT_DIRECTORY,
|
||||
'onTimeout': [timeoutHandler],
|
||||
'processOutputLine': [outputHandler],
|
||||
'processOutputLine': [self.outputHandler],
|
||||
}
|
||||
|
||||
if mozinfo.isWin:
|
||||
# Prevents log interleaving on Windows at the expense of losing
|
||||
# true log order. See bug 798300 and bug 1324961 for more details.
|
||||
kp_kwargs['processStderrLine'] = [outputHandler]
|
||||
kp_kwargs['processStderrLine'] = [self.outputHandler]
|
||||
|
||||
if interactive:
|
||||
# If an interactive debugger is attached,
|
||||
@ -741,7 +742,7 @@ class RefTest(object):
|
||||
interactive=interactive,
|
||||
outputTimeout=timeout)
|
||||
proc = runner.process_handler
|
||||
outputHandler.proc_name = 'GECKO({})'.format(proc.pid)
|
||||
self.outputHandler.proc_name = 'GECKO({})'.format(proc.pid)
|
||||
|
||||
# Used to defer a possible IOError exception from Marionette
|
||||
marionette_exception = None
|
||||
@ -778,18 +779,16 @@ class RefTest(object):
|
||||
|
||||
status = runner.wait()
|
||||
runner.process_handler = None
|
||||
outputHandler.proc_name = None
|
||||
self.outputHandler.proc_name = None
|
||||
|
||||
if status:
|
||||
msg = "TEST-UNEXPECTED-FAIL | %s | application terminated with exit code %s" % \
|
||||
(self.lastTestSeen, status)
|
||||
(self.lastTestSeen, status)
|
||||
# use process_output so message is logged verbatim
|
||||
self.log.process_output(None, msg)
|
||||
else:
|
||||
self.lastTestSeen = self.TEST_SEEN_FINAL
|
||||
|
||||
crashed = mozcrash.log_crashes(self.log, os.path.join(profile.profile, 'minidumps'),
|
||||
symbolsPath, test=self.lastTestSeen)
|
||||
options.symbolsPath, test=self.lastTestSeen)
|
||||
if not status and crashed:
|
||||
status = 1
|
||||
|
||||
@ -801,7 +800,7 @@ class RefTest(object):
|
||||
raise exc, value, tb
|
||||
|
||||
self.log.info("Process mode: {}".format('e10s' if options.e10s else 'non-e10s'))
|
||||
return status, self.lastTestSeen, outputHandler.results
|
||||
return status
|
||||
|
||||
def getActiveTests(self, manifests, options, testDumpFile=None):
|
||||
# These prefs will cause reftest.jsm to parse the manifests,
|
||||
@ -810,8 +809,8 @@ class RefTest(object):
|
||||
'reftest.manifests': json.dumps(manifests),
|
||||
'reftest.manifests.dumpTests': testDumpFile or self.testDumpFile,
|
||||
}
|
||||
cmdargs = [] # ['-headless']
|
||||
status, _, _ = self.runApp(options, cmdargs=cmdargs, prefs=prefs)
|
||||
cmdargs = []
|
||||
self.runApp(options, cmdargs=cmdargs, prefs=prefs)
|
||||
|
||||
with open(self.testDumpFile, 'r') as fh:
|
||||
tests = json.load(fh)
|
||||
@ -828,7 +827,7 @@ class RefTest(object):
|
||||
|
||||
filters = []
|
||||
if options.totalChunks:
|
||||
filters.append(mpf.chunk_by_slice(options.thisChunk, options.totalChunks))
|
||||
filters.append(mpf.chunk_by_manifest(options.thisChunk, options.totalChunks))
|
||||
|
||||
tests = mp.active_tests(exists=False, filters=filters)
|
||||
return tests
|
||||
@ -839,19 +838,9 @@ class RefTest(object):
|
||||
debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
|
||||
options.debuggerInteractive)
|
||||
|
||||
tests = None
|
||||
if self.parse_manifest:
|
||||
tests = self.getActiveTests(manifests, options)
|
||||
|
||||
ids = [t['identifier'] for t in tests]
|
||||
self.log.suite_start(ids, name=options.suite)
|
||||
|
||||
startAfter = None # When the previous run crashed, we skip the tests we ran before
|
||||
prevStartAfter = None
|
||||
for i in itertools.count():
|
||||
status, startAfter, results = self.runApp(
|
||||
def run(**kwargs):
|
||||
status = self.runApp(
|
||||
options,
|
||||
tests=tests,
|
||||
manifests=manifests,
|
||||
cmdargs=cmdargs,
|
||||
# We generally want the JS harness or marionette
|
||||
@ -865,42 +854,35 @@ class RefTest(object):
|
||||
# the 360 second marionette socket timeout.
|
||||
# See bug 479518 and bug 1414063.
|
||||
timeout=options.timeout + 70.0,
|
||||
symbolsPath=options.symbolsPath,
|
||||
debuggerInfo=debuggerInfo
|
||||
)
|
||||
debuggerInfo=debuggerInfo,
|
||||
**kwargs)
|
||||
|
||||
mozleak.process_leak_log(self.leakLogFile,
|
||||
leak_thresholds=options.leakThresholds,
|
||||
stack_fixer=get_stack_fixer_function(options.utilityPath,
|
||||
options.symbolsPath))
|
||||
return status
|
||||
|
||||
if status == 0:
|
||||
break
|
||||
if not self.run_by_manifest:
|
||||
return run()
|
||||
|
||||
if startAfter == self.TEST_SEEN_FINAL:
|
||||
self.log.info("Finished running all tests, skipping resume "
|
||||
"despite non-zero status code: %s" % status)
|
||||
break
|
||||
tests = self.getActiveTests(manifests, options)
|
||||
tests_by_manifest = defaultdict(list)
|
||||
ids_by_manifest = defaultdict(list)
|
||||
for t in tests:
|
||||
tests_by_manifest[t['manifest']].append(t)
|
||||
ids_by_manifest[t['manifest']].append(t['identifier'])
|
||||
|
||||
if startAfter is not None and options.shuffle:
|
||||
self.log.error("Can not resume from a crash with --shuffle "
|
||||
"enabled. Please consider disabling --shuffle")
|
||||
break
|
||||
if startAfter is not None and options.maxRetries <= i:
|
||||
self.log.error("Hit maximum number of allowed retries ({}) "
|
||||
"in the test run".format(options.maxRetries))
|
||||
break
|
||||
if startAfter == prevStartAfter:
|
||||
# If the test stuck on the same test, or there the crashed
|
||||
# test appeared more then once, stop
|
||||
self.log.error("Force stop because we keep running into "
|
||||
"test \"{}\"".format(startAfter))
|
||||
break
|
||||
prevStartAfter = startAfter
|
||||
# TODO: we need to emit an SUITE-END log if it crashed
|
||||
self.log.suite_start(ids_by_manifest, name=options.suite)
|
||||
|
||||
if self.parse_manifest:
|
||||
self.log.suite_end(extra={'results': results})
|
||||
return status
|
||||
overall = 0
|
||||
for manifest, tests in tests_by_manifest.items():
|
||||
self.log.info("Running tests in {}".format(manifest))
|
||||
status = run(tests=tests)
|
||||
overall = overall or status
|
||||
|
||||
self.log.suite_end(extra={'results': self.outputHandler.results})
|
||||
return overall
|
||||
|
||||
def copyExtraFilesToProfile(self, options, profile):
|
||||
"Copy extra files or dirs specified on the command line to the testing profile."
|
||||
@ -928,7 +910,7 @@ class RefTest(object):
|
||||
|
||||
|
||||
def run_test_harness(parser, options):
|
||||
reftest = RefTest()
|
||||
reftest = RefTest(options.suite)
|
||||
parser.validate(options, reftest)
|
||||
|
||||
# We have to validate options.app here for the case when the mach
|
||||
|
@ -30,9 +30,6 @@ public:
|
||||
virtual mozilla::dom::Element* GetDefaultTooltip() = 0;
|
||||
virtual void SetDefaultTooltip(mozilla::dom::Element* aTooltip) = 0;
|
||||
|
||||
virtual nsresult AddTooltipSupport(nsIContent* aNode) = 0;
|
||||
virtual nsresult RemoveTooltipSupport(nsIContent* aNode) = 0;
|
||||
|
||||
static nsIRootBox* GetRootBox(nsIPresShell* aShell);
|
||||
};
|
||||
|
||||
|
@ -12,7 +12,6 @@
|
||||
#include "nsStackLayout.h"
|
||||
#include "nsIRootBox.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsXULTooltipListener.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "mozilla/BasicEvents.h"
|
||||
|
||||
@ -57,8 +56,6 @@ public:
|
||||
virtual void SetPopupSetFrame(nsPopupSetFrame* aPopupSet) override;
|
||||
virtual Element* GetDefaultTooltip() override;
|
||||
virtual void SetDefaultTooltip(Element* aTooltip) override;
|
||||
virtual nsresult AddTooltipSupport(nsIContent* aNode) override;
|
||||
virtual nsresult RemoveTooltipSupport(nsIContent* aNode) override;
|
||||
|
||||
virtual void AppendFrames(ChildListID aListID,
|
||||
nsFrameList& aFrameList) override;
|
||||
@ -243,28 +240,6 @@ nsRootBoxFrame::SetDefaultTooltip(Element* aTooltip)
|
||||
mDefaultTooltip = aTooltip;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsRootBoxFrame::AddTooltipSupport(nsIContent* aNode)
|
||||
{
|
||||
NS_ENSURE_TRUE(aNode, NS_ERROR_NULL_POINTER);
|
||||
|
||||
nsXULTooltipListener *listener = nsXULTooltipListener::GetInstance();
|
||||
if (!listener)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
return listener->AddTooltipSupport(aNode);
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsRootBoxFrame::RemoveTooltipSupport(nsIContent* aNode)
|
||||
{
|
||||
// XXjh yuck, I'll have to implement a way to get at
|
||||
// the tooltip listener for a given node to make
|
||||
// this work. Not crucial, we aren't removing
|
||||
// tooltips from any nodes in the app just yet.
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_QUERYFRAME_HEAD(nsRootBoxFrame)
|
||||
NS_QUERYFRAME_ENTRY(nsIRootBox)
|
||||
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)
|
||||
|
@ -35,7 +35,7 @@
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
nsXULTooltipListener* nsXULTooltipListener::mInstance = nullptr;
|
||||
nsXULTooltipListener* nsXULTooltipListener::sInstance = nullptr;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//// nsISupports
|
||||
@ -50,28 +50,26 @@ nsXULTooltipListener::nsXULTooltipListener()
|
||||
, mLastTreeRow(-1)
|
||||
#endif
|
||||
{
|
||||
if (sTooltipListenerCount++ == 0) {
|
||||
// register the callback so we get notified of updates
|
||||
Preferences::RegisterCallback(ToolbarTipsPrefChanged,
|
||||
"browser.chrome.toolbar_tips");
|
||||
// FIXME(emilio): This can be faster, this should use BoolVarCache.
|
||||
//
|
||||
// register the callback so we get notified of updates
|
||||
Preferences::RegisterCallback(ToolbarTipsPrefChanged,
|
||||
"browser.chrome.toolbar_tips");
|
||||
|
||||
// Call the pref callback to initialize our state.
|
||||
ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nullptr);
|
||||
}
|
||||
// Call the pref callback to initialize our state.
|
||||
ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nullptr);
|
||||
}
|
||||
|
||||
nsXULTooltipListener::~nsXULTooltipListener()
|
||||
{
|
||||
if (nsXULTooltipListener::mInstance == this) {
|
||||
ClearTooltipCache();
|
||||
}
|
||||
MOZ_ASSERT(sInstance == this);
|
||||
sInstance = nullptr;
|
||||
|
||||
HideTooltip();
|
||||
|
||||
if (--sTooltipListenerCount == 0) {
|
||||
// Unregister our pref observer
|
||||
Preferences::UnregisterCallback(ToolbarTipsPrefChanged,
|
||||
"browser.chrome.toolbar_tips");
|
||||
}
|
||||
// Unregister our pref observer
|
||||
Preferences::UnregisterCallback(ToolbarTipsPrefChanged,
|
||||
"browser.chrome.toolbar_tips");
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsXULTooltipListener, nsIDOMEventListener)
|
||||
@ -295,13 +293,12 @@ nsXULTooltipListener::ToolbarTipsPrefChanged(const char *aPref,
|
||||
//// nsXULTooltipListener
|
||||
|
||||
bool nsXULTooltipListener::sShowTooltips = false;
|
||||
uint32_t nsXULTooltipListener::sTooltipListenerCount = 0;
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsXULTooltipListener::AddTooltipSupport(nsIContent* aNode)
|
||||
{
|
||||
if (!aNode)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
MOZ_ASSERT(aNode);
|
||||
MOZ_ASSERT(this == sInstance);
|
||||
|
||||
aNode->AddSystemEventListener(NS_LITERAL_STRING("mouseout"), this,
|
||||
false, false);
|
||||
@ -313,23 +310,22 @@ nsXULTooltipListener::AddTooltipSupport(nsIContent* aNode)
|
||||
false, false);
|
||||
aNode->AddSystemEventListener(NS_LITERAL_STRING("dragstart"), this,
|
||||
true, false);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
void
|
||||
nsXULTooltipListener::RemoveTooltipSupport(nsIContent* aNode)
|
||||
{
|
||||
if (!aNode)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
MOZ_ASSERT(aNode);
|
||||
MOZ_ASSERT(this == sInstance);
|
||||
|
||||
// The last reference to us can go after some of these calls.
|
||||
RefPtr<nsXULTooltipListener> instance = this;
|
||||
|
||||
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mouseout"), this, false);
|
||||
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousemove"), this, false);
|
||||
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"), this, false);
|
||||
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mouseup"), this, false);
|
||||
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("dragstart"), this, true);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
@ -713,7 +709,7 @@ nsXULTooltipListener::KillTooltipTimer()
|
||||
void
|
||||
nsXULTooltipListener::sTooltipCallback(nsITimer *aTimer, void *aListener)
|
||||
{
|
||||
RefPtr<nsXULTooltipListener> instance = mInstance;
|
||||
RefPtr<nsXULTooltipListener> instance = sInstance;
|
||||
if (instance)
|
||||
instance->ShowTooltip();
|
||||
}
|
||||
|
@ -31,14 +31,13 @@ public:
|
||||
void MouseOut(nsIDOMEvent* aEvent);
|
||||
void MouseMove(nsIDOMEvent* aEvent);
|
||||
|
||||
nsresult AddTooltipSupport(nsIContent* aNode);
|
||||
nsresult RemoveTooltipSupport(nsIContent* aNode);
|
||||
void AddTooltipSupport(nsIContent* aNode);
|
||||
void RemoveTooltipSupport(nsIContent* aNode);
|
||||
static nsXULTooltipListener* GetInstance() {
|
||||
if (!mInstance)
|
||||
mInstance = new nsXULTooltipListener();
|
||||
return mInstance;
|
||||
if (!sInstance)
|
||||
sInstance = new nsXULTooltipListener();
|
||||
return sInstance;
|
||||
}
|
||||
static void ClearTooltipCache() { mInstance = nullptr; }
|
||||
|
||||
protected:
|
||||
|
||||
@ -47,7 +46,6 @@ protected:
|
||||
|
||||
// pref callback for when the "show tooltips" pref changes
|
||||
static bool sShowTooltips;
|
||||
static uint32_t sTooltipListenerCount;
|
||||
|
||||
void KillTooltipTimer();
|
||||
|
||||
@ -66,7 +64,7 @@ protected:
|
||||
// can be really used (i.e. tooltip is not a menu).
|
||||
nsresult GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip);
|
||||
|
||||
static nsXULTooltipListener* mInstance;
|
||||
static nsXULTooltipListener* sInstance;
|
||||
static void ToolbarTipsPrefChanged(const char *aPref, void *aClosure);
|
||||
|
||||
nsWeakPtr mSourceNode;
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "transportlayerice.h"
|
||||
|
||||
#include "webrtc/base/bind.h"
|
||||
#include "webrtc/base/keep_ref_until_done.h"
|
||||
#include "webrtc/common_types.h"
|
||||
#include "webrtc/common_video/include/i420_buffer_pool.h"
|
||||
#include "webrtc/common_video/include/video_frame_buffer.h"
|
||||
@ -342,7 +343,6 @@ protected:
|
||||
uint32_t width = aImage->GetSize().width;
|
||||
uint32_t height = aImage->GetSize().height;
|
||||
|
||||
rtc::Callback0<void> callback_unused;
|
||||
rtc::scoped_refptr<webrtc::WrappedI420Buffer> video_frame_buffer(
|
||||
new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
|
||||
width,
|
||||
@ -353,7 +353,7 @@ protected:
|
||||
cbCrStride,
|
||||
cr,
|
||||
cbCrStride,
|
||||
callback_unused));
|
||||
rtc::KeepRefUntilDone(aImage)));
|
||||
|
||||
webrtc::VideoFrame i420_frame(video_frame_buffer,
|
||||
0,
|
||||
|
@ -12,12 +12,10 @@
|
||||
*/
|
||||
var EXPORTED_SYMBOLS = ["EnsureFxAccountsWebChannel"];
|
||||
|
||||
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; /* global Components */
|
||||
|
||||
ChromeUtils.import("resource://gre/modules/Accounts.jsm"); /* global Accounts */
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm"); /* global Services */
|
||||
ChromeUtils.import("resource://gre/modules/WebChannel.jsm"); /* global WebChannel */
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); /* global XPCOMUtils */
|
||||
ChromeUtils.import("resource://gre/modules/Accounts.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/WebChannel.jsm");
|
||||
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
|
||||
|
||||
const log = ChromeUtils.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("FxAccounts");
|
||||
|
||||
@ -34,7 +32,7 @@ const COMMAND_SYNC_PREFERENCES = "fxaccounts:sync_preferences";
|
||||
const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "strings",
|
||||
() => Services.strings.createBundle("chrome://browser/locale/aboutAccounts.properties")); /* global strings */
|
||||
() => Services.strings.createBundle("chrome://browser/locale/aboutAccounts.properties"));
|
||||
|
||||
ChromeUtils.defineModuleGetter(this, "Snackbars", "resource://gre/modules/Snackbars.jsm");
|
||||
ChromeUtils.defineModuleGetter(this, "Prompt", "resource://gre/modules/Prompt.jsm");
|
||||
|
@ -196,7 +196,7 @@ interface nsIIOService : nsISupports
|
||||
* is provided purely as an optimization.
|
||||
*
|
||||
* @param aSpec the URL string to parse
|
||||
* @return URL scheme
|
||||
* @return URL scheme, lowercase
|
||||
*
|
||||
* @throws NS_ERROR_MALFORMED_URI if URL string is not of the right form.
|
||||
*/
|
||||
|
@ -296,7 +296,6 @@ nsSimpleURI::SetSpecInternal(const nsACString &aSpec)
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
ToLowerCase(mScheme);
|
||||
|
||||
nsAutoCString spec;
|
||||
rv = net_FilterAndEscapeURI(aSpec, esc_OnlyNonASCII, spec);
|
||||
|
@ -525,6 +525,7 @@ net_ExtractURLScheme(const nsACString &inURI,
|
||||
|
||||
p.Claim(scheme);
|
||||
scheme.StripTaggedASCII(ASCIIMask::MaskCRLFTab());
|
||||
ToLowerCase(scheme);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ bool net_IsAbsoluteURL(const nsACString& inURL);
|
||||
* Extract URI-Scheme if possible
|
||||
*
|
||||
* @param inURI URI spec
|
||||
* @param scheme scheme copied to this buffer on return (may be null)
|
||||
* @param scheme scheme copied to this buffer on return. Is lowercase.
|
||||
*/
|
||||
nsresult net_ExtractURLScheme(const nsACString &inURI,
|
||||
nsACString &scheme);
|
||||
|
@ -276,7 +276,7 @@ nsHttpConnection::Start0RTTSpdy(uint8_t spdyVersion)
|
||||
}
|
||||
|
||||
void
|
||||
nsHttpConnection::StartSpdy(uint8_t spdyVersion)
|
||||
nsHttpConnection::StartSpdy(nsISSLSocketControl *sslControl, uint8_t spdyVersion)
|
||||
{
|
||||
LOG(("nsHttpConnection::StartSpdy [this=%p, mDid0RTTSpdy=%d]\n", this, mDid0RTTSpdy));
|
||||
|
||||
@ -285,6 +285,9 @@ nsHttpConnection::StartSpdy(uint8_t spdyVersion)
|
||||
|
||||
mUsingSpdyVersion = spdyVersion;
|
||||
mEverUsedSpdy = true;
|
||||
if (sslControl) {
|
||||
sslControl->SetDenyClientCert(true);
|
||||
}
|
||||
|
||||
if (!mDid0RTTSpdy) {
|
||||
mSpdySession = ASpdySession::NewSpdySession(spdyVersion, mSocketTransport,
|
||||
@ -548,7 +551,7 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
|
||||
uint32_t infoIndex;
|
||||
const SpdyInformation *info = gHttpHandler->SpdyInfo();
|
||||
if (NS_SUCCEEDED(info->GetNPNIndex(negotiatedNPN, &infoIndex))) {
|
||||
StartSpdy(info->Version[infoIndex]);
|
||||
StartSpdy(ssl, info->Version[infoIndex]);
|
||||
}
|
||||
} else {
|
||||
LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - %" PRId64 " bytes "
|
||||
@ -559,7 +562,7 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
|
||||
// spdy, since we know we're sticking with it.
|
||||
LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - finishing "
|
||||
"StartSpdy for 0rtt spdy session %p", this, mSpdySession.get()));
|
||||
StartSpdy(mSpdySession->SpdyVersion());
|
||||
StartSpdy(ssl, mSpdySession->SpdyVersion());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -272,7 +272,7 @@ private:
|
||||
void SetupSSL();
|
||||
|
||||
// Start the Spdy transaction handler when NPN indicates spdy/*
|
||||
void StartSpdy(uint8_t versionLevel);
|
||||
void StartSpdy(nsISSLSocketControl *ssl, uint8_t versionLevel);
|
||||
// Like the above, but do the bare minimum to do 0RTT data, so we can back
|
||||
// it out, if necessary
|
||||
void Start0RTTSpdy(uint8_t versionLevel);
|
||||
|
@ -57,7 +57,7 @@ nsViewSourceChannel::Init(nsIURI* uri)
|
||||
return rv;
|
||||
|
||||
// prevent viewing source of javascript URIs (see bug 204779)
|
||||
if (scheme.LowerCaseEqualsLiteral("javascript")) {
|
||||
if (scheme.EqualsLiteral("javascript")) {
|
||||
NS_WARNING("blocking view-source:javascript:");
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
@ -130,6 +130,12 @@ interface nsISSLSocketControl : nsISupports {
|
||||
|
||||
[infallible] readonly attribute short MACAlgorithmUsed;
|
||||
|
||||
/**
|
||||
* If set to true before the server requests a client cert
|
||||
* no cert will be sent.
|
||||
*/
|
||||
[noscript] attribute boolean denyClientCert;
|
||||
|
||||
/**
|
||||
* If set before the server requests a client cert (assuming it does so at
|
||||
* all), then this cert will be presented to the server, instead of asking
|
||||
|
11
netwerk/test/unit/test_ioservice.js
Normal file
11
netwerk/test/unit/test_ioservice.js
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import('resource://gre/modules/Services.jsm');
|
||||
|
||||
add_task(function test_extractScheme(){
|
||||
equal(Services.io.extractScheme("HtTp://example.com"), "http");
|
||||
Assert.throws(() => { Services.io.extractScheme("://example.com"); },
|
||||
/NS_ERROR_MALFORMED_URI/, "missing scheme");
|
||||
Assert.throws(() => { Services.io.extractScheme("ht%tp://example.com"); },
|
||||
/NS_ERROR_MALFORMED_URI/, "bad scheme");
|
||||
});
|
@ -418,3 +418,4 @@ run-sequentially = node server exceptions dont replay well
|
||||
[test_trr.js]
|
||||
# http2-using tests require node available
|
||||
skip-if = os == "android"
|
||||
[test_ioservice.js]
|
||||
|
@ -120,6 +120,7 @@ nsNSSSocketInfo::nsNSSSocketInfo(SharedSSLState& aState, uint32_t providerFlags,
|
||||
mPreliminaryHandshakeDone(false),
|
||||
mNPNCompleted(false),
|
||||
mEarlyDataAccepted(false),
|
||||
mDenyClientCert(false),
|
||||
mFalseStartCallbackCalled(false),
|
||||
mFalseStarted(false),
|
||||
mIsFullHandshake(false),
|
||||
@ -395,6 +396,20 @@ nsNSSSocketInfo::SetEarlyDataAccepted(bool aAccepted)
|
||||
mEarlyDataAccepted = aAccepted;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNSSSocketInfo::GetDenyClientCert(bool* aDenyClientCert)
|
||||
{
|
||||
*aDenyClientCert = mDenyClientCert;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNSSSocketInfo::SetDenyClientCert(bool aDenyClientCert)
|
||||
{
|
||||
mDenyClientCert = aDenyClientCert;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNSSSocketInfo::DriveHandshake()
|
||||
{
|
||||
@ -2146,6 +2161,14 @@ nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket,
|
||||
return SECFailure;
|
||||
}
|
||||
|
||||
if (info->GetDenyClientCert()) {
|
||||
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
|
||||
("[%p] Not returning client cert due to denyClientCert attribute\n", socket));
|
||||
*pRetCert = nullptr;
|
||||
*pRetKey = nullptr;
|
||||
return SECSuccess;
|
||||
}
|
||||
|
||||
if (info->GetJoined()) {
|
||||
// We refuse to send a client certificate when there are multiple hostnames
|
||||
// joined on this connection, because we only show the user one hostname
|
||||
|
@ -73,6 +73,7 @@ public:
|
||||
bool IsFullHandshake() const { return mIsFullHandshake; }
|
||||
|
||||
bool GetJoined() { return mJoined; }
|
||||
bool GetDenyClientCert() { return mDenyClientCert; }
|
||||
void SetSentClientCert() { mSentClientCert = true; }
|
||||
|
||||
uint32_t GetProviderFlags() const { return mProviderFlags; }
|
||||
@ -185,6 +186,7 @@ private:
|
||||
nsCString mNegotiatedNPN;
|
||||
bool mNPNCompleted;
|
||||
bool mEarlyDataAccepted;
|
||||
bool mDenyClientCert;
|
||||
bool mFalseStartCallbackCalled;
|
||||
bool mFalseStarted;
|
||||
bool mIsFullHandshake;
|
||||
|
@ -1067,48 +1067,6 @@ add_task(async function test_onLivemarkDeleted() {
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_onItemMoved() {
|
||||
_("Items moved via the synchronous API should be tracked");
|
||||
|
||||
try {
|
||||
let fx_id = PlacesUtils.bookmarks.insertBookmark(
|
||||
PlacesUtils.bookmarks.bookmarksMenuFolder,
|
||||
CommonUtils.makeURI("http://getfirefox.com"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"Get Firefox!");
|
||||
let fx_guid = await PlacesUtils.promiseItemGuid(fx_id);
|
||||
_("Firefox GUID: " + fx_guid);
|
||||
let tb_id = PlacesUtils.bookmarks.insertBookmark(
|
||||
PlacesUtils.bookmarks.bookmarksMenuFolder,
|
||||
CommonUtils.makeURI("http://getthunderbird.com"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"Get Thunderbird!");
|
||||
let tb_guid = await PlacesUtils.promiseItemGuid(tb_id);
|
||||
_("Thunderbird GUID: " + tb_guid);
|
||||
|
||||
await startTracking();
|
||||
|
||||
// Moving within the folder will just track the folder.
|
||||
PlacesUtils.bookmarks.moveItem(
|
||||
tb_id, PlacesUtils.bookmarks.bookmarksMenuFolder, 0);
|
||||
await verifyTrackedItems(["menu"]);
|
||||
Assert.equal(tracker.score, SCORE_INCREMENT_XLARGE);
|
||||
await resetTracker();
|
||||
await PlacesTestUtils.markBookmarksAsSynced();
|
||||
|
||||
// Moving a bookmark to a different folder will track the old
|
||||
// folder, the new folder and the bookmark.
|
||||
PlacesUtils.bookmarks.moveItem(fx_id, PlacesUtils.bookmarks.toolbarFolder,
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
await verifyTrackedItems(["menu", "toolbar", fx_guid]);
|
||||
Assert.equal(tracker.score, SCORE_INCREMENT_XLARGE);
|
||||
|
||||
} finally {
|
||||
_("Clean up.");
|
||||
await cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
add_task(async function test_async_onItemMoved_update() {
|
||||
_("Items moved via the asynchronous API should be tracked");
|
||||
|
||||
@ -1263,38 +1221,42 @@ add_task(async function test_treeMoved() {
|
||||
|
||||
try {
|
||||
// Create a couple of parent folders.
|
||||
let folder1_id = PlacesUtils.bookmarks.createFolder(
|
||||
PlacesUtils.bookmarks.bookmarksMenuFolder,
|
||||
"First test folder",
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
let folder1_guid = await PlacesUtils.promiseItemGuid(folder1_id);
|
||||
let folder1 = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid,
|
||||
test: "First test folder",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER
|
||||
});
|
||||
|
||||
// A second folder in the first.
|
||||
let folder2_id = PlacesUtils.bookmarks.createFolder(
|
||||
folder1_id,
|
||||
"Second test folder",
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX);
|
||||
let folder2_guid = await PlacesUtils.promiseItemGuid(folder2_id);
|
||||
let folder2 = await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: folder1.guid,
|
||||
title: "Second test folder",
|
||||
type: PlacesUtils.bookmarks.TYPE_FOLDER
|
||||
});
|
||||
|
||||
// Create a couple of bookmarks in the second folder.
|
||||
PlacesUtils.bookmarks.insertBookmark(
|
||||
folder2_id,
|
||||
CommonUtils.makeURI("http://getfirefox.com"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"Get Firefox!");
|
||||
PlacesUtils.bookmarks.insertBookmark(
|
||||
folder2_id,
|
||||
CommonUtils.makeURI("http://getthunderbird.com"),
|
||||
PlacesUtils.bookmarks.DEFAULT_INDEX,
|
||||
"Get Thunderbird!");
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: folder2.guid,
|
||||
url: "http://getfirefox.com",
|
||||
title: "Get Firefox!"
|
||||
});
|
||||
await PlacesUtils.bookmarks.insert({
|
||||
parentGuid: folder2.guid,
|
||||
url: "http://getthunderbird.com",
|
||||
title: "Get Thunderbird!"
|
||||
});
|
||||
|
||||
await startTracking();
|
||||
|
||||
// Move folder 2 to be a sibling of folder1.
|
||||
PlacesUtils.bookmarks.moveItem(
|
||||
folder2_id, PlacesUtils.bookmarks.bookmarksMenuFolder, 0);
|
||||
await PlacesUtils.bookmarks.update({
|
||||
guid: folder2.guid,
|
||||
parentGuid: PlacesUtils.bookmarks.menuGuid,
|
||||
index: 0
|
||||
});
|
||||
|
||||
// the menu and both folders should be tracked, the children should not be.
|
||||
await verifyTrackedItems(["menu", folder1_guid, folder2_guid]);
|
||||
await verifyTrackedItems(["menu", folder1.guid, folder2.guid]);
|
||||
Assert.equal(tracker.score, SCORE_INCREMENT_XLARGE);
|
||||
} finally {
|
||||
_("Clean up.");
|
||||
|
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
var EXPORTED_SYMBOLS = [
|
||||
"ACTIONS", "Addons", "Addresses", "Bookmarks",
|
||||
"ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards",
|
||||
"Formdata", "History", "Passwords", "Prefs",
|
||||
"Tabs", "TPS", "Windows"
|
||||
];
|
||||
|
@ -309,22 +309,6 @@ impl PropertyAnimation {
|
||||
}
|
||||
result
|
||||
}
|
||||
TransitionProperty::All => {
|
||||
TransitionProperty::each(|longhand_id| {
|
||||
let animation = PropertyAnimation::from_longhand(
|
||||
longhand_id,
|
||||
timing_function,
|
||||
duration,
|
||||
old_style,
|
||||
new_style,
|
||||
);
|
||||
|
||||
if let Some(animation) = animation {
|
||||
result.push(animation);
|
||||
}
|
||||
});
|
||||
result
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user