Merge autoland to mozilla-central. a=merge

This commit is contained in:
Tiberius Oros 2018-02-27 00:18:03 +02:00
commit 22d5a6c371
141 changed files with 1844 additions and 2378 deletions

View File

@ -62,7 +62,7 @@ module.exports = {
"no-unused-vars": ["error", { "no-unused-vars": ["error", {
"args": "none", "args": "none",
"vars": "local", "vars": "local",
"varsIgnorePattern": "^Cc|Ci|Cu|Cr|EXPORTED_SYMBOLS" "varsIgnorePattern": "^EXPORTED_SYMBOLS$"
}] }]
} }
}, { }, {

View File

@ -537,11 +537,11 @@ const gStoragePressureObserver = {
} else { } else {
// The firefox-used space >= 5GB, then guide users to about:preferences // The firefox-used space >= 5GB, then guide users to about:preferences
// to clear some data stored on firefox by websites. // 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 prefButtonLabelStringID = "spaceAlert.over5GB.prefButton.label";
let prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButton.accesskey"; let prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButton.accesskey";
if (AppConstants.platform == "win") { if (AppConstants.platform == "win") {
descriptionStringID = "spaceAlert.over5GB.messageWin"; descriptionStringID = "spaceAlert.over5GB.messageWin1";
prefButtonLabelStringID = "spaceAlert.over5GB.prefButtonWin.label"; prefButtonLabelStringID = "spaceAlert.over5GB.prefButtonWin.label";
prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButtonWin.accesskey"; prefButtonAccesskeyStringID = "spaceAlert.over5GB.prefButtonWin.accesskey";
} }
@ -553,7 +553,7 @@ const gStoragePressureObserver = {
// The advanced subpanes are only supported in the old organization, which will // The advanced subpanes are only supported in the old organization, which will
// be removed by bug 1349689. // be removed by bug 1349689.
let win = gBrowser.ownerGlobal; let win = gBrowser.ownerGlobal;
win.openPreferences("panePrivacy", { origin: "storagePressure" }); win.openPreferences("privacy-sitedata", { origin: "storagePressure" });
} }
}); });
} }
@ -6076,7 +6076,7 @@ function stripUnsafeProtocolOnPaste(pasteData) {
try { try {
scheme = Services.io.extractScheme(pasteData); scheme = Services.io.extractScheme(pasteData);
} catch (ex) { } } catch (ex) { }
if (scheme.toLowerCase() != "javascript") { if (scheme != "javascript") {
break; break;
} }

View File

@ -203,7 +203,7 @@ async function getAllTheFiles(extension) {
} }
let urisGreD = await generateURIsFromDirTree(appDirGreD, [extension]); let urisGreD = await generateURIsFromDirTree(appDirGreD, [extension]);
let urisXCurProcD = await generateURIsFromDirTree(appDirXCurProcD, [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() { add_task(async function checkAllTheProperties() {

View File

@ -15,7 +15,7 @@ module.exports = {
"no-sequences": "error", "no-sequences": "error",
"no-shadow": "error", "no-shadow": "error",
"no-throw-literal": "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"], "padded-blocks": ["error", "never"],
"semi-spacing": ["error", {"before": false, "after": true}], "semi-spacing": ["error", {"before": false, "after": true}],
"space-in-parens": ["error", "never"], "space-in-parens": ["error", "never"],

View File

@ -170,7 +170,7 @@
<groupbox id="siteDataGroup" hidden="true" data-category="panePrivacy" data-hidden-from-search="true"> <groupbox id="siteDataGroup" hidden="true" data-category="panePrivacy" data-hidden-from-search="true">
<caption><label>&siteData1.label;</label></caption> <caption><label>&siteData1.label;</label></caption>
<hbox align="baseline"> <hbox data-subcategory="sitedata" align="baseline">
<vbox flex="1"> <vbox flex="1">
<radiogroup id="acceptCookies" <radiogroup id="acceptCookies"
preference="network.cookie.cookieBehavior" preference="network.cookie.cookieBehavior"

View File

@ -198,15 +198,15 @@ add_task(async function() {
let columns = site1.querySelectorAll(".item-box > label"); let columns = site1.querySelectorAll(".item-box > label");
is(columns[0].value, "example.com", "Should show the correct host."); 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[1].value, "2", "Should show the correct number of cookies.");
is(columns[3].value, "", "Should show no site data."); is(columns[2].value, "", "Should show no site data.");
is(columns[4].value, args.creationDate1, "Should show the correct date."); is(columns[3].value, args.creationDate1, "Should show the correct date.");
columns = site2.querySelectorAll(".item-box > label"); columns = site2.querySelectorAll(".item-box > label");
is(columns[0].value, "example.org", "Should show the correct host."); 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[1].value, "1", "Should show the correct number of cookies.");
is(columns[3].value, "", "Should show no site data."); is(columns[2].value, "", "Should show no site data.");
is(columns[4].value, args.creationDate2, "Should show the correct date."); is(columns[3].value, args.creationDate2, "Should show the correct date.");
let removeBtn = frameDoc.getElementById("removeSelected"); let removeBtn = frameDoc.getElementById("removeSelected");
let saveBtn = frameDoc.getElementById("save"); let saveBtn = frameDoc.getElementById("save");
@ -232,9 +232,9 @@ add_task(async function() {
let columns = site1.querySelectorAll(".item-box > label"); let columns = site1.querySelectorAll(".item-box > label");
is(columns[0].value, "example.com", "Should show the correct host."); 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[1].value, "2", "Should show the correct number of cookies.");
is(columns[3].value, "", "Should show no site data."); is(columns[2].value, "", "Should show no site data.");
is(columns[4].value, args.creationDate1, "Should show the correct date."); is(columns[3].value, args.creationDate1, "Should show the correct date.");
let removeBtn = frameDoc.getElementById("removeSelected"); let removeBtn = frameDoc.getElementById("removeSelected");
let saveBtn = frameDoc.getElementById("save"); let saveBtn = frameDoc.getElementById("save");

View File

@ -94,15 +94,12 @@ add_task(async function() {
let expected = "account.xyz.com"; let expected = "account.xyz.com";
is(columns[0].value, expected, "Should group and list sites by host"); 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"); let prefStrBundle = frameDoc.getElementById("bundlePreferences");
expected = prefStrBundle.getString("persistent"); expected = prefStrBundle.getFormattedString("siteUsagePersistent",
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",
DownloadUtils.convertByteUnits(quotaUsage * mockSiteDataManager.fakeSites.length)); 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 mockSiteDataManager.unregister();
await BrowserTestUtils.removeTab(gBrowser.selectedTab); await BrowserTestUtils.removeTab(gBrowser.selectedTab);
@ -143,7 +140,6 @@ add_task(async function() {
let frameDoc = dialogFrame.contentDocument; let frameDoc = dialogFrame.contentDocument;
let hostCol = frameDoc.getElementById("hostCol"); let hostCol = frameDoc.getElementById("hostCol");
let usageCol = frameDoc.getElementById("usageCol"); let usageCol = frameDoc.getElementById("usageCol");
let statusCol = frameDoc.getElementById("statusCol");
let cookiesCol = frameDoc.getElementById("cookiesCol"); let cookiesCol = frameDoc.getElementById("cookiesCol");
let sitesList = frameDoc.getElementById("sitesList"); let sitesList = frameDoc.getElementById("sitesList");
@ -162,18 +158,12 @@ add_task(async function() {
hostCol.click(); hostCol.click();
assertSortByBaseDomain("descending"); assertSortByBaseDomain("descending");
// Test sorting on the permission status column // Test sorting on the cookies column
cookiesCol.click(); cookiesCol.click();
assertSortByCookies("ascending"); assertSortByCookies("ascending");
cookiesCol.click(); cookiesCol.click();
assertSortByCookies("descending"); assertSortByCookies("descending");
// Test sorting on the cookies column
statusCol.click();
assertSortByStatus("ascending");
statusCol.click();
assertSortByStatus("descending");
await mockSiteDataManager.unregister(); await mockSiteDataManager.unregister();
await BrowserTestUtils.removeTab(gBrowser.selectedTab); 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) { function assertSortByUsage(order) {
let siteItems = sitesList.getElementsByTagName("richlistitem"); let siteItems = sitesList.getElementsByTagName("richlistitem");
for (let i = 0; i < siteItems.length - 1; ++i) { for (let i = 0; i < siteItems.length - 1; ++i) {

View File

@ -18,7 +18,6 @@ let gSiteDataSettings = {
// - uri: uri of site; instance of nsIURI // - uri: uri of site; instance of nsIURI
// - baseDomain: base domain of the site // - baseDomain: base domain of the site
// - cookies: array of cookies of that site // - cookies: array of cookies of that site
// - status: persistent-storage permission status
// - usage: disk usage which site uses // - usage: disk usage which site uses
// - userAction: "remove" or "update-permission"; the action user wants to take. // - userAction: "remove" or "update-permission"; the action user wants to take.
_sites: null, _sites: null,
@ -50,21 +49,17 @@ let gSiteDataSettings = {
// Add "Host" column. // Add "Host" column.
addColumnItem(site.host, "4"); addColumnItem(site.host, "4");
// Add "Status" column
addColumnItem(site.persisted ?
this._prefStrBundle.getString("persistent") : null, "2");
// Add "Cookies" column. // Add "Cookies" column.
addColumnItem(site.cookies.length, "1"); addColumnItem(site.cookies.length, "1");
// Add "Storage" column // Add "Storage" column
if (site.usage > 0) { if (site.usage > 0 || site.persisted) {
let size = DownloadUtils.convertByteUnits(site.usage); let size = DownloadUtils.convertByteUnits(site.usage);
let str = this._prefStrBundle.getFormattedString("siteUsage", size); let strName = site.persisted ? "siteUsagePersistent" : "siteUsage";
addColumnItem(str, "1"); addColumnItem(this._prefStrBundle.getFormattedString(strName, size), "2");
} else { } else {
// Pass null to avoid showing "0KB" when there is no site data stored. // Pass null to avoid showing "0KB" when there is no site data stored.
addColumnItem(null, "1"); addColumnItem(null, "2");
} }
// Add "Last Used" column. // Add "Last Used" column.
@ -105,7 +100,6 @@ let gSiteDataSettings = {
setEventListener("usageCol", "click", this.onClickTreeCol); setEventListener("usageCol", "click", this.onClickTreeCol);
setEventListener("lastAccessedCol", "click", this.onClickTreeCol); setEventListener("lastAccessedCol", "click", this.onClickTreeCol);
setEventListener("cookiesCol", "click", this.onClickTreeCol); setEventListener("cookiesCol", "click", this.onClickTreeCol);
setEventListener("statusCol", "click", this.onClickTreeCol);
setEventListener("cancel", "command", this.close); setEventListener("cancel", "command", this.close);
setEventListener("save", "command", this.saveChanges); setEventListener("save", "command", this.saveChanges);
setEventListener("searchBox", "command", this.onCommandSearch); setEventListener("searchBox", "command", this.onCommandSearch);
@ -152,17 +146,6 @@ let gSiteDataSettings = {
}; };
break; 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": case "cookiesCol":
sortFunc = (a, b) => a.cookies.length - b.cookies.length; sortFunc = (a, b) => a.cookies.length - b.cookies.length;
break; break;

View File

@ -38,10 +38,9 @@
<richlistbox id="sitesList" orient="vertical" flex="1"> <richlistbox id="sitesList" orient="vertical" flex="1">
<listheader> <listheader>
<treecol flex="4" width="50" label="&hostCol.label;" id="hostCol"/> <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"/> <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. --> <!-- 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" /> <treecol flex="2" width="50" label="&lastAccessedCol.label;" id="lastAccessedCol" />
</listheader> </listheader>
</richlistbox> </richlistbox>

View File

@ -3,9 +3,9 @@
module.exports = { module.exports = {
"rules": { "rules": {
"no-unused-vars": ["error", { "no-unused-vars": ["error", {
"args": "none",
"vars": "all", "vars": "all",
"varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", "varsIgnorePattern": "^EXPORTED_SYMBOLS$",
"args": "none"
}] }]
} }
}; };

View File

@ -44,7 +44,9 @@ module.exports = {
"no-unused-expressions": "error", "no-unused-expressions": "error",
// No declaring variables that are never used // 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 using variables before defined
"no-use-before-define": "error", "no-use-before-define": "error",

View File

@ -166,14 +166,16 @@ removeSelectedCookies.accesskey=R
defaultUserContextLabel=None defaultUserContextLabel=None
#LOCALIZATION NOTE: The next string is for the total usage of site data. # LOCALIZATION NOTE (totalSiteDataSize1, siteUsage, siteUsagePersistent):
# e.g., "The total usage is currently using 200 MB" # 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 # %1$S = size
# %2$S = unit (MB, KB, etc.) # %2$S = unit (MB, KB, etc.)
totalSiteDataSize1=Your stored site data and cache are currently using %1$S %2$S of disk space 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 siteUsage=%1$S %2$S
siteUsagePersistent=%1$S %2$S (Persistent)
loadingSiteDataSize1=Calculating site data and cache size…
acceptRemove=Remove acceptRemove=Remove
# LOCALIZATION NOTE (siteDataSettings2.description): %S = brandShortName # 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. 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 # LOCALIZATION NOTE (spaceAlert.over5GB.prefButtonWin.label): On Windows Preferences is called Options
spaceAlert.over5GB.prefButtonWin.label=Open Options spaceAlert.over5GB.prefButtonWin.label=Open Options
spaceAlert.over5GB.prefButtonWin.accesskey=O spaceAlert.over5GB.prefButtonWin.accesskey=O
# LOCALIZATION NOTE (spaceAlert.over5GB.message): %S = brandShortName # LOCALIZATION NOTE (spaceAlert.over5GB.message1): %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. 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.messageWin): # LOCALIZATION NOTE (spaceAlert.over5GB.messageWin1):
# - On Windows Preferences is called Options # - On Windows Preferences is called Options
# - %S = brandShortName # - %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.label=OK, Got it
spaceAlert.under5GB.okButton.accesskey=K spaceAlert.under5GB.okButton.accesskey=K
# LOCALIZATION NOTE (spaceAlert.under5GB.message): %S = brandShortName # LOCALIZATION NOTE (spaceAlert.under5GB.message): %S = brandShortName

View File

@ -70,6 +70,7 @@ nb-NO
ne-NP ne-NP
nl nl
nn-NO nn-NO
oc
or or
pa-IN pa-IN
pl pl

View File

@ -7,9 +7,9 @@ module.exports = {
"rules": { "rules": {
"no-unused-vars": ["error", { "no-unused-vars": ["error", {
"args": "none",
"vars": "all", "vars": "all",
"varsIgnorePattern": "^(Cc|Ci|Cr|Cu|EXPORTED_SYMBOLS)$", "varsIgnorePattern": "^EXPORTED_SYMBOLS$",
"args": "none"
}] }]
} }
}; };

View File

@ -215,7 +215,7 @@ module.exports = {
"no-undefined": "off", "no-undefined": "off",
// Disallow global and local variables that aren't used, but allow unused // Disallow global and local variables that aren't used, but allow unused
// function arguments. // 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. // Allow using variables before they are defined.
"no-use-before-define": "off", "no-use-before-define": "off",
// We use var-only-at-top-level instead of no-var as we allow top level // We use var-only-at-top-level instead of no-var as we allow top level

View File

@ -52,12 +52,14 @@ class MainToolbar extends Component {
return ( return (
Toolbar({}, Toolbar({},
ToolbarButton({ ToolbarButton({
key: "refresh",
className: "refresh devtools-button", className: "refresh devtools-button",
id: "dom-refresh-button", id: "dom-refresh-button",
title: l10n.getStr("dom.refresh"), title: l10n.getStr("dom.refresh"),
onClick: this.onRefresh onClick: this.onRefresh
}), }),
SearchBox({ SearchBox({
key: "filter",
delay: 250, delay: 250,
onChange: this.onSearch, onChange: this.onSearch,
placeholder: l10n.getStr("dom.filterDOMPanel"), placeholder: l10n.getStr("dom.filterDOMPanel"),

View File

@ -102,19 +102,18 @@ class ToolboxController extends Component {
} }
setCurrentToolId(currentToolId) { setCurrentToolId(currentToolId) {
this.setState({currentToolId}); this.setState({currentToolId}, () => {
// Also set the currently focused button to this tool. // Also set the currently focused button to this tool.
this.setFocusedButton(currentToolId); this.setFocusedButton(currentToolId);
});
} }
setCanRender() { setCanRender() {
this.setState({ canRender: true }); this.setState({ canRender: true }, this.updateButtonIds);
this.updateButtonIds();
} }
setOptionsPanel(optionsPanel) { setOptionsPanel(optionsPanel) {
this.setState({ optionsPanel }); this.setState({ optionsPanel }, this.updateButtonIds);
this.updateButtonIds();
} }
highlightTool(highlightedTool) { highlightTool(highlightedTool) {
@ -132,23 +131,19 @@ class ToolboxController extends Component {
} }
setDockButtonsEnabled(areDockButtonsEnabled) { setDockButtonsEnabled(areDockButtonsEnabled) {
this.setState({ areDockButtonsEnabled }); this.setState({ areDockButtonsEnabled }, this.updateButtonIds);
this.updateButtonIds();
} }
setHostTypes(hostTypes) { setHostTypes(hostTypes) {
this.setState({ hostTypes }); this.setState({ hostTypes }, this.updateButtonIds);
this.updateButtonIds();
} }
setCanCloseToolbox(canCloseToolbox) { setCanCloseToolbox(canCloseToolbox) {
this.setState({ canCloseToolbox }); this.setState({ canCloseToolbox }, this.updateButtonIds);
this.updateButtonIds();
} }
setPanelDefinitions(panelDefinitions) { setPanelDefinitions(panelDefinitions) {
this.setState({ panelDefinitions }); this.setState({ panelDefinitions }, this.updateButtonIds);
this.updateButtonIds();
} }
get panelDefinitions() { get panelDefinitions() {
@ -164,8 +159,7 @@ class ToolboxController extends Component {
button.on("updatechecked", this.state.checkedButtonsUpdated); button.on("updatechecked", this.state.checkedButtonsUpdated);
}); });
this.setState({ toolboxButtons }); this.setState({ toolboxButtons }, this.updateButtonIds);
this.updateButtonIds();
} }
setCanMinimize(canMinimize) { setCanMinimize(canMinimize) {

View File

@ -94,6 +94,7 @@ class ToolboxTabs extends Component {
} = this.props; } = this.props;
let tabs = panelDefinitions.map(panelDefinition => ToolboxTab({ let tabs = panelDefinitions.map(panelDefinition => ToolboxTab({
key: panelDefinition.id,
currentToolId, currentToolId,
focusButton, focusButton,
focusedButton, focusedButton,

View File

@ -230,7 +230,6 @@ function renderDockButtons(props) {
title: L10N.getStr("toolbox.closebutton.tooltip"), title: L10N.getStr("toolbox.closebutton.tooltip"),
onClick: () => { onClick: () => {
closeToolbox(); closeToolbox();
focusButton(closeButtonId);
}, },
tabIndex: focusedButton === "toolbox-close" ? "0" : "-1", tabIndex: focusedButton === "toolbox-close" ? "0" : "-1",
}) })

View File

@ -63,10 +63,11 @@ class BoxModelProperties extends PureComponent {
return {}; return {};
} }
onToggleExpander() { onToggleExpander(event) {
this.setState({ this.setState({
isOpen: !this.state.isOpen, isOpen: !this.state.isOpen,
}); });
event.stopPropagation();
} }
render() { render() {

View File

@ -38,6 +38,11 @@ class FontInspector {
this.init(); this.init();
} }
componentWillMount() {
this.store.dispatch(updatePreviewText(""));
this.update(false, "");
}
init() { init() {
if (!this.inspector) { if (!this.inspector) {
return; return;
@ -62,9 +67,6 @@ class FontInspector {
// Listen for theme changes as the color of the previews depend on the theme // Listen for theme changes as the color of the previews depend on the theme
gDevTools.on("theme-switched", this.onThemeChanged); gDevTools.on("theme-switched", this.onThemeChanged);
this.store.dispatch(updatePreviewText(""));
this.update(false, "");
} }
/** /**

View File

@ -94,7 +94,6 @@ class SnapshotListItem extends Component {
let deleteButton = !snapshot.path ? void 0 : dom.div({ let deleteButton = !snapshot.path ? void 0 : dom.div({
onClick: () => onDelete(snapshot), onClick: () => onDelete(snapshot),
className: "delete", className: "delete",
"aria-role": "button",
title: L10N.getStr("snapshot.io.delete") title: L10N.getStr("snapshot.io.delete")
}); });

View File

@ -205,7 +205,6 @@ class Toolbar extends Component {
{ {
id: "select-view", id: "select-view",
onChange: e => onViewChange(e.target.value), onChange: e => onViewChange(e.target.value),
defaultValue: view,
value: view.state, value: view.state,
}, },
dom.option( dom.option(

View File

@ -41,7 +41,7 @@ class MonitorPanel extends Component {
networkDetailsOpen: PropTypes.bool.isRequired, networkDetailsOpen: PropTypes.bool.isRequired,
openNetworkDetails: PropTypes.func.isRequired, openNetworkDetails: PropTypes.func.isRequired,
request: PropTypes.object, request: PropTypes.object,
selectedRequestVisible: PropTypes.func.isRequired, selectedRequestVisible: PropTypes.bool.isRequired,
sourceMapService: PropTypes.object, sourceMapService: PropTypes.object,
openLink: PropTypes.func, openLink: PropTypes.func,
updateRequest: PropTypes.func.isRequired, updateRequest: PropTypes.func.isRequired,
@ -113,8 +113,8 @@ class MonitorPanel extends Component {
Toolbar({ connector }), Toolbar({ connector }),
SplitBox({ SplitBox({
className: "devtools-responsive-container", className: "devtools-responsive-container",
initialWidth: `${initialWidth}px`, initialWidth: initialWidth,
initialHeight: `${initialHeight}px`, initialHeight: initialHeight,
minSize: "50px", minSize: "50px",
maxSize: "80%", maxSize: "80%",
splitterSize: 1, splitterSize: 1,

View File

@ -63,7 +63,7 @@ class RequestListContent extends Component {
scale: PropTypes.number, scale: PropTypes.number,
selectedRequest: PropTypes.object, selectedRequest: PropTypes.object,
sortedRequests: PropTypes.array.isRequired, sortedRequests: PropTypes.array.isRequired,
requestFilterTypes: PropTypes.string.isRequired, requestFilterTypes: PropTypes.object.isRequired,
}; };
} }

View File

@ -138,7 +138,7 @@ class RequestListItem extends Component {
onMouseDown: PropTypes.func.isRequired, onMouseDown: PropTypes.func.isRequired,
onSecurityIconMouseDown: PropTypes.func.isRequired, onSecurityIconMouseDown: PropTypes.func.isRequired,
onWaterfallMouseDown: PropTypes.func.isRequired, onWaterfallMouseDown: PropTypes.func.isRequired,
requestFilterTypes: PropTypes.string.isRequired, requestFilterTypes: PropTypes.object.isRequired,
waterfallWidth: PropTypes.number, waterfallWidth: PropTypes.number,
}; };
} }

View File

@ -33,6 +33,7 @@ function WaterfallHeader(props) {
let label = L10N.getFormatStr("timeline.tick", time); let label = L10N.getFormatStr("timeline.tick", time);
let node = dom.div({ let node = dom.div({
key: x,
className: "plain waterfall-header-tick", className: "plain waterfall-header-tick",
style: { transform: `translateX(${left}px)` } style: { transform: `translateX(${left}px)` }
}, label); }, label);

View File

@ -25,7 +25,7 @@ class Frame extends Component {
column: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]), column: PropTypes.oneOfType([ PropTypes.string, PropTypes.number ]),
}).isRequired, }).isRequired,
// Clicking on the frame link -- probably should link to the debugger. // 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. // Option to display a function name before the source link.
showFunctionName: PropTypes.bool, showFunctionName: PropTypes.bool,
// Option to display a function name even if it's anonymous. // Option to display a function name even if it's anonymous.

View File

@ -22,15 +22,27 @@ class SplitBox extends Component {
// Initial size of controlled panel. // Initial size of controlled panel.
initialSize: PropTypes.string, initialSize: PropTypes.string,
// Initial width of controlled panel. // Initial width of controlled panel.
initialWidth: PropTypes.string, initialWidth: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
// Initial height of controlled panel. // Initial height of controlled panel.
initialHeight: PropTypes.string, initialHeight: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
// Left/top panel // Left/top panel
startPanel: PropTypes.any, startPanel: PropTypes.any,
// Min panel size. // Min panel size.
minSize: PropTypes.string, minSize: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
// Max panel size. // Max panel size.
maxSize: PropTypes.string, maxSize: PropTypes.oneOfType([
PropTypes.number,
PropTypes.string
]),
// Right/bottom panel // Right/bottom panel
endPanel: PropTypes.any, endPanel: PropTypes.any,
// True if the right/bottom panel should be controlled. // True if the right/bottom panel should be controlled.

View File

@ -11,9 +11,6 @@ const TEST_URI = "data:text/html;charset=utf-8,<head>" +
"ets.css'></head><body><div></div><span></span></body>"; "ets.css'></head><body><div></div><span></span></body>";
const {TreeWidget} = require("devtools/client/shared/widgets/TreeWidget"); 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 () { add_task(async function () {
await addTab("about:blank"); await addTab("about:blank");
let [host, win, doc] = await createHost("bottom", TEST_URI); 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. // pressing left to check expand collapse feature.
// This does not emit any event, so listening for keypress // This does not emit any event, so listening for keypress
const eventToListen = kStrictKeyPressEvents ? "keydown" : "keypress"; tree.root.children.addEventListener("keydown", () => {
tree.root.children.addEventListener(eventToListen, () => {
// executeSoon so that other listeners on the same method are executed first // executeSoon so that other listeners on the same method are executed first
executeSoon(() => event.resolve(null)); executeSoon(() => event.resolve(null));
}, {once: true}); }, {once: true});
@ -189,7 +185,7 @@ async function testKeyboardInteraction(tree, win) {
// collapsing the item to check expand feature. // collapsing the item to check expand feature.
tree.root.children.addEventListener(eventToListen, () => { tree.root.children.addEventListener("keydown", () => {
executeSoon(() => event.resolve(null)); executeSoon(() => event.resolve(null));
}, {once: true}); }, {once: true});
info("Pressing left key to collapse the item"); info("Pressing left key to collapse the item");
@ -202,7 +198,7 @@ async function testKeyboardInteraction(tree, win) {
// pressing right should expand this now. // pressing right should expand this now.
tree.root.children.addEventListener(eventToListen, () => { tree.root.children.addEventListener("keydown", () => {
executeSoon(() => event.resolve(null)); executeSoon(() => event.resolve(null));
}, {once: true}); }, {once: true});
info("Pressing right key to expend the collapsed item"); info("Pressing right key to expend the collapsed item");
@ -219,7 +215,7 @@ async function testKeyboardInteraction(tree, win) {
node = tree._selectedLabel; node = tree._selectedLabel;
// pressing down again should not change selection // pressing down again should not change selection
event = defer(); event = defer();
tree.root.children.addEventListener(eventToListen, () => { tree.root.children.addEventListener("keydown", () => {
executeSoon(() => event.resolve(null)); executeSoon(() => event.resolve(null));
}, {once: true}); }, {once: true});
info("Pressing down key on last item of the tree"); info("Pressing down key on last item of the tree");

View File

@ -9,13 +9,14 @@
```bash ```bash
git clone https://github.com/reactjs/react-redux git clone https://github.com/reactjs/react-redux
cd 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 ## Building
```bash ```bash
npm install npm install
npm run build:umd
cp dist/react-redux.js <gecko-dev>/devtools/client/shared/vendor/react-redux.js cp dist/react-redux.js <gecko-dev>/devtools/client/shared/vendor/react-redux.js
``` ```
@ -27,7 +28,7 @@ We no longer need the react-redux repo so feel free to delete it.
- Add the version number to the top of the file: - 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 `'react'` with `'devtools/client/shared/vendor/react'` (including the quotes).

View File

@ -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

View 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
*/
```

View File

@ -1,23 +1,24 @@
/** /**
* react-redux v5.0.6 * react-redux v5.0.7
*/ */
(function (global, factory) { (function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('devtools/client/shared/vendor/react'), require('devtools/client/shared/vendor/redux')) : 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) : 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'; }(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) { function createCommonjsModule(fn, module) {
return module = { exports: {} }, fn(module, module.exports), module.exports; return module = { exports: {} }, fn(module, module.exports), module.exports;
} }
/** /**
* Copyright (c) 2013-present, Facebook, Inc. * Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
* *
* *
*/ */
@ -50,11 +51,9 @@ var emptyFunction_1 = emptyFunction;
/** /**
* Copyright (c) 2013-present, Facebook, Inc. * Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
* *
*/ */
@ -153,13 +152,100 @@ var warning = emptyFunction_1;
var warning_1 = warning; 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. * Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
@ -195,7 +281,7 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
try { try {
// This is intentionally an invariant that gets caught. It's the same // This is intentionally an invariant that gets caught. It's the same
// behavior as without this statement except with a better message. // 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); error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
} catch (ex) { } catch (ex) {
error = ex; error = ex;
@ -311,7 +397,8 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
objectOf: createObjectOfTypeChecker, objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker, oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker, oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker,
}; };
/** /**
@ -526,7 +613,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
if (typeof checker !== 'function') { if (typeof checker !== 'function') {
warning_1( warning_1(
false, 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.', 'received %s at index %s.',
getPostfixForTypeWarning(checker), getPostfixForTypeWarning(checker),
i i
@ -580,6 +667,36 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
return createChainableTypeChecker(validate); 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) { function isNode(propValue) {
switch (typeof propValue) { switch (typeof propValue) {
case 'number': case 'number':
@ -712,14 +829,12 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
return ReactPropTypes; return ReactPropTypes;
}; };
var index = createCommonjsModule(function (module) { var propTypes = createCommonjsModule(function (module) {
/** /**
* Copyright 2013-present, Facebook, Inc. * Copyright (c) 2013-present, Facebook, Inc.
* All rights reserved.
* *
* This source code is licensed under the BSD-style license found in the * This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree. An additional grant * LICENSE file in the root directory of this source tree.
* of patent rights can be found in the PATENTS file in the same directory.
*/ */
{ {
@ -741,17 +856,17 @@ var index = createCommonjsModule(function (module) {
} }
}); });
var subscriptionShape = index.shape({ var subscriptionShape = propTypes.shape({
trySubscribe: index.func.isRequired, trySubscribe: propTypes.func.isRequired,
tryUnsubscribe: index.func.isRequired, tryUnsubscribe: propTypes.func.isRequired,
notifyNestedSubs: index.func.isRequired, notifyNestedSubs: propTypes.func.isRequired,
isSubscribed: index.func.isRequired isSubscribed: propTypes.func.isRequired
}); });
var storeShape = index.shape({ var storeShape = propTypes.shape({
subscribe: index.func.isRequired, subscribe: propTypes.func.isRequired,
dispatch: index.func.isRequired, dispatch: propTypes.func.isRequired,
getState: index.func.isRequired getState: propTypes.func.isRequired
}); });
/** /**
@ -782,14 +897,6 @@ var classCallCheck = function (instance, Constructor) {
} }
}; };
var _extends = Object.assign || function (target) { var _extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) { for (var i = 1; i < arguments.length; i++) {
var source = arguments[i]; var source = arguments[i];
@ -804,8 +911,6 @@ var _extends = Object.assign || function (target) {
return target; return target;
}; };
var inherits = function (subClass, superClass) { var inherits = function (subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) { if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); 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; if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass;
}; };
var objectWithoutProperties = function (obj, keys) { var objectWithoutProperties = function (obj, keys) {
var target = {}; var target = {};
@ -903,7 +1000,7 @@ function createProvider() {
Provider.propTypes = { Provider.propTypes = {
store: storeShape.isRequired, 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); Provider.childContextTypes = (_Provider$childContex = {}, _Provider$childContex[storeKey] = storeShape.isRequired, _Provider$childContex[subscriptionKey] = subscriptionShape, _Provider$childContex);
@ -912,22 +1009,28 @@ function createProvider() {
var Provider = createProvider(); var Provider = createProvider();
var hoistNonReactStatics = createCommonjsModule(function (module, exports) {
/** /**
* Copyright 2015, Yahoo! Inc. * Copyright 2015, Yahoo! Inc.
* Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms. * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
*/ */
var REACT_STATICS = { (function (global, factory) {
module.exports = factory();
}(commonjsGlobal, (function () {
var REACT_STATICS = {
childContextTypes: true, childContextTypes: true,
contextTypes: true, contextTypes: true,
defaultProps: true, defaultProps: true,
displayName: true, displayName: true,
getDefaultProps: true, getDefaultProps: true,
getDerivedStateFromProps: true,
mixins: true, mixins: true,
propTypes: true, propTypes: true,
type: true type: true
}; };
var KNOWN_STATICS = { var KNOWN_STATICS = {
name: true, name: true,
length: true, length: true,
prototype: true, prototype: true,
@ -935,15 +1038,16 @@ var KNOWN_STATICS = {
callee: true, callee: true,
arguments: true, arguments: true,
arity: true arity: true
}; };
var getOwnPropertySymbols = Object.getOwnPropertySymbols; var defineProperty = Object.defineProperty;
var propIsEnumerable = Object.prototype.propertyIsEnumerable; var getOwnPropertyNames = Object.getOwnPropertyNames;
var getPrototypeOf = Object.getPrototypeOf; var getOwnPropertySymbols = Object.getOwnPropertySymbols;
var objectPrototype = getPrototypeOf && getPrototypeOf(Object); var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var getOwnPropertyNames = Object.getOwnPropertyNames; var getPrototypeOf = Object.getPrototypeOf;
var objectPrototype = getPrototypeOf && getPrototypeOf(Object);
var index$1 = function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) { return function hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {
if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components if (typeof sourceComponent !== 'string') { // don't hoist over string (html) components
if (objectPrototype) { if (objectPrototype) {
@ -962,20 +1066,20 @@ var index$1 = function hoistNonReactStatics(targetComponent, sourceComponent, bl
for (var i = 0; i < keys.length; ++i) { for (var i = 0; i < keys.length; ++i) {
var key = keys[i]; var key = keys[i];
if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) { if (!REACT_STATICS[key] && !KNOWN_STATICS[key] && (!blacklist || !blacklist[key])) {
// Only hoist enumerables and non-enumerable functions var descriptor = getOwnPropertyDescriptor(sourceComponent, key);
if(propIsEnumerable.call(sourceComponent, key) || typeof sourceComponent[key] === 'function') {
try { // Avoid failures from read-only properties try { // Avoid failures from read-only properties
targetComponent[key] = sourceComponent[key]; defineProperty(targetComponent, key, descriptor);
} catch (e) {} } catch (e) {}
} }
} }
}
return targetComponent; return targetComponent;
} }
return targetComponent; return targetComponent;
}; };
})));
});
/** /**
* Copyright 2013-2015, Facebook, Inc. * Copyright 2013-2015, Facebook, Inc.
@ -1184,7 +1288,7 @@ selectorFactory) {
var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes); var childContextTypes = (_childContextTypes = {}, _childContextTypes[subscriptionKey] = subscriptionShape, _childContextTypes);
return function wrapWithConnect(WrappedComponent) { 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'; 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; var Symbol$1 = root.Symbol;
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto$1 = Object.prototype; var objectProto = Object.prototype;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty$2 = objectProto$1.hasOwnProperty; var hasOwnProperty$1 = objectProto.hasOwnProperty;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var nativeObjectToString = objectProto$1.toString; var nativeObjectToString = objectProto.toString;
/** Built-in value references. */ /** 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. * 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`. * @returns {string} Returns the raw `toStringTag`.
*/ */
function getRawTag(value) { function getRawTag(value) {
var isOwn = hasOwnProperty$2.call(value, symToStringTag$1), var isOwn = hasOwnProperty$1.call(value, symToStringTag),
tag = value[symToStringTag$1]; tag = value[symToStringTag];
try { try {
value[symToStringTag$1] = undefined; value[symToStringTag] = undefined;
var unmasked = true; var unmasked = true;
} catch (e) {} } catch (e) {}
var result = nativeObjectToString.call(value); var result = nativeObjectToString.call(value);
if (unmasked) { if (unmasked) {
if (isOwn) { if (isOwn) {
value[symToStringTag$1] = tag; value[symToStringTag] = tag;
} else { } else {
delete value[symToStringTag$1]; delete value[symToStringTag];
} }
} }
return result; return result;
} }
/** Used for built-in method references. */ /** Used for built-in method references. */
var objectProto$2 = Object.prototype; var objectProto$1 = Object.prototype;
/** /**
* Used to resolve the * Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values. * of values.
*/ */
var nativeObjectToString$1 = objectProto$2.toString; var nativeObjectToString$1 = objectProto$1.toString;
/** /**
* Converts `value` to a string using `Object.prototype.toString`. * Converts `value` to a string using `Object.prototype.toString`.
@ -1499,11 +1603,11 @@ function objectToString(value) {
} }
/** `Object#toString` result references. */ /** `Object#toString` result references. */
var nullTag = '[object Null]'; var nullTag = '[object Null]',
var undefinedTag = '[object Undefined]'; undefinedTag = '[object Undefined]';
/** Built-in value references. */ /** 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. * The base implementation of `getTag` without fallbacks for buggy environments.
@ -1516,7 +1620,7 @@ function baseGetTag(value) {
if (value == null) { if (value == null) {
return value === undefined ? undefinedTag : nullTag; return value === undefined ? undefinedTag : nullTag;
} }
return (symToStringTag && symToStringTag in Object(value)) return (symToStringTag$1 && symToStringTag$1 in Object(value))
? getRawTag(value) ? getRawTag(value)
: objectToString(value); : objectToString(value);
} }
@ -1570,14 +1674,14 @@ function isObjectLike(value) {
var objectTag = '[object Object]'; var objectTag = '[object Object]';
/** Used for built-in method references. */ /** Used for built-in method references. */
var funcProto = Function.prototype; var funcProto = Function.prototype,
var objectProto = Object.prototype; objectProto$2 = Object.prototype;
/** Used to resolve the decompiled source of functions. */ /** Used to resolve the decompiled source of functions. */
var funcToString = funcProto.toString; var funcToString = funcProto.toString;
/** Used to check objects for own properties. */ /** Used to check objects for own properties. */
var hasOwnProperty$1 = objectProto.hasOwnProperty; var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
/** Used to infer the `Object` constructor. */ /** Used to infer the `Object` constructor. */
var objectCtorString = funcToString.call(Object); var objectCtorString = funcToString.call(Object);
@ -1618,7 +1722,7 @@ function isPlainObject(value) {
if (proto === null) { if (proto === null) {
return true; 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 && return typeof Ctor == 'function' && Ctor instanceof Ctor &&
funcToString.call(Ctor) == objectCtorString; funcToString.call(Ctor) == objectCtorString;
} }

File diff suppressed because it is too large Load Diff

View File

@ -442,7 +442,7 @@ AbstractTreeItem.prototype = {
this._onArrowClick = this._onArrowClick.bind(this); this._onArrowClick = this._onArrowClick.bind(this);
this._onClick = this._onClick.bind(this); this._onClick = this._onClick.bind(this);
this._onDoubleClick = this._onDoubleClick.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._onFocus = this._onFocus.bind(this);
this._onBlur = this._onBlur.bind(this); this._onBlur = this._onBlur.bind(this);
@ -457,7 +457,7 @@ AbstractTreeItem.prototype = {
targetNode.addEventListener("mousedown", this._onClick); targetNode.addEventListener("mousedown", this._onClick);
targetNode.addEventListener("dblclick", this._onDoubleClick); targetNode.addEventListener("dblclick", this._onDoubleClick);
targetNode.addEventListener("keypress", this._onKeyPress); targetNode.addEventListener("keydown", this._onKeyDown);
targetNode.addEventListener("focus", this._onFocus); targetNode.addEventListener("focus", this._onFocus);
targetNode.addEventListener("blur", this._onBlur); 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. // Prevent scrolling when pressing navigation keys.
ViewHelpers.preventScrolling(e); ViewHelpers.preventScrolling(e);

View File

@ -36,7 +36,7 @@ this.BreadcrumbsWidget = function BreadcrumbsWidget(aNode, aOptions = {}) {
this._list.setAttribute("orient", "horizontal"); this._list.setAttribute("orient", "horizontal");
this._list.setAttribute("clicktoscroll", "true"); this._list.setAttribute("clicktoscroll", "true");
this._list.setAttribute("smoothscroll", !!aOptions.smoothScroll); 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._list.addEventListener("mousedown", e => this.emit("mousePress", e));
this._parent.appendChild(this._list); this._parent.appendChild(this._list);

View File

@ -32,7 +32,7 @@ const FastListWidget = module.exports = function FastListWidget(node) {
this._list.setAttribute("flex", "1"); this._list.setAttribute("flex", "1");
this._list.setAttribute("orient", "vertical"); this._list.setAttribute("orient", "vertical");
this._list.setAttribute("tabindex", "0"); 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._list.addEventListener("mousedown", e => this.emit("mousePress", e));
this._parent.appendChild(this._list); this._parent.appendChild(this._list);

View File

@ -341,7 +341,7 @@ CSSFilterEditorWidget.prototype = {
// Filters that have units are number-type filters. For them, // Filters that have units are number-type filters. For them,
// the value can be incremented/decremented simply. // the value can be incremented/decremented simply.
// For other types of filters (e.g. drop-shadow) we need to check // 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) { if (filter.unit) {
let startValue = parseFloat(e.target.value); let startValue = parseFloat(e.target.value);
let value = startValue + direction * multiplier; let value = startValue + direction * multiplier;

View File

@ -185,7 +185,6 @@ function FlameGraph(parent, sharpness) {
this._onAnimationFrame = this._onAnimationFrame.bind(this); this._onAnimationFrame = this._onAnimationFrame.bind(this);
this._onKeyDown = this._onKeyDown.bind(this); this._onKeyDown = this._onKeyDown.bind(this);
this._onKeyUp = this._onKeyUp.bind(this); this._onKeyUp = this._onKeyUp.bind(this);
this._onKeyPress = this._onKeyPress.bind(this);
this._onMouseMove = this._onMouseMove.bind(this); this._onMouseMove = this._onMouseMove.bind(this);
this._onMouseDown = this._onMouseDown.bind(this); this._onMouseDown = this._onMouseDown.bind(this);
this._onMouseUp = this._onMouseUp.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("keydown", this._onKeyDown);
this._window.addEventListener("keyup", this._onKeyUp); this._window.addEventListener("keyup", this._onKeyUp);
this._window.addEventListener("keypress", this._onKeyPress);
this._window.addEventListener("mousemove", this._onMouseMove); this._window.addEventListener("mousemove", this._onMouseMove);
this._window.addEventListener("mousedown", this._onMouseDown); this._window.addEventListener("mousedown", this._onMouseDown);
this._window.addEventListener("mouseup", this._onMouseUp); this._window.addEventListener("mouseup", this._onMouseUp);
@ -239,7 +237,6 @@ FlameGraph.prototype = {
this._window.removeEventListener("keydown", this._onKeyDown); this._window.removeEventListener("keydown", this._onKeyDown);
this._window.removeEventListener("keyup", this._onKeyUp); this._window.removeEventListener("keyup", this._onKeyUp);
this._window.removeEventListener("keypress", this._onKeyPress);
this._window.removeEventListener("mousemove", this._onMouseMove); this._window.removeEventListener("mousemove", this._onMouseMove);
this._window.removeEventListener("mousedown", this._onMouseDown); this._window.removeEventListener("mousedown", this._onMouseDown);
this._window.removeEventListener("mouseup", this._onMouseUp); 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. * Listener for the "mousemove" event on the graph's container.
*/ */

View File

@ -54,7 +54,7 @@ this.SideMenuWidget = function SideMenuWidget(aNode, aOptions = {}) {
this._list.setAttribute("with-group-checkboxes", this._showGroupCheckboxes); this._list.setAttribute("with-group-checkboxes", this._showGroupCheckboxes);
this._list.setAttribute("tabindex", "0"); this._list.setAttribute("tabindex", "0");
this._list.addEventListener("contextmenu", e => this._showContextMenu(e)); 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._list.addEventListener("mousedown", e => this.emit("mousePress", e));
this._parent.appendChild(this._list); this._parent.appendChild(this._list);

View File

@ -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. * - <escape> revert the value and close the textbox.
* - <return> apply the value and close the textbox. * - <return> apply the value and close the textbox.
* - <tab> Handled by the consumer's `onTab` callback. * - <tab> Handled by the consumer's `onTab` callback.

View File

@ -135,7 +135,7 @@ TreeWidget.prototype = {
this._parent.appendChild(this.root.children); this._parent.appendChild(this.root.children);
this.root.children.addEventListener("mousedown", e => this.onClick(e)); 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. * items, as well as collapsing and expanding any item.
*/ */
onKeypress: function (event) { onKeydown: function (event) {
switch (event.keyCode) { switch (event.keyCode) {
case KeyCodes.DOM_VK_UP: case KeyCodes.DOM_VK_UP:
this.selectPreviousItem(); this.selectPreviousItem();

View File

@ -81,14 +81,12 @@ this.VariablesView = function VariablesView(aParentNode, aFlags = {}) {
this._appendEmptyNotice(); this._appendEmptyNotice();
this._onSearchboxInput = this._onSearchboxInput.bind(this); this._onSearchboxInput = this._onSearchboxInput.bind(this);
this._onSearchboxKeyPress = this._onSearchboxKeyPress.bind(this); this._onSearchboxKeyDown = this._onSearchboxKeyDown.bind(this);
this._onViewKeyPress = this._onViewKeyPress.bind(this);
this._onViewKeyDown = this._onViewKeyDown.bind(this); this._onViewKeyDown = this._onViewKeyDown.bind(this);
// Create an internal scrollbox container. // Create an internal scrollbox container.
this._list = this.document.createElement("scrollbox"); this._list = this.document.createElement("scrollbox");
this._list.setAttribute("orient", "vertical"); this._list.setAttribute("orient", "vertical");
this._list.addEventListener("keypress", this._onViewKeyPress);
this._list.addEventListener("keydown", this._onViewKeyDown); this._list.addEventListener("keydown", this._onViewKeyDown);
this._parent.appendChild(this._list); this._parent.appendChild(this._list);
@ -192,9 +190,7 @@ VariablesView.prototype = {
let currList = this._list = this.document.createElement("scrollbox"); let currList = this._list = this.document.createElement("scrollbox");
this.window.setTimeout(() => { this.window.setTimeout(() => {
prevList.removeEventListener("keypress", this._onViewKeyPress);
prevList.removeEventListener("keydown", this._onViewKeyDown); prevList.removeEventListener("keydown", this._onViewKeyDown);
currList.addEventListener("keypress", this._onViewKeyPress);
currList.addEventListener("keydown", this._onViewKeyDown); currList.addEventListener("keydown", this._onViewKeyDown);
currList.setAttribute("orient", "vertical"); currList.setAttribute("orient", "vertical");
@ -457,7 +453,7 @@ VariablesView.prototype = {
searchbox.setAttribute("type", "search"); searchbox.setAttribute("type", "search");
searchbox.setAttribute("flex", "1"); searchbox.setAttribute("flex", "1");
searchbox.addEventListener("command", this._onSearchboxInput); searchbox.addEventListener("command", this._onSearchboxInput);
searchbox.addEventListener("keypress", this._onSearchboxKeyPress); searchbox.addEventListener("keydown", this._onSearchboxKeyDown);
container.appendChild(searchbox); container.appendChild(searchbox);
ownerNode.insertBefore(container, this._parent); ownerNode.insertBefore(container, this._parent);
@ -474,7 +470,7 @@ VariablesView.prototype = {
} }
this._searchboxContainer.remove(); this._searchboxContainer.remove();
this._searchboxNode.removeEventListener("command", this._onSearchboxInput); this._searchboxNode.removeEventListener("command", this._onSearchboxInput);
this._searchboxNode.removeEventListener("keypress", this._onSearchboxKeyPress); this._searchboxNode.removeEventListener("keydown", this._onSearchboxKeyDown);
this._searchboxContainer = null; this._searchboxContainer = null;
this._searchboxNode = 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) { switch (e.keyCode) {
case KeyCodes.DOM_VK_RETURN: case KeyCodes.DOM_VK_RETURN:
this._onSearchboxInput(); 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(); let item = this.getFocusedItem();
// Prevent scrolling when pressing navigation keys. // Prevent scrolling when pressing navigation keys.
ViewHelpers.preventScrolling(e); ViewHelpers.preventScrolling(e);
switch (e.keyCode) { 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: case KeyCodes.DOM_VK_UP:
// Always rewind focus. // Always rewind focus.
this.focusPrevItem(true); 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. * Sets the text displayed in this container when there are no available items.
* @param string aValue * @param string aValue
@ -4016,9 +4007,9 @@ Editable.prototype = {
input.selectionStart++; input.selectionStart++;
} }
this._onKeypress = this._onKeypress.bind(this); this._onKeydown = this._onKeydown.bind(this);
this._onBlur = this._onBlur.bind(this); this._onBlur = this._onBlur.bind(this);
input.addEventListener("keypress", this._onKeypress); input.addEventListener("keydown", this._onKeydown);
input.addEventListener("blur", this._onBlur); input.addEventListener("blur", this._onBlur);
this._prevExpandable = this._variable.twisty; this._prevExpandable = this._variable.twisty;
@ -4034,7 +4025,7 @@ Editable.prototype = {
* state. * state.
*/ */
deactivate: function () { deactivate: function () {
this._input.removeEventListener("keypress", this._onKeypress); this._input.removeEventListener("keydown", this._onKeydown);
this._input.removeEventListener("blur", this.deactivate); this._input.removeEventListener("blur", this.deactivate);
this._input.parentNode.replaceChild(this.label, this._input); this._input.parentNode.replaceChild(this.label, this._input);
this._input = null; this._input = null;
@ -4087,7 +4078,7 @@ Editable.prototype = {
/** /**
* Event handler for when the input receives a key press. * Event handler for when the input receives a key press.
*/ */
_onKeypress: function (e) { _onKeydown: function (e) {
e.stopPropagation(); e.stopPropagation();
switch (e.keyCode) { switch (e.keyCode) {

View File

@ -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() { revert() {
if (this.activeSwatch) { 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() { commit() {
if (this.activeSwatch) { if (this.activeSwatch) {
@ -238,7 +238,7 @@ class SwatchBasedEditorTooltip {
destroy() { destroy() {
this.swatches.clear(); this.swatches.clear();
this.activeSwatch = null; this.activeSwatch = null;
this.tooltip.off("keypress", this._onTooltipKeypress); this.tooltip.off("keydown", this._onTooltipKeydown);
this.tooltip.destroy(); this.tooltip.destroy();
this.shortcuts.destroy(); this.shortcuts.destroy();
} }

View File

@ -85,7 +85,7 @@ const POPUP_EVENTS = ["shown", "hidden", "showing", "hiding"];
* - shown : when the tooltip is shown * - shown : when the tooltip is shown
* - hiding : just before the tooltip closes * - hiding : just before the tooltip closes
* - hidden : when the tooltip gets hidden * - hidden : when the tooltip gets hidden
* - keypress : when any key gets pressed, with keyCode * - keydown : when any key gets pressed, with keyCode
*/ */
class Tooltip { class Tooltip {
@ -131,21 +131,21 @@ class Tooltip {
this["_onPopup" + eventName]); 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"); let win = this.doc.querySelector("window");
this._onKeyPress = event => { this._onKeyDown = event => {
if (this.panel.hidden) { if (this.panel.hidden) {
return; return;
} }
this.emit("keypress", event.keyCode); this.emit("keydown", event.keyCode);
if (this.closeOnKeys.includes(event.keyCode) && if (this.closeOnKeys.includes(event.keyCode) &&
this.isShown()) { this.isShown()) {
event.stopPropagation(); event.stopPropagation();
this.hide(); this.hide();
} }
}; };
win.addEventListener("keypress", this._onKeyPress); win.addEventListener("keydown", this._onKeyDown);
// Listen to custom emitters' events to close the tooltip // Listen to custom emitters' events to close the tooltip
this.hide = this.hide.bind(this); this.hide = this.hide.bind(this);
@ -234,7 +234,7 @@ class Tooltip {
} }
let win = this.doc.querySelector("window"); 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 {emitter, event, useCapture} of this.closeOnEvents) {
for (let remove of ["removeEventListener", "off"]) { for (let remove of ["removeEventListener", "off"]) {

View File

@ -197,7 +197,7 @@ const ViewHelpers = exports.ViewHelpers = {
* Check if the enter key or space was pressed * Check if the enter key or space was pressed
* *
* @param event event * @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) { isSpaceOrReturn: function (event) {
return event.keyCode === KeyCodes.DOM_VK_SPACE || return event.keyCode === KeyCodes.DOM_VK_SPACE ||
@ -507,7 +507,7 @@ Item.prototype = {
* *
* For automagical keyboard and mouse accessibility, the widget should be an * For automagical keyboard and mouse accessibility, the widget should be an
* event emitter with the following events: * event emitter with the following events:
* - "keyPress" -> (aName:string, aEvent:KeyboardEvent) * - "keyDown" -> (aName:string, aEvent:KeyboardEvent)
* - "mousePress" -> (aName:string, aEvent:MouseEvent) * - "mousePress" -> (aName:string, aEvent:MouseEvent)
*/ */
const WidgetMethods = exports.WidgetMethods = { const WidgetMethods = exports.WidgetMethods = {
@ -526,7 +526,7 @@ const WidgetMethods = exports.WidgetMethods = {
// Handle internal events emitted by the widget if necessary. // Handle internal events emitted by the widget if necessary.
if (ViewHelpers.isEventEmitter(widget)) { 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)); 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 string name
* @param KeyboardEvent event * @param KeyboardEvent event
*/ */
_onWidgetKeyPress: function (name, event) { _onWidgetKeyDown: function (name, event) {
// Prevent scrolling when pressing navigation keys. // Prevent scrolling when pressing navigation keys.
ViewHelpers.preventScrolling(event); ViewHelpers.preventScrolling(event);

View File

@ -31,7 +31,7 @@ class ConsoleOutput extends Component {
return { return {
initialized: PropTypes.bool.isRequired, initialized: PropTypes.bool.isRequired,
messages: PropTypes.object.isRequired, messages: PropTypes.object.isRequired,
messagesUi: PropTypes.object.isRequired, messagesUi: PropTypes.array.isRequired,
serviceContainer: PropTypes.shape({ serviceContainer: PropTypes.shape({
attachRefToHud: PropTypes.func.isRequired, attachRefToHud: PropTypes.func.isRequired,
openContextMenu: PropTypes.func.isRequired, openContextMenu: PropTypes.func.isRequired,

View File

@ -46,7 +46,6 @@ class Message extends Component {
messageId: PropTypes.string, messageId: PropTypes.string,
scrollToMessage: PropTypes.bool, scrollToMessage: PropTypes.bool,
exceptionDocURL: PropTypes.string, exceptionDocURL: PropTypes.string,
parameters: PropTypes.object,
request: PropTypes.object, request: PropTypes.object,
dispatch: PropTypes.func, dispatch: PropTypes.func,
timeStamp: PropTypes.number, timeStamp: PropTypes.number,
@ -261,7 +260,7 @@ class Message extends Component {
dom.span({ className: "message-body-wrapper" }, dom.span({ className: "message-body-wrapper" },
dom.span({ dom.span({
className: "message-flex-body", className: "message-flex-body",
onClick: collapsible && this.toggleMessage, onClick: collapsible ? this.toggleMessage : undefined,
}, },
// Add whitespaces for formatting when copying to the clipboard. // Add whitespaces for formatting when copying to the clipboard.
timestampEl ? " " : null, timestampEl ? " " : null,

View File

@ -180,11 +180,9 @@ skip-if = true # Bug 1437847
[browser_console_filters.js] [browser_console_filters.js]
skip-if = true # Bug 1437848 skip-if = true # Bug 1437848
[browser_console_nsiconsolemessage.js] [browser_console_nsiconsolemessage.js]
skip-if = true # Bug 1437850
[browser_console_open_or_focus.js] [browser_console_open_or_focus.js]
[browser_console_restore.js] [browser_console_restore.js]
[browser_console_webconsole_ctrlw_close_tab.js] [browser_console_webconsole_ctrlw_close_tab.js]
skip-if = true # Bug 1437854
[browser_console_webconsole_iframe_messages.js] [browser_console_webconsole_iframe_messages.js]
[browser_console_webconsole_private_browsing.js] [browser_console_webconsole_private_browsing.js]
skip-if = true # Bug 1403188 skip-if = true # Bug 1403188

View File

@ -3,83 +3,87 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * http://creativecommons.org/publicdomain/zero/1.0/ */
/* import-globals-from head.js */
// Check that nsIConsoleMessages are displayed in the Browser Console. // Check that nsIConsoleMessages are displayed in the Browser Console.
// See bug 859756.
"use strict"; "use strict";
const TEST_URI = "data:text/html;charset=utf8,<title>bug859756</title>\n" + const TEST_URI =
"<p>hello world\n<p>nsIConsoleMessages ftw!"; `data:text/html;charset=utf8,
<title>browser_console_nsiconsolemessage.js</title>
<p>hello world<p>
nsIConsoleMessages ftw!`;
function test() { add_task(async function () {
const FILTER_PREF = "devtools.browserconsole.filter.jslog"; // We don't use `openNewTabAndConsole()` here because we need to log a message
Services.prefs.setBoolPref(FILTER_PREF, true); // before opening the web console.
await addTab(TEST_URI);
registerCleanupFunction(() => {
Services.prefs.clearUserPref(FILTER_PREF);
});
Task.spawn(function* () {
const {tab} = yield loadTab(TEST_URI);
// Test for cached nsIConsoleMessages. // Test for cached nsIConsoleMessages.
Services.console.logStringMessage("test1 for bug859756"); Services.console.logStringMessage("cachedBrowserConsoleMessage");
info("open web console"); info("open web console");
let hud = yield openConsole(tab); let hud = await openConsole();
ok(hud, "web console opened"); ok(hud, "web console opened");
Services.console.logStringMessage("do-not-show-me");
ContentTask.spawn(gBrowser.selectedBrowser, null, function* () { // This "liveBrowserConsoleMessage" message should not be displayed.
content.console.log("foobarz"); 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`);
yield waitForMessages({ // Ensure the "liveBrowserConsoleMessage" and "cachedBrowserConsoleMessage"
webconsole: hud, // messages are not displayed.
messages: [{ text = hud.outputNode.textContent;
text: "foobarz", ok(!text.includes("cachedBrowserConsoleMessage"),
category: CATEGORY_WEBDEV, "cached nsIConsoleMessages are not displayed");
severity: SEVERITY_LOG, ok(!text.includes("liveBrowserConsoleMessage"),
}],
});
let text = hud.outputNode.textContent;
is(text.indexOf("do-not-show-me"), -1,
"nsIConsoleMessages are not displayed"); "nsIConsoleMessages are not displayed");
is(text.indexOf("test1 for bug859756"), -1,
"nsIConsoleMessages are not displayed (confirmed)");
yield closeConsole(tab); await closeConsole();
info("web console closed"); info("web console closed");
hud = yield HUDService.toggleBrowserConsole(); hud = await HUDService.toggleBrowserConsole();
ok(hud, "browser console opened"); ok(hud, "browser console opened");
Services.console.logStringMessage("test2 for bug859756"); await waitFor(() => findMessage(hud, "cachedBrowserConsoleMessage"));
Services.console.logStringMessage("liveBrowserConsoleMessage2");
await waitFor(() => findMessage(hud, "liveBrowserConsoleMessage2"));
let results = yield waitForMessages({ let msg = await waitFor(() => findMessage(hud, "liveBrowserConsoleMessage"));
webconsole: hud, ok(msg, "message element for liveBrowserConsoleMessage (nsIConsoleMessage)");
messages: [{
text: "test1 for bug859756", const outputNode = hud.ui.outputNode;
category: CATEGORY_JS, const toolbar = outputNode.querySelector(".webconsole-filterbar-primary");
}, {
text: "test2 for bug859756", // Test that filtering is working by hiding log messages...
category: CATEGORY_JS, // show the filter bar.
}, { toolbar.querySelector(".devtools-filter-icon").click();
text: "do-not-show-me", const filterBar = await waitFor(() => {
category: CATEGORY_JS, return outputNode.querySelector(".webconsole-filterbar-secondary");
}],
}); });
ok(filterBar, "Filter bar is shown when filter icon is clicked.");
let msg = [...results[2].matched][0]; // Check that messages are not shown when their filter is turned off.
ok(msg, "message element for do-not-show-me (nsIConsoleMessage)"); filterBar.querySelector(".log").click();
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); // 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);
ok(msg.classList.contains("filtered-by-type"), "element is filtered"); // Turn the log filter off.
}).then(finishTest); filterBar.querySelector(".log").click();
}
// Hide the filter bar.
toolbar.querySelector(".devtools-filter-icon").click();
});

View File

@ -3,25 +3,21 @@
/* Any copyright is dedicated to the Public Domain. /* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */ * 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 // Check that Ctrl-W closes the Browser Console and that Ctrl-W closes the
// current tab when using the Web Console - bug 871156. // current tab when using the Web Console - bug 871156.
"use strict"; "use strict";
add_task(function* () { add_task(async function () {
const TEST_URI = "data:text/html;charset=utf8,<title>bug871156</title>\n" + const TEST_URI = "data:text/html;charset=utf8,<title>bug871156</title>\n" +
"<p>hello world"; "<p>hello world";
let firstTab = gBrowser.selectedTab; let firstTab = gBrowser.selectedTab;
Services.prefs.setBoolPref("toolkit.cosmeticAnimations.enabled", false); await pushPref("toolkit.cosmeticAnimations.enabled", false);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("toolkit.cosmeticAnimations.enabled");
});
yield loadTab(TEST_URI); let hud = await openNewTabAndConsole(TEST_URI);
let hud = yield openConsole();
ok(hud, "Web Console opened");
let tabClosed = defer(); let tabClosed = defer();
let toolboxDestroyed = defer(); let toolboxDestroyed = defer();
@ -52,11 +48,11 @@ add_task(function* () {
EventUtils.synthesizeKey("w", { accelKey: true }); EventUtils.synthesizeKey("w", { accelKey: true });
}); });
yield promise.all([tabClosed.promise, toolboxDestroyed.promise, await promise.all([tabClosed.promise, toolboxDestroyed.promise,
tabSelected.promise]); tabSelected.promise]);
info("promise.all resolved. start testing the Browser Console"); info("promise.all resolved. start testing the Browser Console");
hud = yield HUDService.toggleBrowserConsole(); hud = await HUDService.toggleBrowserConsole();
ok(hud, "Browser Console opened"); ok(hud, "Browser Console opened");
let deferred = defer(); let deferred = defer();
@ -72,5 +68,5 @@ add_task(function* () {
EventUtils.synthesizeKey("w", { accelKey: true }, hud.iframeWindow); EventUtils.synthesizeKey("w", { accelKey: true }, hud.iframeWindow);
}, hud.iframeWindow); }, hud.iframeWindow);
yield deferred.promise; await deferred.promise;
}); });

View File

@ -53,7 +53,7 @@ const gFunctions = [
// 2: French // 2: French
[2, (n) => n>1?1:0], [2, (n) => n>1?1:0],
// 3: Latvian // 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: Scottish Gaelic
[4, (n) => n==1||n==11?0:n==2||n==12?1:n>0&&n<20?2:3], [4, (n) => n==1||n==11?0:n==2||n==12?1:n>0&&n<20?2:3],
// 5: Romanian // 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], [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 // 13: Maltese
[4, (n) => n==1?0:n==0||n%100>0&&n%100<=10?1:n%100>10&&n%100<20?2:3], [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], [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], [2, (n) => n%10==1&&n%100!=11?0:1],
// 16: Breton // 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], [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 = { const PluralForm = {

View File

@ -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 // 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. // "view-source:" lopped off and then prepend it again afterwards.
if (scheme.LowerCaseEqualsLiteral("view-source")) { if (scheme.EqualsLiteral("view-source")) {
nsCOMPtr<nsIURIFixupInfo> uriInfo; nsCOMPtr<nsIURIFixupInfo> uriInfo;
// We disable keyword lookup and alternate URIs so that small typos don't // We disable keyword lookup and alternate URIs so that small typos don't
// cause us to look at very different domains // cause us to look at very different domains
@ -177,7 +177,7 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
innerURIString.Trim(" "); innerURIString.Trim(" ");
nsAutoCString innerScheme; nsAutoCString innerScheme;
ioService->ExtractScheme(innerURIString, innerScheme); ioService->ExtractScheme(innerURIString, innerScheme);
if (innerScheme.LowerCaseEqualsLiteral("view-source")) { if (innerScheme.EqualsLiteral("view-source")) {
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
@ -233,47 +233,47 @@ nsDefaultURIFixup::GetFixupURIInfo(const nsACString& aStringURI,
if (sFixTypos && (aFixupFlags & FIXUP_FLAG_FIX_SCHEME_TYPOS)) { if (sFixTypos && (aFixupFlags & FIXUP_FLAG_FIX_SCHEME_TYPOS)) {
// Fast-path for common cases. // Fast-path for common cases.
if (scheme.IsEmpty() || if (scheme.IsEmpty() ||
scheme.LowerCaseEqualsLiteral("http") || scheme.EqualsLiteral("http") ||
scheme.LowerCaseEqualsLiteral("https") || scheme.EqualsLiteral("https") ||
scheme.LowerCaseEqualsLiteral("ftp") || scheme.EqualsLiteral("ftp") ||
scheme.LowerCaseEqualsLiteral("file")) { scheme.EqualsLiteral("file")) {
// Do nothing. // Do nothing.
} else if (scheme.LowerCaseEqualsLiteral("ttp")) { } else if (scheme.EqualsLiteral("ttp")) {
// ttp -> http. // ttp -> http.
uriString.ReplaceLiteral(0, 3, "http"); uriString.ReplaceLiteral(0, 3, "http");
scheme.AssignLiteral("http"); scheme.AssignLiteral("http");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("htp")) { } else if (scheme.EqualsLiteral("htp")) {
// htp -> http. // htp -> http.
uriString.ReplaceLiteral(0, 3, "http"); uriString.ReplaceLiteral(0, 3, "http");
scheme.AssignLiteral("http"); scheme.AssignLiteral("http");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("ttps")) { } else if (scheme.EqualsLiteral("ttps")) {
// ttps -> https. // ttps -> https.
uriString.ReplaceLiteral(0, 4, "https"); uriString.ReplaceLiteral(0, 4, "https");
scheme.AssignLiteral("https"); scheme.AssignLiteral("https");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("tps")) { } else if (scheme.EqualsLiteral("tps")) {
// tps -> https. // tps -> https.
uriString.ReplaceLiteral(0, 3, "https"); uriString.ReplaceLiteral(0, 3, "https");
scheme.AssignLiteral("https"); scheme.AssignLiteral("https");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("ps")) { } else if (scheme.EqualsLiteral("ps")) {
// ps -> https. // ps -> https.
uriString.ReplaceLiteral(0, 2, "https"); uriString.ReplaceLiteral(0, 2, "https");
scheme.AssignLiteral("https"); scheme.AssignLiteral("https");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("htps")) { } else if (scheme.EqualsLiteral("htps")) {
// htps -> https. // htps -> https.
uriString.ReplaceLiteral(0, 4, "https"); uriString.ReplaceLiteral(0, 4, "https");
scheme.AssignLiteral("https"); scheme.AssignLiteral("https");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("ile")) { } else if (scheme.EqualsLiteral("ile")) {
// ile -> file. // ile -> file.
uriString.ReplaceLiteral(0, 3, "file"); uriString.ReplaceLiteral(0, 3, "file");
scheme.AssignLiteral("file"); scheme.AssignLiteral("file");
info->mFixupChangedProtocol = true; info->mFixupChangedProtocol = true;
} else if (scheme.LowerCaseEqualsLiteral("le")) { } else if (scheme.EqualsLiteral("le")) {
// le -> file. // le -> file.
uriString.ReplaceLiteral(0, 2, "file"); uriString.ReplaceLiteral(0, 2, "file");
scheme.AssignLiteral("file"); scheme.AssignLiteral("file");

View File

@ -44,7 +44,6 @@
#include "nsNameSpaceManager.h" #include "nsNameSpaceManager.h"
#include "nsIBaseWindow.h" #include "nsIBaseWindow.h"
#include "nsISelection.h" #include "nsISelection.h"
#include "nsITextControlElement.h"
#include "nsFrameSelection.h" #include "nsFrameSelection.h"
#include "nsPIDOMWindow.h" #include "nsPIDOMWindow.h"
#include "nsPIWindowRoot.h" #include "nsPIWindowRoot.h"
@ -2294,21 +2293,6 @@ GetParentFrameToScroll(nsIFrame* aFrame)
return aFrame->GetParent(); 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 void
EventStateManager::DispatchLegacyMouseScrollEvents(nsIFrame* aTargetFrame, EventStateManager::DispatchLegacyMouseScrollEvents(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent, WidgetWheelEvent* aEvent,
@ -2608,17 +2592,29 @@ EventStateManager::ComputeScrollTarget(nsIFrame* aTargetFrame,
nsIFrame* frameToScroll = do_QueryFrame(scrollableFrame); nsIFrame* frameToScroll = do_QueryFrame(scrollableFrame);
MOZ_ASSERT(frameToScroll); 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) { if (!checkIfScrollableX && !checkIfScrollableY) {
return frameToScroll; 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(); ScrollbarStyles ss = scrollableFrame->GetScrollbarStyles();
bool hiddenForV = (NS_STYLE_OVERFLOW_HIDDEN == ss.mVertical); bool hiddenForV = (NS_STYLE_OVERFLOW_HIDDEN == ss.mVertical);
bool hiddenForH = (NS_STYLE_OVERFLOW_HIDDEN == ss.mHorizontal); bool hiddenForH = (NS_STYLE_OVERFLOW_HIDDEN == ss.mHorizontal);

View File

@ -311,10 +311,6 @@ public:
double* aOutMultiplierX, double* aOutMultiplierX,
double* aOutMultiplierY); 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, // 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 // 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 // the pointer is not locked, but we don't update it while the pointer is

View File

@ -16,6 +16,7 @@
#include "nsIDocument.h" #include "nsIDocument.h"
#include "nsIPresShell.h" #include "nsIPresShell.h"
#include "nsIScrollableFrame.h" #include "nsIScrollableFrame.h"
#include "nsITextControlElement.h"
#include "nsITimer.h" #include "nsITimer.h"
#include "nsPluginFrame.h" #include "nsPluginFrame.h"
#include "nsPresContext.h" #include "nsPresContext.h"
@ -79,6 +80,31 @@ WheelHandlingUtils::CanScrollOn(nsIScrollableFrame* aScrollFrame,
scrollRange.YMost(), aDirectionY)); 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 */ /* mozilla::WheelTransaction */
/******************************************************************/ /******************************************************************/
@ -105,7 +131,7 @@ WheelTransaction::OwnScrollbars(bool aOwn)
/* static */ void /* static */ void
WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame, WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent) const WidgetWheelEvent* aEvent)
{ {
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!"); NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
MOZ_ASSERT(aEvent->mMessage == eWheel, MOZ_ASSERT(aEvent->mMessage == eWheel,
@ -120,7 +146,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
} }
/* static */ bool /* static */ bool
WheelTransaction::UpdateTransaction(WidgetWheelEvent* aEvent) WheelTransaction::UpdateTransaction(const WidgetWheelEvent* aEvent)
{ {
nsIFrame* scrollToFrame = GetTargetFrame(); nsIFrame* scrollToFrame = GetTargetFrame();
nsIScrollableFrame* scrollableFrame = scrollToFrame->GetScrollTargetFrame(); nsIScrollableFrame* scrollableFrame = scrollToFrame->GetScrollTargetFrame();

View File

@ -68,6 +68,12 @@ public:
static bool CanScrollOn(nsIScrollableFrame* aScrollFrame, static bool CanScrollOn(nsIScrollableFrame* aScrollFrame,
double aDirectionX, double aDirectionY); 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: private:
static bool CanScrollInRange(nscoord aMin, nscoord aValue, nscoord aMax, static bool CanScrollInRange(nscoord aMin, nscoord aValue, nscoord aMax,
double aDirection); double aDirection);
@ -159,10 +165,10 @@ public:
protected: protected:
static void BeginTransaction(nsIFrame* aTargetFrame, static void BeginTransaction(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent); const WidgetWheelEvent* aEvent);
// Be careful, UpdateTransaction may fire a DOM event, therefore, the target // Be careful, UpdateTransaction may fire a DOM event, therefore, the target
// frame might be destroyed in the event handler. // frame might be destroyed in the event handler.
static bool UpdateTransaction(WidgetWheelEvent* aEvent); static bool UpdateTransaction(const WidgetWheelEvent* aEvent);
static void MayEndTransaction(); static void MayEndTransaction();
static LayoutDeviceIntPoint GetScreenPoint(WidgetGUIEvent* aEvent); static LayoutDeviceIntPoint GetScreenPoint(WidgetGUIEvent* aEvent);

View File

@ -4,8 +4,6 @@
*/ */
function run_test() { function run_test() {
const { "classes": Cc, "interfaces": Ci, "utils": Cu } = Components;
ChromeUtils.import("resource://gre/modules/Services.jsm"); ChromeUtils.import("resource://gre/modules/Services.jsm");
const INDEXEDDB_HEAD_FILE = "xpcshell-head-parent-process.js"; const INDEXEDDB_HEAD_FILE = "xpcshell-head-parent-process.js";

View File

@ -39,6 +39,7 @@ using namespace std;
using namespace mozilla::dom; // for WebAudioUtils using namespace mozilla::dom; // for WebAudioUtils
using mozilla::IsInfinite; using mozilla::IsInfinite;
using mozilla::PositiveInfinity;
using mozilla::IsNaN; using mozilla::IsNaN;
using mozilla::MakeUnique; using mozilla::MakeUnique;
@ -321,7 +322,13 @@ void DynamicsCompressorKernel::process(float* sourceChannels[],
bool isReleasing = scaledDesiredGain > m_compressorGain; bool isReleasing = scaledDesiredGain > m_compressorGain;
// compressionDiffDb is the difference between current compression level and the desired level. // 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) { if (isReleasing) {
// Release mode - compressionDiffDb should be negative dB // Release mode - compressionDiffDb should be negative dB

View File

@ -416,6 +416,12 @@ public:
const nsString& aDeviceId, const nsString& aDeviceId,
const char** aOutBadConstraint) override; 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, void Pull(const RefPtr<const AllocationHandle>& aHandle,
const RefPtr<SourceMediaStream>& aStream, const RefPtr<SourceMediaStream>& aStream,
TrackID aTrackID, TrackID aTrackID,

View File

@ -754,6 +754,13 @@ MediaEngineWebRTCMicrophoneSource::Stop(const RefPtr<const AllocationHandle>& aH
return NS_OK; return NS_OK;
} }
void
MediaEngineWebRTCMicrophoneSource::GetSettings(dom::MediaTrackSettings& aOutSettings) const
{
MOZ_ASSERT(NS_IsMainThread());
aOutSettings = *mSettings;
}
void void
MediaEngineWebRTCMicrophoneSource::Pull(const RefPtr<const AllocationHandle>& aHandle, MediaEngineWebRTCMicrophoneSource::Pull(const RefPtr<const AllocationHandle>& aHandle,
const RefPtr<SourceMediaStream>& aStream, const RefPtr<SourceMediaStream>& aStream,

View File

@ -81,6 +81,7 @@
#include "nsIFrame.h" #include "nsIFrame.h"
#include "nsNodeInfoManager.h" #include "nsNodeInfoManager.h"
#include "nsXBLBinding.h" #include "nsXBLBinding.h"
#include "nsXULTooltipListener.h"
#include "mozilla/EventDispatcher.h" #include "mozilla/EventDispatcher.h"
#include "mozAutoDocUpdate.h" #include "mozAutoDocUpdate.h"
#include "nsIDOMXULCommandEvent.h" #include "nsIDOMXULCommandEvent.h"
@ -734,6 +735,19 @@ private:
nsCOMPtr<nsIDocument> mDocument; 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 nsresult
nsXULElement::BindToTree(nsIDocument* aDocument, nsXULElement::BindToTree(nsIDocument* aDocument,
nsIContent* aParent, nsIContent* aParent,
@ -786,6 +800,10 @@ nsXULElement::BindToTree(nsIDocument* aDocument,
} }
} }
if (doc && NeedTooltipSupport(*this)) {
AddTooltipSupport();
}
if (aDocument) { if (aDocument) {
NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(), NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(),
"Missing a script blocker!"); "Missing a script blocker!");
@ -799,6 +817,10 @@ nsXULElement::BindToTree(nsIDocument* aDocument,
void void
nsXULElement::UnbindFromTree(bool aDeep, bool aNullParent) nsXULElement::UnbindFromTree(bool aDeep, bool aNullParent)
{ {
if (NeedTooltipSupport(*this)) {
RemoveTooltipSupport();
}
// mControllers can own objects that are implemented // mControllers can own objects that are implemented
// in JavaScript (such as some implementations of // in JavaScript (such as some implementations of
// nsIControllers. These objects prevent their global // 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 // XXX need to check if they're changing an event handler: if
// so, then we need to unhook the old one. Or something. // 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); 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 bool
nsXULElement::ParseAttribute(int32_t aNamespaceID, nsXULElement::ParseAttribute(int32_t aNamespaceID,
nsAtom* aAttribute, nsAtom* aAttribute,

View File

@ -754,6 +754,9 @@ protected:
void RemoveBroadcaster(const nsAString & broadcasterId); void RemoveBroadcaster(const nsAString & broadcasterId);
protected: protected:
void AddTooltipSupport();
void RemoveTooltipSupport();
// Internal accessor. This shadows the 'Slots', and returns // Internal accessor. This shadows the 'Slots', and returns
// appropriate value. // appropriate value.
nsIControllers *Controllers() { nsIControllers *Controllers() {

View File

@ -7,7 +7,7 @@
#ifndef GFX_FRAMEMETRICS_H #ifndef GFX_FRAMEMETRICS_H
#define 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 "Units.h" // for CSSRect, CSSPixel, etc
#include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM #include "mozilla/DefineEnum.h" // for MOZ_DEFINE_ENUM
#include "mozilla/HashFunctions.h" // for HashGeneric #include "mozilla/HashFunctions.h" // for HashGeneric
@ -16,6 +16,7 @@
#include "mozilla/gfx/Rect.h" // for RoundedIn #include "mozilla/gfx/Rect.h" // for RoundedIn
#include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor #include "mozilla/gfx/ScaleFactor.h" // for ScaleFactor
#include "mozilla/gfx/Logging.h" // for Log #include "mozilla/gfx/Logging.h" // for Log
#include "mozilla/layers/LayersTypes.h" // for ScrollDirection
#include "mozilla/StaticPtr.h" // for StaticAutoPtr #include "mozilla/StaticPtr.h" // for StaticAutoPtr
#include "mozilla/TimeStamp.h" // for TimeStamp #include "mozilla/TimeStamp.h" // for TimeStamp
#include "nsString.h" #include "nsString.h"
@ -819,7 +820,6 @@ public:
, mPageScrollAmount(0, 0) , mPageScrollAmount(0, 0)
, mScrollClip() , mScrollClip()
, mHasScrollgrab(false) , mHasScrollgrab(false)
, mAllowVerticalScrollWithWheel(false)
, mIsLayersIdRoot(false) , mIsLayersIdRoot(false)
, mUsesContainerScrolling(false) , mUsesContainerScrolling(false)
, mForceDisableApz(false) , mForceDisableApz(false)
@ -837,10 +837,10 @@ public:
mPageScrollAmount == aOther.mPageScrollAmount && mPageScrollAmount == aOther.mPageScrollAmount &&
mScrollClip == aOther.mScrollClip && mScrollClip == aOther.mScrollClip &&
mHasScrollgrab == aOther.mHasScrollgrab && mHasScrollgrab == aOther.mHasScrollgrab &&
mAllowVerticalScrollWithWheel == aOther.mAllowVerticalScrollWithWheel &&
mIsLayersIdRoot == aOther.mIsLayersIdRoot && mIsLayersIdRoot == aOther.mIsLayersIdRoot &&
mUsesContainerScrolling == aOther.mUsesContainerScrolling && mUsesContainerScrolling == aOther.mUsesContainerScrolling &&
mForceDisableApz == aOther.mForceDisableApz && mForceDisableApz == aOther.mForceDisableApz &&
mDisregardedDirection == aOther.mDisregardedDirection &&
mOverscrollBehavior == aOther.mOverscrollBehavior; mOverscrollBehavior == aOther.mOverscrollBehavior;
} }
@ -926,12 +926,6 @@ public:
bool GetHasScrollgrab() const { bool GetHasScrollgrab() const {
return mHasScrollgrab; return mHasScrollgrab;
} }
bool AllowVerticalScrollWithWheel() const {
return mAllowVerticalScrollWithWheel;
}
void SetAllowVerticalScrollWithWheel(bool aValue) {
mAllowVerticalScrollWithWheel = aValue;
}
void SetIsLayersIdRoot(bool aValue) { void SetIsLayersIdRoot(bool aValue) {
mIsLayersIdRoot = aValue; mIsLayersIdRoot = aValue;
} }
@ -951,6 +945,16 @@ public:
return mForceDisableApz; 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) { void SetOverscrollBehavior(const OverscrollBehaviorInfo& aOverscrollBehavior) {
mOverscrollBehavior = aOverscrollBehavior; mOverscrollBehavior = aOverscrollBehavior;
} }
@ -992,9 +996,6 @@ private:
// Whether or not this frame is for an element marked 'scrollgrab'. // Whether or not this frame is for an element marked 'scrollgrab'.
bool mHasScrollgrab:1; 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 // Whether these framemetrics are for the root scroll frame (root element if
// we don't have a root scroll frame) for its layers id. // we don't have a root scroll frame) for its layers id.
bool mIsLayersIdRoot:1; bool mIsLayersIdRoot:1;
@ -1007,6 +1008,13 @@ private:
// scrollframe. // scrollframe.
bool mForceDisableApz:1; 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. // The overscroll behavior for this scroll frame.
OverscrollBehaviorInfo mOverscrollBehavior; OverscrollBehaviorInfo mOverscrollBehavior;
@ -1014,9 +1022,10 @@ private:
// //
// When adding new fields to ScrollMetadata, the following places should be // When adding new fields to ScrollMetadata, the following places should be
// updated to include them (as needed): // updated to include them (as needed):
// ScrollMetadata::operator == // 1. ScrollMetadata::operator ==
// AsyncPanZoomController::NotifyLayersUpdated // 2. AsyncPanZoomController::NotifyLayersUpdated
// The ParamTraits specialization in GfxMessageUtils.h // 3. The ParamTraits specialization in GfxMessageUtils.h and/or
// LayersMessageUtils.h
// //
// Please add new fields above this comment. // Please add new fields above this comment.
}; };

View File

@ -1965,10 +1965,17 @@ bool
AsyncPanZoomController::CanScrollWithWheel(const ParentLayerPoint& aDelta) const AsyncPanZoomController::CanScrollWithWheel(const ParentLayerPoint& aDelta) const
{ {
RecursiveMutexAutoLock lock(mRecursiveMutex); 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; return true;
} }
if (mY.CanScroll(aDelta.y) && mScrollMetadata.AllowVerticalScrollWithWheel()) { if (mY.CanScroll(aDelta.y) &&
disregardedDirection != Some(ScrollDirection::eVertical)) {
return true; return true;
} }
return false; return false;
@ -2713,15 +2720,20 @@ bool AsyncPanZoomController::AttemptScroll(ParentLayerPoint& aStartPoint,
if (scrollThisApzc) { if (scrollThisApzc) {
RecursiveMutexAutoLock lock(mRecursiveMutex); 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; ParentLayerPoint adjustedDisplacement;
bool forceVerticalOverscroll = bool yChanged = mY.AdjustDisplacement(displacement.y, adjustedDisplacement.y,
(aOverscrollHandoffState.mScrollSource == ScrollSource::Wheel && overscroll.y,
!mScrollMetadata.AllowVerticalScrollWithWheel()); forcesVerticalOverscroll);
bool yChanged = mY.AdjustDisplacement(displacement.y, adjustedDisplacement.y, overscroll.y, bool xChanged = mX.AdjustDisplacement(displacement.x, adjustedDisplacement.x,
forceVerticalOverscroll); overscroll.x,
bool xChanged = mX.AdjustDisplacement(displacement.x, adjustedDisplacement.x, overscroll.x); forcesHorizontalOverscroll);
if (xChanged || yChanged) { if (xChanged || yChanged) {
ScheduleComposite(); ScheduleComposite();
} }
@ -3945,6 +3957,7 @@ void AsyncPanZoomController::NotifyLayersUpdated(const ScrollMetadata& aScrollMe
mScrollMetadata.SetUsesContainerScrolling(aScrollMetadata.UsesContainerScrolling()); mScrollMetadata.SetUsesContainerScrolling(aScrollMetadata.UsesContainerScrolling());
mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer()); mFrameMetrics.SetIsScrollInfoLayer(aLayerMetrics.IsScrollInfoLayer());
mScrollMetadata.SetForceDisableApz(aScrollMetadata.IsApzForceDisabled()); mScrollMetadata.SetForceDisableApz(aScrollMetadata.IsApzForceDisabled());
mScrollMetadata.SetDisregardedDirection(aScrollMetadata.GetDisregardedDirection());
mScrollMetadata.SetOverscrollBehavior(aScrollMetadata.GetOverscrollBehavior()); mScrollMetadata.SetOverscrollBehavior(aScrollMetadata.GetOverscrollBehavior());
if (scrollOffsetUpdated) { if (scrollOffsetUpdated) {

View File

@ -83,9 +83,9 @@ public:
* to prevent the viewport from overscrolling the page rect), and axis locking * to prevent the viewport from overscrolling the page rect), and axis locking
* (which might prevent any displacement from happening). If overscroll * (which might prevent any displacement from happening). If overscroll
* ocurred, its amount is written to |aOverscrollAmountOut|. * ocurred, its amount is written to |aOverscrollAmountOut|.
* The |aDisplacementOut| parameter is set to the adjusted * The |aDisplacementOut| parameter is set to the adjusted displacement, and
* displacement, and the function returns true iff internal overscroll amounts * the function returns true if and only if internal overscroll amounts were
* were changed. * changed.
*/ */
bool AdjustDisplacement(ParentLayerCoord aDisplacement, bool AdjustDisplacement(ParentLayerCoord aDisplacement,
/* ParentLayerCoord */ float& aDisplacementOut, /* ParentLayerCoord */ float& aDisplacementOut,

View File

@ -21,7 +21,6 @@ GenericScrollAnimation::GenericScrollAnimation(AsyncPanZoomController& aApzc,
const ScrollAnimationBezierPhysicsSettings& aSettings) const ScrollAnimationBezierPhysicsSettings& aSettings)
: mApzc(aApzc) : mApzc(aApzc)
, mFinalDestination(aInitialPosition) , mFinalDestination(aInitialPosition)
, mForceVerticalOverscroll(false)
{ {
if (gfxPrefs::SmoothScrollMSDPhysicsEnabled()) { if (gfxPrefs::SmoothScrollMSDPhysicsEnabled()) {
mAnimationPhysics = MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition); mAnimationPhysics = MakeUnique<ScrollAnimationMSDPhysics>(aInitialPosition);
@ -86,9 +85,12 @@ GenericScrollAnimation::DoSample(FrameMetrics& aFrameMetrics, const TimeDuration
// Note: we ignore overscroll for generic animations. // Note: we ignore overscroll for generic animations.
ParentLayerPoint adjustedOffset, overscroll; 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, 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, // 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 // then end the animation early. Note that the initial displacement could be 0

View File

@ -42,7 +42,12 @@ protected:
AsyncPanZoomController& mApzc; AsyncPanZoomController& mApzc;
UniquePtr<ScrollAnimationPhysics> mAnimationPhysics; UniquePtr<ScrollAnimationPhysics> mAnimationPhysics;
nsPoint mFinalDestination; 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 } // namespace layers

View File

@ -46,7 +46,8 @@ WheelScrollAnimation::WheelScrollAnimation(AsyncPanZoomController& aApzc,
ScrollWheelInput::ScrollDeltaType aDeltaType) ScrollWheelInput::ScrollDeltaType aDeltaType)
: GenericScrollAnimation(aApzc, aInitialPosition, SettingsForDeltaType(aDeltaType)) : GenericScrollAnimation(aApzc, aInitialPosition, SettingsForDeltaType(aDeltaType))
{ {
mForceVerticalOverscroll = !mApzc.mScrollMetadata.AllowVerticalScrollWithWheel(); mDirectionForcedToOverscroll =
mApzc.mScrollMetadata.GetDisregardedDirection();
} }
} // namespace layers } // namespace layers

View File

@ -72,7 +72,6 @@ protected:
metrics.SetScrollOffset(CSSPoint(0, 0)); metrics.SetScrollOffset(CSSPoint(0, 0));
metadata.SetPageScrollAmount(LayoutDeviceIntSize(50, 100)); metadata.SetPageScrollAmount(LayoutDeviceIntSize(50, 100));
metadata.SetLineScrollAmount(LayoutDeviceIntSize(5, 10)); metadata.SetLineScrollAmount(LayoutDeviceIntSize(5, 10));
metadata.SetAllowVerticalScrollWithWheel(true);
return metadata; return metadata;
} }

View File

@ -289,10 +289,10 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
WriteParam(aMsg, aParam.mPageScrollAmount); WriteParam(aMsg, aParam.mPageScrollAmount);
WriteParam(aMsg, aParam.mScrollClip); WriteParam(aMsg, aParam.mScrollClip);
WriteParam(aMsg, aParam.mHasScrollgrab); WriteParam(aMsg, aParam.mHasScrollgrab);
WriteParam(aMsg, aParam.mAllowVerticalScrollWithWheel);
WriteParam(aMsg, aParam.mIsLayersIdRoot); WriteParam(aMsg, aParam.mIsLayersIdRoot);
WriteParam(aMsg, aParam.mUsesContainerScrolling); WriteParam(aMsg, aParam.mUsesContainerScrolling);
WriteParam(aMsg, aParam.mForceDisableApz); WriteParam(aMsg, aParam.mForceDisableApz);
WriteParam(aMsg, aParam.mDisregardedDirection);
WriteParam(aMsg, aParam.mOverscrollBehavior); WriteParam(aMsg, aParam.mOverscrollBehavior);
} }
@ -317,10 +317,10 @@ struct ParamTraits<mozilla::layers::ScrollMetadata>
ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) && ReadParam(aMsg, aIter, &aResult->mPageScrollAmount) &&
ReadParam(aMsg, aIter, &aResult->mScrollClip) && ReadParam(aMsg, aIter, &aResult->mScrollClip) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetHasScrollgrab) && ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetHasScrollgrab) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetAllowVerticalScrollWithWheel) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsLayersIdRoot) && ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetIsLayersIdRoot) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetUsesContainerScrolling) && ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetUsesContainerScrolling) &&
ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetForceDisableApz) && ReadBoolForBitfield(aMsg, aIter, aResult, &paramType::SetForceDisableApz) &&
ReadParam(aMsg, aIter, &aResult->mDisregardedDirection) &&
ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior)); ReadParam(aMsg, aIter, &aResult->mOverscrollBehavior));
} }
}; };

View File

@ -394,19 +394,6 @@ GeckoRestyleManager::AttributeChanged(Element* aElement,
tag == nsGkAtoms::listcell)) tag == nsGkAtoms::listcell))
return; 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 #endif // MOZ_XUL
if (primaryFrame) { if (primaryFrame) {

View File

@ -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) == NS_ASSERTION(newFrame->IsFrameOfType(nsIFrame::eLineParticipant) ==
((bits & FCDATA_IS_LINE_PARTICIPANT) != 0), ((bits & FCDATA_IS_LINE_PARTICIPANT) != 0),
"Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits"); "Incorrectly set FCDATA_IS_LINE_PARTICIPANT bits");

View File

@ -115,11 +115,11 @@
#include "mozilla/layers/CompositorBridgeChild.h" #include "mozilla/layers/CompositorBridgeChild.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/EventDispatcher.h" #include "mozilla/EventDispatcher.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/RuleNodeCacheConditions.h" #include "mozilla/RuleNodeCacheConditions.h"
#include "mozilla/StyleAnimationValue.h" #include "mozilla/StyleAnimationValue.h"
#include "mozilla/StyleSetHandle.h" #include "mozilla/StyleSetHandle.h"
#include "mozilla/StyleSetHandleInlines.h" #include "mozilla/StyleSetHandleInlines.h"
#include "mozilla/WheelHandlingHelper.h" // for WheelHandlingUtils
#include "RegionBuilder.h" #include "RegionBuilder.h"
#include "SVGViewportElement.h" #include "SVGViewportElement.h"
#include "DisplayItemClip.h" #include "DisplayItemClip.h"
@ -9403,10 +9403,10 @@ nsLayoutUtils::ComputeScrollMetadata(nsIFrame* aForFrame,
LayoutDeviceIntSize::FromAppUnitsRounded(pageScrollAmount, presContext->AppUnitsPerDevPixel()); LayoutDeviceIntSize::FromAppUnitsRounded(pageScrollAmount, presContext->AppUnitsPerDevPixel());
metadata.SetPageScrollAmount(pageScrollAmountInDevPixels); metadata.SetPageScrollAmount(pageScrollAmountInDevPixels);
if (!aScrollFrame->GetParent() || if (aScrollFrame->GetParent()) {
EventStateManager::CanVerticallyScrollFrameWithWheel(aScrollFrame->GetParent())) metadata.SetDisregardedDirection(
{ WheelHandlingUtils::GetDisregardedWheelScrollDirection(
metadata.SetAllowVerticalScrollWithWheel(true); aScrollFrame->GetParent()));
} }
metadata.SetUsesContainerScrolling(scrollableFrame->UsesContainerScrolling()); metadata.SetUsesContainerScrolling(scrollableFrame->UsesContainerScrolling());

View File

@ -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-ancestor-style-change-01.svg foreignObject-ancestor-style-change-01-ref.svg
== foreignObject-change-transform-01.svg pass.svg == foreignObject-change-transform-01.svg pass.svg
== foreignObject-display-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.html foreignObject-img-ref.html
== foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html == foreignObject-img-form-theme.html foreignObject-img-form-theme-ref.html
== foreignObject-move-repaint-01.svg pass.svg == foreignObject-move-repaint-01.svg pass.svg

View File

@ -267,12 +267,6 @@ function InitAndStartRefTests()
g.focusFilterMode = prefs.getCharPref("reftest.focusFilterMode"); g.focusFilterMode = prefs.getCharPref("reftest.focusFilterMode");
} catch(e) {} } catch(e) {}
try {
g.startAfter = prefs.getCharPref("reftest.startAfter");
} catch(e) {
g.startAfter = undefined;
}
try { try {
g.compareRetainedDisplayLists = prefs.getBoolPref("reftest.compareRetainedDisplayLists"); g.compareRetainedDisplayLists = prefs.getBoolPref("reftest.compareRetainedDisplayLists");
} catch (e) {} } catch (e) {}
@ -509,7 +503,7 @@ function StartTests()
g.urls = g.urls.slice(start, end); 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) { var ids = g.urls.map(function(obj) {
return obj.identifier; return obj.identifier;
}); });
@ -519,28 +513,10 @@ function StartTests()
} }
if (g.shuffle) { 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); 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; g.totalTests = g.urls.length;
if (!g.totalTests && !g.verify) if (!g.totalTests && !g.verify)
throw "No tests to run"; throw "No tests to run";

View File

@ -143,12 +143,12 @@ class ReftestServer:
class RemoteReftest(RefTest): class RemoteReftest(RefTest):
use_marionette = False use_marionette = False
parse_manifest = False
remoteApp = '' remoteApp = ''
resolver_cls = RemoteReftestResolver resolver_cls = RemoteReftestResolver
def __init__(self, automation, devicemanager, options, scriptDir): def __init__(self, automation, devicemanager, options, scriptDir):
RefTest.__init__(self) RefTest.__init__(self, options.suite)
self.run_by_manifest = False
self.automation = automation self.automation = automation
self._devicemanager = devicemanager self._devicemanager = devicemanager
self.scriptDir = scriptDir self.scriptDir = scriptDir
@ -259,17 +259,13 @@ class RemoteReftest(RefTest):
# may not be able to access process info for all processes # may not be able to access process info for all processes
continue continue
def createReftestProfile(self, options, startAfter=None, **kwargs): def createReftestProfile(self, options, **kwargs):
profile = RefTest.createReftestProfile(self, profile = RefTest.createReftestProfile(self,
options, options,
server=options.remoteWebServer, server=options.remoteWebServer,
port=options.httpPort, port=options.httpPort,
**kwargs) **kwargs)
if startAfter is not None:
print ("WARNING: Continuing after a crash is not supported for remote "
"reftest yet.")
profileDir = profile.profile profileDir = profile.profile
prefs = {} prefs = {}
prefs["app.update.url.android"] = "" prefs["app.update.url.android"] = ""
prefs["browser.firstrun.show.localepicker"] = False 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. # reftest pages at 1.0 zoom, rather than zooming to fit the CSS viewport.
prefs["apz.allow_zooming"] = False 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. # Set the extra prefs.
profile.set_preferences(prefs) profile.set_preferences(prefs)
@ -353,7 +344,7 @@ class RemoteReftest(RefTest):
env = self.buildBrowserEnv(options, profile.profile) env = self.buildBrowserEnv(options, profile.profile)
self.log.info("Running with e10s: {}".format(options.e10s)) self.log.info("Running with e10s: {}".format(options.e10s))
status, lastTestSeen = self.automation.runApp(None, env, status, self.lastTestSeen = self.automation.runApp(None, env,
binary, binary,
profile.profile, profile.profile,
cmdargs, cmdargs,
@ -362,12 +353,9 @@ class RemoteReftest(RefTest):
debuggerInfo=debuggerInfo, debuggerInfo=debuggerInfo,
symbolsPath=symbolsPath, symbolsPath=symbolsPath,
timeout=timeout) timeout=timeout)
if status == 1:
# when max run time exceeded, avoid restart
lastTestSeen = RefTest.TEST_SEEN_FINAL
self.cleanup(profile.profile) self.cleanup(profile.profile)
return status, lastTestSeen, self.outputHandler.results return status
def cleanup(self, profileDir): def cleanup(self, profileDir):
# Pull results back from device # Pull results back from device

View File

@ -6,9 +6,7 @@
Runs the reftest test harness. Runs the reftest test harness.
""" """
import collections
import copy import copy
import itertools
import json import json
import multiprocessing import multiprocessing
import os import os
@ -20,6 +18,7 @@ import subprocess
import sys import sys
import tempfile import tempfile
import threading import threading
from collections import defaultdict
from datetime import datetime, timedelta from datetime import datetime, timedelta
SCRIPT_DIRECTORY = os.path.abspath( SCRIPT_DIRECTORY = os.path.abspath(
@ -227,21 +226,23 @@ class ReftestResolver(object):
class RefTest(object): class RefTest(object):
TEST_SEEN_INITIAL = 'reftest'
TEST_SEEN_FINAL = 'Main app process exited normally'
oldcwd = os.getcwd() oldcwd = os.getcwd()
parse_manifest = True
resolver_cls = ReftestResolver resolver_cls = ReftestResolver
use_marionette = True use_marionette = True
def __init__(self): def __init__(self, suite):
update_mozinfo() update_mozinfo()
self.lastTestSeen = self.TEST_SEEN_INITIAL self.lastTestSeen = None
self.haveDumpedScreen = False self.haveDumpedScreen = False
self.resolver = self.resolver_cls() self.resolver = self.resolver_cls()
self.log = None self.log = None
self.outputHandler = None
self.testDumpFile = os.path.join(tempfile.gettempdir(), 'reftests.json') 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): def _populate_logger(self, options):
if self.log: if self.log:
return return
@ -265,8 +266,7 @@ class RefTest(object):
return os.path.normpath(os.path.join(self.oldcwd, os.path.expanduser(path))) return os.path.normpath(os.path.join(self.oldcwd, os.path.expanduser(path)))
def createReftestProfile(self, options, tests=None, manifests=None, def createReftestProfile(self, options, tests=None, manifests=None,
server='localhost', port=0, profile_to_clone=None, server='localhost', port=0, profile_to_clone=None, prefs=None):
startAfter=None, prefs=None):
"""Sets up a profile for reftest. """Sets up a profile for reftest.
:param options: Object containing command line options :param options: Object containing command line options
@ -276,7 +276,6 @@ class RefTest(object):
:param server: Server name to use for http tests :param server: Server name to use for http tests
:param profile_to_clone: Path to a profile to use as the basis for the :param profile_to_clone: Path to a profile to use as the basis for the
test profile test profile
:param startAfter: Start running tests after the specified test id
:param prefs: Extra preferences to set in the profile :param prefs: Extra preferences to set in the profile
""" """
locations = mozprofile.permissions.ServerLocations() locations = mozprofile.permissions.ServerLocations()
@ -306,16 +305,18 @@ class RefTest(object):
prefs['reftest.logLevel'] = options.log_tbpl_level or 'info' prefs['reftest.logLevel'] = options.log_tbpl_level or 'info'
prefs['reftest.suite'] = options.suite 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. # Unconditionally update the e10s pref.
if options.e10s: if options.e10s:
prefs['browser.tabs.remote.autostart'] = True prefs['browser.tabs.remote.autostart'] = True
else: else:
prefs['browser.tabs.remote.autostart'] = False 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 # Bug 1262954: For winXP + e10s disable acceleration
if platform.system() in ("Windows", "Microsoft") and \ if platform.system() in ("Windows", "Microsoft") and \
'5.1' in platform.version() and options.e10s: '5.1' in platform.version() and options.e10s:
@ -532,6 +533,7 @@ class RefTest(object):
def runTests(self, tests, options, cmdargs=None): def runTests(self, tests, options, cmdargs=None):
cmdargs = cmdargs or [] cmdargs = cmdargs or []
self._populate_logger(options) self._populate_logger(options)
self.outputHandler = OutputHandler(self.log, options.utilityPath, options.symbolsPath)
if options.cleanupCrashes: if options.cleanupCrashes:
mozcrash.cleanup_pending_crash_reports() mozcrash.cleanup_pending_crash_reports()
@ -603,7 +605,7 @@ class RefTest(object):
focusThread.join() focusThread.join()
# Output the summaries that the ReftestThread filters suppressed. # 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 t in threads:
for (summaryObj, (text, categories)) in zip(summaryObjects, summaryLines): for (summaryObj, (text, categories)) in zip(summaryObjects, summaryLines):
threadMatches = t.summaryMatches[text] threadMatches = t.summaryMatches[text]
@ -677,6 +679,7 @@ class RefTest(object):
if cmdargs is None: if cmdargs is None:
cmdargs = [] cmdargs = []
cmdargs = cmdargs[:]
if self.use_marionette: if self.use_marionette:
cmdargs.append('-marionette') cmdargs.append('-marionette')
@ -709,19 +712,17 @@ class RefTest(object):
self.log.add_handler(record_last_test) self.log.add_handler(record_last_test)
outputHandler = OutputHandler(self.log, options.utilityPath, symbolsPath=symbolsPath)
kp_kwargs = { kp_kwargs = {
'kill_on_timeout': False, 'kill_on_timeout': False,
'cwd': SCRIPT_DIRECTORY, 'cwd': SCRIPT_DIRECTORY,
'onTimeout': [timeoutHandler], 'onTimeout': [timeoutHandler],
'processOutputLine': [outputHandler], 'processOutputLine': [self.outputHandler],
} }
if mozinfo.isWin: if mozinfo.isWin:
# Prevents log interleaving on Windows at the expense of losing # Prevents log interleaving on Windows at the expense of losing
# true log order. See bug 798300 and bug 1324961 for more details. # true log order. See bug 798300 and bug 1324961 for more details.
kp_kwargs['processStderrLine'] = [outputHandler] kp_kwargs['processStderrLine'] = [self.outputHandler]
if interactive: if interactive:
# If an interactive debugger is attached, # If an interactive debugger is attached,
@ -741,7 +742,7 @@ class RefTest(object):
interactive=interactive, interactive=interactive,
outputTimeout=timeout) outputTimeout=timeout)
proc = runner.process_handler 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 # Used to defer a possible IOError exception from Marionette
marionette_exception = None marionette_exception = None
@ -778,18 +779,16 @@ class RefTest(object):
status = runner.wait() status = runner.wait()
runner.process_handler = None runner.process_handler = None
outputHandler.proc_name = None self.outputHandler.proc_name = None
if status: if status:
msg = "TEST-UNEXPECTED-FAIL | %s | application terminated with exit code %s" % \ 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 # use process_output so message is logged verbatim
self.log.process_output(None, msg) 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'), 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: if not status and crashed:
status = 1 status = 1
@ -801,7 +800,7 @@ class RefTest(object):
raise exc, value, tb raise exc, value, tb
self.log.info("Process mode: {}".format('e10s' if options.e10s else 'non-e10s')) 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): def getActiveTests(self, manifests, options, testDumpFile=None):
# These prefs will cause reftest.jsm to parse the manifests, # These prefs will cause reftest.jsm to parse the manifests,
@ -810,8 +809,8 @@ class RefTest(object):
'reftest.manifests': json.dumps(manifests), 'reftest.manifests': json.dumps(manifests),
'reftest.manifests.dumpTests': testDumpFile or self.testDumpFile, 'reftest.manifests.dumpTests': testDumpFile or self.testDumpFile,
} }
cmdargs = [] # ['-headless'] cmdargs = []
status, _, _ = self.runApp(options, cmdargs=cmdargs, prefs=prefs) self.runApp(options, cmdargs=cmdargs, prefs=prefs)
with open(self.testDumpFile, 'r') as fh: with open(self.testDumpFile, 'r') as fh:
tests = json.load(fh) tests = json.load(fh)
@ -828,7 +827,7 @@ class RefTest(object):
filters = [] filters = []
if options.totalChunks: 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) tests = mp.active_tests(exists=False, filters=filters)
return tests return tests
@ -839,19 +838,9 @@ class RefTest(object):
debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs, debuggerInfo = mozdebug.get_debugger_info(options.debugger, options.debuggerArgs,
options.debuggerInteractive) options.debuggerInteractive)
tests = None def run(**kwargs):
if self.parse_manifest: status = self.runApp(
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(
options, options,
tests=tests,
manifests=manifests, manifests=manifests,
cmdargs=cmdargs, cmdargs=cmdargs,
# We generally want the JS harness or marionette # We generally want the JS harness or marionette
@ -865,43 +854,36 @@ class RefTest(object):
# the 360 second marionette socket timeout. # the 360 second marionette socket timeout.
# See bug 479518 and bug 1414063. # See bug 479518 and bug 1414063.
timeout=options.timeout + 70.0, timeout=options.timeout + 70.0,
symbolsPath=options.symbolsPath, debuggerInfo=debuggerInfo,
debuggerInfo=debuggerInfo **kwargs)
)
mozleak.process_leak_log(self.leakLogFile, mozleak.process_leak_log(self.leakLogFile,
leak_thresholds=options.leakThresholds, leak_thresholds=options.leakThresholds,
stack_fixer=get_stack_fixer_function(options.utilityPath, stack_fixer=get_stack_fixer_function(options.utilityPath,
options.symbolsPath)) options.symbolsPath))
if status == 0:
break
if startAfter == self.TEST_SEEN_FINAL:
self.log.info("Finished running all tests, skipping resume "
"despite non-zero status code: %s" % status)
break
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
if self.parse_manifest:
self.log.suite_end(extra={'results': results})
return status return status
if not self.run_by_manifest:
return run()
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'])
self.log.suite_start(ids_by_manifest, name=options.suite)
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): def copyExtraFilesToProfile(self, options, profile):
"Copy extra files or dirs specified on the command line to the testing profile." "Copy extra files or dirs specified on the command line to the testing profile."
profileDir = profile.profile profileDir = profile.profile
@ -928,7 +910,7 @@ class RefTest(object):
def run_test_harness(parser, options): def run_test_harness(parser, options):
reftest = RefTest() reftest = RefTest(options.suite)
parser.validate(options, reftest) parser.validate(options, reftest)
# We have to validate options.app here for the case when the mach # We have to validate options.app here for the case when the mach

View File

@ -30,9 +30,6 @@ public:
virtual mozilla::dom::Element* GetDefaultTooltip() = 0; virtual mozilla::dom::Element* GetDefaultTooltip() = 0;
virtual void SetDefaultTooltip(mozilla::dom::Element* aTooltip) = 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); static nsIRootBox* GetRootBox(nsIPresShell* aShell);
}; };

View File

@ -12,7 +12,6 @@
#include "nsStackLayout.h" #include "nsStackLayout.h"
#include "nsIRootBox.h" #include "nsIRootBox.h"
#include "nsIContent.h" #include "nsIContent.h"
#include "nsXULTooltipListener.h"
#include "nsFrameManager.h" #include "nsFrameManager.h"
#include "mozilla/BasicEvents.h" #include "mozilla/BasicEvents.h"
@ -57,8 +56,6 @@ public:
virtual void SetPopupSetFrame(nsPopupSetFrame* aPopupSet) override; virtual void SetPopupSetFrame(nsPopupSetFrame* aPopupSet) override;
virtual Element* GetDefaultTooltip() override; virtual Element* GetDefaultTooltip() override;
virtual void SetDefaultTooltip(Element* aTooltip) override; virtual void SetDefaultTooltip(Element* aTooltip) override;
virtual nsresult AddTooltipSupport(nsIContent* aNode) override;
virtual nsresult RemoveTooltipSupport(nsIContent* aNode) override;
virtual void AppendFrames(ChildListID aListID, virtual void AppendFrames(ChildListID aListID,
nsFrameList& aFrameList) override; nsFrameList& aFrameList) override;
@ -243,28 +240,6 @@ nsRootBoxFrame::SetDefaultTooltip(Element* aTooltip)
mDefaultTooltip = 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_HEAD(nsRootBoxFrame)
NS_QUERYFRAME_ENTRY(nsIRootBox) NS_QUERYFRAME_ENTRY(nsIRootBox)
NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame) NS_QUERYFRAME_TAIL_INHERITING(nsBoxFrame)

View File

@ -35,7 +35,7 @@
using namespace mozilla; using namespace mozilla;
using namespace mozilla::dom; using namespace mozilla::dom;
nsXULTooltipListener* nsXULTooltipListener::mInstance = nullptr; nsXULTooltipListener* nsXULTooltipListener::sInstance = nullptr;
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
//// nsISupports //// nsISupports
@ -50,28 +50,26 @@ nsXULTooltipListener::nsXULTooltipListener()
, mLastTreeRow(-1) , mLastTreeRow(-1)
#endif #endif
{ {
if (sTooltipListenerCount++ == 0) { // FIXME(emilio): This can be faster, this should use BoolVarCache.
//
// register the callback so we get notified of updates // register the callback so we get notified of updates
Preferences::RegisterCallback(ToolbarTipsPrefChanged, Preferences::RegisterCallback(ToolbarTipsPrefChanged,
"browser.chrome.toolbar_tips"); "browser.chrome.toolbar_tips");
// Call the pref callback to initialize our state. // Call the pref callback to initialize our state.
ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nullptr); ToolbarTipsPrefChanged("browser.chrome.toolbar_tips", nullptr);
}
} }
nsXULTooltipListener::~nsXULTooltipListener() nsXULTooltipListener::~nsXULTooltipListener()
{ {
if (nsXULTooltipListener::mInstance == this) { MOZ_ASSERT(sInstance == this);
ClearTooltipCache(); sInstance = nullptr;
}
HideTooltip(); HideTooltip();
if (--sTooltipListenerCount == 0) {
// Unregister our pref observer // Unregister our pref observer
Preferences::UnregisterCallback(ToolbarTipsPrefChanged, Preferences::UnregisterCallback(ToolbarTipsPrefChanged,
"browser.chrome.toolbar_tips"); "browser.chrome.toolbar_tips");
}
} }
NS_IMPL_ISUPPORTS(nsXULTooltipListener, nsIDOMEventListener) NS_IMPL_ISUPPORTS(nsXULTooltipListener, nsIDOMEventListener)
@ -295,13 +293,12 @@ nsXULTooltipListener::ToolbarTipsPrefChanged(const char *aPref,
//// nsXULTooltipListener //// nsXULTooltipListener
bool nsXULTooltipListener::sShowTooltips = false; bool nsXULTooltipListener::sShowTooltips = false;
uint32_t nsXULTooltipListener::sTooltipListenerCount = 0;
nsresult void
nsXULTooltipListener::AddTooltipSupport(nsIContent* aNode) nsXULTooltipListener::AddTooltipSupport(nsIContent* aNode)
{ {
if (!aNode) MOZ_ASSERT(aNode);
return NS_ERROR_NULL_POINTER; MOZ_ASSERT(this == sInstance);
aNode->AddSystemEventListener(NS_LITERAL_STRING("mouseout"), this, aNode->AddSystemEventListener(NS_LITERAL_STRING("mouseout"), this,
false, false); false, false);
@ -313,23 +310,22 @@ nsXULTooltipListener::AddTooltipSupport(nsIContent* aNode)
false, false); false, false);
aNode->AddSystemEventListener(NS_LITERAL_STRING("dragstart"), this, aNode->AddSystemEventListener(NS_LITERAL_STRING("dragstart"), this,
true, false); true, false);
return NS_OK;
} }
nsresult void
nsXULTooltipListener::RemoveTooltipSupport(nsIContent* aNode) nsXULTooltipListener::RemoveTooltipSupport(nsIContent* aNode)
{ {
if (!aNode) MOZ_ASSERT(aNode);
return NS_ERROR_NULL_POINTER; 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("mouseout"), this, false);
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousemove"), this, false); aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousemove"), this, false);
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"), this, false); aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mousedown"), this, false);
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mouseup"), this, false); aNode->RemoveSystemEventListener(NS_LITERAL_STRING("mouseup"), this, false);
aNode->RemoveSystemEventListener(NS_LITERAL_STRING("dragstart"), this, true); aNode->RemoveSystemEventListener(NS_LITERAL_STRING("dragstart"), this, true);
return NS_OK;
} }
#ifdef MOZ_XUL #ifdef MOZ_XUL
@ -713,7 +709,7 @@ nsXULTooltipListener::KillTooltipTimer()
void void
nsXULTooltipListener::sTooltipCallback(nsITimer *aTimer, void *aListener) nsXULTooltipListener::sTooltipCallback(nsITimer *aTimer, void *aListener)
{ {
RefPtr<nsXULTooltipListener> instance = mInstance; RefPtr<nsXULTooltipListener> instance = sInstance;
if (instance) if (instance)
instance->ShowTooltip(); instance->ShowTooltip();
} }

View File

@ -31,14 +31,13 @@ public:
void MouseOut(nsIDOMEvent* aEvent); void MouseOut(nsIDOMEvent* aEvent);
void MouseMove(nsIDOMEvent* aEvent); void MouseMove(nsIDOMEvent* aEvent);
nsresult AddTooltipSupport(nsIContent* aNode); void AddTooltipSupport(nsIContent* aNode);
nsresult RemoveTooltipSupport(nsIContent* aNode); void RemoveTooltipSupport(nsIContent* aNode);
static nsXULTooltipListener* GetInstance() { static nsXULTooltipListener* GetInstance() {
if (!mInstance) if (!sInstance)
mInstance = new nsXULTooltipListener(); sInstance = new nsXULTooltipListener();
return mInstance; return sInstance;
} }
static void ClearTooltipCache() { mInstance = nullptr; }
protected: protected:
@ -47,7 +46,6 @@ protected:
// pref callback for when the "show tooltips" pref changes // pref callback for when the "show tooltips" pref changes
static bool sShowTooltips; static bool sShowTooltips;
static uint32_t sTooltipListenerCount;
void KillTooltipTimer(); void KillTooltipTimer();
@ -66,7 +64,7 @@ protected:
// can be really used (i.e. tooltip is not a menu). // can be really used (i.e. tooltip is not a menu).
nsresult GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip); nsresult GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip);
static nsXULTooltipListener* mInstance; static nsXULTooltipListener* sInstance;
static void ToolbarTipsPrefChanged(const char *aPref, void *aClosure); static void ToolbarTipsPrefChanged(const char *aPref, void *aClosure);
nsWeakPtr mSourceNode; nsWeakPtr mSourceNode;

View File

@ -51,6 +51,7 @@
#include "transportlayerice.h" #include "transportlayerice.h"
#include "webrtc/base/bind.h" #include "webrtc/base/bind.h"
#include "webrtc/base/keep_ref_until_done.h"
#include "webrtc/common_types.h" #include "webrtc/common_types.h"
#include "webrtc/common_video/include/i420_buffer_pool.h" #include "webrtc/common_video/include/i420_buffer_pool.h"
#include "webrtc/common_video/include/video_frame_buffer.h" #include "webrtc/common_video/include/video_frame_buffer.h"
@ -342,7 +343,6 @@ protected:
uint32_t width = aImage->GetSize().width; uint32_t width = aImage->GetSize().width;
uint32_t height = aImage->GetSize().height; uint32_t height = aImage->GetSize().height;
rtc::Callback0<void> callback_unused;
rtc::scoped_refptr<webrtc::WrappedI420Buffer> video_frame_buffer( rtc::scoped_refptr<webrtc::WrappedI420Buffer> video_frame_buffer(
new rtc::RefCountedObject<webrtc::WrappedI420Buffer>( new rtc::RefCountedObject<webrtc::WrappedI420Buffer>(
width, width,
@ -353,7 +353,7 @@ protected:
cbCrStride, cbCrStride,
cr, cr,
cbCrStride, cbCrStride,
callback_unused)); rtc::KeepRefUntilDone(aImage)));
webrtc::VideoFrame i420_frame(video_frame_buffer, webrtc::VideoFrame i420_frame(video_frame_buffer,
0, 0,

View File

@ -12,12 +12,10 @@
*/ */
var EXPORTED_SYMBOLS = ["EnsureFxAccountsWebChannel"]; var EXPORTED_SYMBOLS = ["EnsureFxAccountsWebChannel"];
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; /* global Components */ ChromeUtils.import("resource://gre/modules/Accounts.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/Accounts.jsm"); /* global Accounts */ ChromeUtils.import("resource://gre/modules/WebChannel.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm"); /* global Services */ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.import("resource://gre/modules/WebChannel.jsm"); /* global WebChannel */
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); /* global XPCOMUtils */
const log = ChromeUtils.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.bind("FxAccounts"); 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"; const PREF_LAST_FXA_USER = "identity.fxaccounts.lastSignedInUserHash";
XPCOMUtils.defineLazyGetter(this, "strings", 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, "Snackbars", "resource://gre/modules/Snackbars.jsm");
ChromeUtils.defineModuleGetter(this, "Prompt", "resource://gre/modules/Prompt.jsm"); ChromeUtils.defineModuleGetter(this, "Prompt", "resource://gre/modules/Prompt.jsm");

View File

@ -196,7 +196,7 @@ interface nsIIOService : nsISupports
* is provided purely as an optimization. * is provided purely as an optimization.
* *
* @param aSpec the URL string to parse * @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. * @throws NS_ERROR_MALFORMED_URI if URL string is not of the right form.
*/ */

View File

@ -296,7 +296,6 @@ nsSimpleURI::SetSpecInternal(const nsACString &aSpec)
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return rv; return rv;
} }
ToLowerCase(mScheme);
nsAutoCString spec; nsAutoCString spec;
rv = net_FilterAndEscapeURI(aSpec, esc_OnlyNonASCII, spec); rv = net_FilterAndEscapeURI(aSpec, esc_OnlyNonASCII, spec);

View File

@ -525,6 +525,7 @@ net_ExtractURLScheme(const nsACString &inURI,
p.Claim(scheme); p.Claim(scheme);
scheme.StripTaggedASCII(ASCIIMask::MaskCRLFTab()); scheme.StripTaggedASCII(ASCIIMask::MaskCRLFTab());
ToLowerCase(scheme);
return NS_OK; return NS_OK;
} }

View File

@ -91,7 +91,7 @@ bool net_IsAbsoluteURL(const nsACString& inURL);
* Extract URI-Scheme if possible * Extract URI-Scheme if possible
* *
* @param inURI URI spec * @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, nsresult net_ExtractURLScheme(const nsACString &inURI,
nsACString &scheme); nsACString &scheme);

View File

@ -276,7 +276,7 @@ nsHttpConnection::Start0RTTSpdy(uint8_t spdyVersion)
} }
void void
nsHttpConnection::StartSpdy(uint8_t spdyVersion) nsHttpConnection::StartSpdy(nsISSLSocketControl *sslControl, uint8_t spdyVersion)
{ {
LOG(("nsHttpConnection::StartSpdy [this=%p, mDid0RTTSpdy=%d]\n", this, mDid0RTTSpdy)); LOG(("nsHttpConnection::StartSpdy [this=%p, mDid0RTTSpdy=%d]\n", this, mDid0RTTSpdy));
@ -285,6 +285,9 @@ nsHttpConnection::StartSpdy(uint8_t spdyVersion)
mUsingSpdyVersion = spdyVersion; mUsingSpdyVersion = spdyVersion;
mEverUsedSpdy = true; mEverUsedSpdy = true;
if (sslControl) {
sslControl->SetDenyClientCert(true);
}
if (!mDid0RTTSpdy) { if (!mDid0RTTSpdy) {
mSpdySession = ASpdySession::NewSpdySession(spdyVersion, mSocketTransport, mSpdySession = ASpdySession::NewSpdySession(spdyVersion, mSocketTransport,
@ -548,7 +551,7 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
uint32_t infoIndex; uint32_t infoIndex;
const SpdyInformation *info = gHttpHandler->SpdyInfo(); const SpdyInformation *info = gHttpHandler->SpdyInfo();
if (NS_SUCCEEDED(info->GetNPNIndex(negotiatedNPN, &infoIndex))) { if (NS_SUCCEEDED(info->GetNPNIndex(negotiatedNPN, &infoIndex))) {
StartSpdy(info->Version[infoIndex]); StartSpdy(ssl, info->Version[infoIndex]);
} }
} else { } else {
LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - %" PRId64 " bytes " LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - %" PRId64 " bytes "
@ -559,7 +562,7 @@ nsHttpConnection::EnsureNPNComplete(nsresult &aOut0RTTWriteHandshakeValue,
// spdy, since we know we're sticking with it. // spdy, since we know we're sticking with it.
LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - finishing " LOG(("nsHttpConnection::EnsureNPNComplete [this=%p] - finishing "
"StartSpdy for 0rtt spdy session %p", this, mSpdySession.get())); "StartSpdy for 0rtt spdy session %p", this, mSpdySession.get()));
StartSpdy(mSpdySession->SpdyVersion()); StartSpdy(ssl, mSpdySession->SpdyVersion());
} }
} }

View File

@ -272,7 +272,7 @@ private:
void SetupSSL(); void SetupSSL();
// Start the Spdy transaction handler when NPN indicates spdy/* // 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 // Like the above, but do the bare minimum to do 0RTT data, so we can back
// it out, if necessary // it out, if necessary
void Start0RTTSpdy(uint8_t versionLevel); void Start0RTTSpdy(uint8_t versionLevel);

View File

@ -57,7 +57,7 @@ nsViewSourceChannel::Init(nsIURI* uri)
return rv; return rv;
// prevent viewing source of javascript URIs (see bug 204779) // prevent viewing source of javascript URIs (see bug 204779)
if (scheme.LowerCaseEqualsLiteral("javascript")) { if (scheme.EqualsLiteral("javascript")) {
NS_WARNING("blocking view-source:javascript:"); NS_WARNING("blocking view-source:javascript:");
return NS_ERROR_INVALID_ARG; return NS_ERROR_INVALID_ARG;
} }

View File

@ -130,6 +130,12 @@ interface nsISSLSocketControl : nsISupports {
[infallible] readonly attribute short MACAlgorithmUsed; [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 * 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 * all), then this cert will be presented to the server, instead of asking

View 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");
});

View File

@ -418,3 +418,4 @@ run-sequentially = node server exceptions dont replay well
[test_trr.js] [test_trr.js]
# http2-using tests require node available # http2-using tests require node available
skip-if = os == "android" skip-if = os == "android"
[test_ioservice.js]

View File

@ -120,6 +120,7 @@ nsNSSSocketInfo::nsNSSSocketInfo(SharedSSLState& aState, uint32_t providerFlags,
mPreliminaryHandshakeDone(false), mPreliminaryHandshakeDone(false),
mNPNCompleted(false), mNPNCompleted(false),
mEarlyDataAccepted(false), mEarlyDataAccepted(false),
mDenyClientCert(false),
mFalseStartCallbackCalled(false), mFalseStartCallbackCalled(false),
mFalseStarted(false), mFalseStarted(false),
mIsFullHandshake(false), mIsFullHandshake(false),
@ -395,6 +396,20 @@ nsNSSSocketInfo::SetEarlyDataAccepted(bool aAccepted)
mEarlyDataAccepted = 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 NS_IMETHODIMP
nsNSSSocketInfo::DriveHandshake() nsNSSSocketInfo::DriveHandshake()
{ {
@ -2146,6 +2161,14 @@ nsNSS_SSLGetClientAuthData(void* arg, PRFileDesc* socket,
return SECFailure; 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()) { if (info->GetJoined()) {
// We refuse to send a client certificate when there are multiple hostnames // We refuse to send a client certificate when there are multiple hostnames
// joined on this connection, because we only show the user one hostname // joined on this connection, because we only show the user one hostname

View File

@ -73,6 +73,7 @@ public:
bool IsFullHandshake() const { return mIsFullHandshake; } bool IsFullHandshake() const { return mIsFullHandshake; }
bool GetJoined() { return mJoined; } bool GetJoined() { return mJoined; }
bool GetDenyClientCert() { return mDenyClientCert; }
void SetSentClientCert() { mSentClientCert = true; } void SetSentClientCert() { mSentClientCert = true; }
uint32_t GetProviderFlags() const { return mProviderFlags; } uint32_t GetProviderFlags() const { return mProviderFlags; }
@ -185,6 +186,7 @@ private:
nsCString mNegotiatedNPN; nsCString mNegotiatedNPN;
bool mNPNCompleted; bool mNPNCompleted;
bool mEarlyDataAccepted; bool mEarlyDataAccepted;
bool mDenyClientCert;
bool mFalseStartCallbackCalled; bool mFalseStartCallbackCalled;
bool mFalseStarted; bool mFalseStarted;
bool mIsFullHandshake; bool mIsFullHandshake;

View File

@ -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() { add_task(async function test_async_onItemMoved_update() {
_("Items moved via the asynchronous API should be tracked"); _("Items moved via the asynchronous API should be tracked");
@ -1263,38 +1221,42 @@ add_task(async function test_treeMoved() {
try { try {
// Create a couple of parent folders. // Create a couple of parent folders.
let folder1_id = PlacesUtils.bookmarks.createFolder( let folder1 = await PlacesUtils.bookmarks.insert({
PlacesUtils.bookmarks.bookmarksMenuFolder, parentGuid: PlacesUtils.bookmarks.menuGuid,
"First test folder", test: "First test folder",
PlacesUtils.bookmarks.DEFAULT_INDEX); type: PlacesUtils.bookmarks.TYPE_FOLDER
let folder1_guid = await PlacesUtils.promiseItemGuid(folder1_id); });
// A second folder in the first. // A second folder in the first.
let folder2_id = PlacesUtils.bookmarks.createFolder( let folder2 = await PlacesUtils.bookmarks.insert({
folder1_id, parentGuid: folder1.guid,
"Second test folder", title: "Second test folder",
PlacesUtils.bookmarks.DEFAULT_INDEX); type: PlacesUtils.bookmarks.TYPE_FOLDER
let folder2_guid = await PlacesUtils.promiseItemGuid(folder2_id); });
// Create a couple of bookmarks in the second folder. // Create a couple of bookmarks in the second folder.
PlacesUtils.bookmarks.insertBookmark( await PlacesUtils.bookmarks.insert({
folder2_id, parentGuid: folder2.guid,
CommonUtils.makeURI("http://getfirefox.com"), url: "http://getfirefox.com",
PlacesUtils.bookmarks.DEFAULT_INDEX, title: "Get Firefox!"
"Get Firefox!"); });
PlacesUtils.bookmarks.insertBookmark( await PlacesUtils.bookmarks.insert({
folder2_id, parentGuid: folder2.guid,
CommonUtils.makeURI("http://getthunderbird.com"), url: "http://getthunderbird.com",
PlacesUtils.bookmarks.DEFAULT_INDEX, title: "Get Thunderbird!"
"Get Thunderbird!"); });
await startTracking(); await startTracking();
// Move folder 2 to be a sibling of folder1. // Move folder 2 to be a sibling of folder1.
PlacesUtils.bookmarks.moveItem( await PlacesUtils.bookmarks.update({
folder2_id, PlacesUtils.bookmarks.bookmarksMenuFolder, 0); guid: folder2.guid,
parentGuid: PlacesUtils.bookmarks.menuGuid,
index: 0
});
// the menu and both folders should be tracked, the children should not be. // 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); Assert.equal(tracker.score, SCORE_INCREMENT_XLARGE);
} finally { } finally {
_("Clean up."); _("Clean up.");

View File

@ -8,7 +8,7 @@
*/ */
var EXPORTED_SYMBOLS = [ var EXPORTED_SYMBOLS = [
"ACTIONS", "Addons", "Addresses", "Bookmarks", "ACTIONS", "Addons", "Addresses", "Bookmarks", "CreditCards",
"Formdata", "History", "Passwords", "Prefs", "Formdata", "History", "Passwords", "Prefs",
"Tabs", "TPS", "Windows" "Tabs", "TPS", "Windows"
]; ];

View File

@ -309,22 +309,6 @@ impl PropertyAnimation {
} }
result 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