diff --git a/devtools/client/aboutdebugging/aboutdebugging.css b/devtools/client/aboutdebugging/aboutdebugging.css
index f6840594775e..4c81627e94cd 100644
--- a/devtools/client/aboutdebugging/aboutdebugging.css
+++ b/devtools/client/aboutdebugging/aboutdebugging.css
@@ -249,6 +249,25 @@ button {
font-weight: 600;
}
+.addon-target-info {
+ display: grid;
+ font-size: 14px;
+ grid-template-columns: 128px 1fr;
+}
+
+.addon-target-info-label {
+ padding-inline-end: 8px;
+ padding-bottom: 8px;
+}
+
+.addon-target-info-label:last-of-type {
+ padding-bottom: 16px;
+}
+
+.addon-target-info-content {
+ margin: 0;
+}
+
.addon-target-button {
background: none;
border: none;
@@ -289,3 +308,18 @@ button {
* lines up with the icon. */
margin-inline-start: -4px;
}
+
+/* We want the ellipsis on the left-hand-side, so make the parent RTL
+ * with an ellipsis and the child can be LTR. */
+.file-path {
+ direction: rtl;
+ max-width: 100%;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.file-path-inner {
+ direction: ltr;
+ unicode-bidi: plaintext;
+}
diff --git a/devtools/client/aboutdebugging/components/addons/panel.js b/devtools/client/aboutdebugging/components/addons/panel.js
index 451335151c89..e7ffc097248e 100644
--- a/devtools/client/aboutdebugging/components/addons/panel.js
+++ b/devtools/client/aboutdebugging/components/addons/panel.js
@@ -76,7 +76,8 @@ module.exports = createClass({
icon: addon.iconURL || ExtensionIcon,
addonID: addon.id,
addonActor: addon.actor,
- temporarilyInstalled: addon.temporarilyInstalled
+ temporarilyInstalled: addon.temporarilyInstalled,
+ url: addon.url,
};
});
diff --git a/devtools/client/aboutdebugging/components/addons/target.js b/devtools/client/aboutdebugging/components/addons/target.js
index bd7a888f7b4b..caa44f1961fc 100644
--- a/devtools/client/aboutdebugging/components/addons/target.js
+++ b/devtools/client/aboutdebugging/components/addons/target.js
@@ -20,6 +20,25 @@ loader.lazyRequireGetter(this, "DebuggerClient",
const Strings = Services.strings.createBundle(
"chrome://devtools/locale/aboutdebugging.properties");
+function filePathForTarget(target) {
+ // Only show file system paths, and only for temporarily installed add-ons.
+ if (!target.temporarilyInstalled || !target.url || !target.url.startsWith("file://")) {
+ return [];
+ }
+ let path = target.url.slice("file://".length);
+ return [
+ dom.dt(
+ { className: "addon-target-info-label" },
+ Strings.GetStringFromName("location")),
+ // Wrap the file path in a span so we can do some RTL/LTR swapping to get
+ // the ellipsis on the left.
+ dom.dd(
+ { className: "addon-target-info-content file-path" },
+ dom.span({ className: "file-path-inner", title: path }, path),
+ ),
+ ];
+}
+
module.exports = createClass({
displayName: "AddonTarget",
@@ -31,7 +50,8 @@ module.exports = createClass({
addonID: PropTypes.string.isRequired,
icon: PropTypes.string,
name: PropTypes.string.isRequired,
- temporarilyInstalled: PropTypes.bool
+ temporarilyInstalled: PropTypes.bool,
+ url: PropTypes.string,
}).isRequired
},
@@ -68,6 +88,10 @@ module.exports = createClass({
}),
dom.span({ className: "target-name", title: target.name }, target.name)
),
+ dom.dl(
+ { className: "addon-target-info" },
+ ...filePathForTarget(target),
+ ),
dom.div({className: "addon-target-actions"},
dom.button({
className: "debug-button addon-target-button",
diff --git a/devtools/client/aboutdebugging/test/browser.ini b/devtools/client/aboutdebugging/test/browser.ini
index 5e9a949c2116..a10c34986d74 100644
--- a/devtools/client/aboutdebugging/test/browser.ini
+++ b/devtools/client/aboutdebugging/test/browser.ini
@@ -20,6 +20,7 @@ support-files =
!/devtools/client/framework/test/shared-head.js
[browser_addons_debug_bootstrapped.js]
+[browser_addons_debug_info.js]
[browser_addons_debug_webextension.js]
tags = webextensions
[browser_addons_debug_webextension_inspector.js]
diff --git a/devtools/client/aboutdebugging/test/browser_addons_debug_info.js b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
new file mode 100644
index 000000000000..77d7e7b1ed3e
--- /dev/null
+++ b/devtools/client/aboutdebugging/test/browser_addons_debug_info.js
@@ -0,0 +1,28 @@
+"use strict";
+
+const ADDON_ID = "test-devtools@mozilla.org";
+const ADDON_NAME = "test-devtools";
+
+add_task(function* () {
+ let { tab, document } = yield openAboutDebugging("addons");
+ yield waitForInitialAddonList(document);
+
+ yield installAddon({
+ document,
+ path: "addons/unpacked/install.rdf",
+ name: ADDON_NAME,
+ });
+
+ let container = document.querySelector(`[data-addon-id="${ADDON_ID}"]`);
+ let filePath = container.querySelector(".file-path");
+ let expectedFilePath = "browser/devtools/client/aboutdebugging/test/addons/unpacked/";
+
+ // Verify that the path to the install location is shown next to its label.
+ ok(filePath, "file path is in DOM");
+ ok(filePath.textContent.endsWith(expectedFilePath), "file path is set correctly");
+ is(filePath.previousElementSibling.textContent, "Location", "file path has label");
+
+ yield uninstallAddon({document, id: ADDON_ID, name: ADDON_NAME});
+
+ yield closeAboutDebugging(tab);
+});
diff --git a/devtools/client/commandline/test/browser_cmd_qsa.js b/devtools/client/commandline/test/browser_cmd_qsa.js
index 551d47739a4e..32bcd11f4bca 100644
--- a/devtools/client/commandline/test/browser_cmd_qsa.js
+++ b/devtools/client/commandline/test/browser_cmd_qsa.js
@@ -1,33 +1,33 @@
-/* Any copyright is dedicated to the Public Domain.
-* http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Tests that the qsa commands work as they should.
-
-const TEST_URI = "data:text/html;charset=utf-8,
";
-
-function test() {
- helpers.addTabWithToolbar(TEST_URI, function (options) {
- return helpers.audit(options, [
- {
- setup: "qsa",
- check: {
- input: "qsa",
- hints: " [query]",
- markup: "VVV",
- status: "VALID"
- }
- },
- {
- setup: "qsa body",
- check: {
- input: "qsa body",
- hints: "",
- markup: "VVVVVVVV",
- status: "VALID"
- }
- }
- ]);
- }).then(finish, helpers.handleError);
-}
+/* Any copyright is dedicated to the Public Domain.
+* http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+// Tests that the qsa commands work as they should.
+
+const TEST_URI = "data:text/html;charset=utf-8,";
+
+function test() {
+ helpers.addTabWithToolbar(TEST_URI, function (options) {
+ return helpers.audit(options, [
+ {
+ setup: "qsa",
+ check: {
+ input: "qsa",
+ hints: " [query]",
+ markup: "VVV",
+ status: "VALID"
+ }
+ },
+ {
+ setup: "qsa body",
+ check: {
+ input: "qsa body",
+ hints: "",
+ markup: "VVVVVVVV",
+ status: "VALID"
+ }
+ }
+ ]);
+ }).then(finish, helpers.handleError);
+}
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-edit-cancel.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-edit-cancel.js
index dd49547179e5..8a31105d7d39 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-edit-cancel.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-edit-cancel.js
@@ -2,57 +2,57 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Make sure that canceling a name change correctly unhides the separator and
- * value elements.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
-
-function test() {
- Task.spawn(function* () {
+
+/**
+ * Make sure that canceling a name change correctly unhides the separator and
+ * value elements.
+ */
+
+const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
+
+function test() {
+ Task.spawn(function* () {
let options = {
source: TAB_URL,
line: 1
};
- let [tab,, panel] = yield initDebugger(TAB_URL, options);
- let win = panel.panelWin;
- let vars = win.DebuggerView.Variables;
-
- win.DebuggerView.WatchExpressions.addExpression("this");
-
- callInTab(tab, "ermahgerd");
- yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
-
- let exprScope = vars.getScopeAtIndex(0);
- let {target} = exprScope.get("this");
-
- let name = target.querySelector(".title > .name");
- let separator = target.querySelector(".separator");
- let value = target.querySelector(".value");
-
- is(separator.hidden, false,
- "The separator element should not be hidden.");
- is(value.hidden, false,
- "The value element should not be hidden.");
-
- for (let key of ["ESCAPE", "RETURN"]) {
- EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
-
- is(separator.hidden, true,
- "The separator element should be hidden.");
- is(value.hidden, true,
- "The value element should be hidden.");
-
- EventUtils.sendKey(key, win);
-
- is(separator.hidden, false,
- "The separator element should not be hidden.");
- is(value.hidden, false,
- "The value element should not be hidden.");
- }
-
- yield resumeDebuggerThenCloseAndFinish(panel);
- });
-}
+ let [tab,, panel] = yield initDebugger(TAB_URL, options);
+ let win = panel.panelWin;
+ let vars = win.DebuggerView.Variables;
+
+ win.DebuggerView.WatchExpressions.addExpression("this");
+
+ callInTab(tab, "ermahgerd");
+ yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
+
+ let exprScope = vars.getScopeAtIndex(0);
+ let {target} = exprScope.get("this");
+
+ let name = target.querySelector(".title > .name");
+ let separator = target.querySelector(".separator");
+ let value = target.querySelector(".value");
+
+ is(separator.hidden, false,
+ "The separator element should not be hidden.");
+ is(value.hidden, false,
+ "The value element should not be hidden.");
+
+ for (let key of ["ESCAPE", "RETURN"]) {
+ EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
+
+ is(separator.hidden, true,
+ "The separator element should be hidden.");
+ is(value.hidden, true,
+ "The value element should be hidden.");
+
+ EventUtils.sendKey(key, win);
+
+ is(separator.hidden, false,
+ "The separator element should not be hidden.");
+ is(value.hidden, false,
+ "The value element should not be hidden.");
+ }
+
+ yield resumeDebuggerThenCloseAndFinish(panel);
+ });
+}
diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-17.js b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-17.js
index bdfe1a42b5b4..f11517b665d3 100644
--- a/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-17.js
+++ b/devtools/client/debugger/test/mochitest/browser_dbg_variables-view-popup-17.js
@@ -1,80 +1,80 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests opening the variable inspection popup while stopped at a debugger statement,
- * clicking "step in" and verifying that the popup is gone.
- */
-
-const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
-
-let gTab, gPanel, gDebugger;
-let actions, gSources, gVariables;
-
-function test() {
- let options = {
- source: TAB_URL,
- line: 1
- };
- initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
- gTab = aTab;
- gPanel = aPanel;
- gDebugger = gPanel.panelWin;
- actions = bindActionCreators(gPanel);
- gSources = gDebugger.DebuggerView.Sources;
- gVariables = gDebugger.DebuggerView.Variables;
- let bubble = gDebugger.DebuggerView.VariableBubble;
- let tooltip = bubble._tooltip.panel;
- let testPopupHiding = Task.async(function* () {
- yield addBreakpoint();
- yield ensureThreadClientState(gPanel, "resumed");
- yield pauseDebuggee();
- yield openVarPopup(gPanel, { line: 20, ch: 17 });
- is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 1,
- "The popup should be open with a simple text entry");
- // Now we're stopped at a breakpoint with an open popup
- // we'll send a keypress and check if the popup closes
- executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
- // The keypress should cause one resumed event and one paused event
- yield waitForThreadEvents(gPanel, "resumed");
- yield waitForThreadEvents(gPanel, "paused");
- // Here's the state we're actually interested in checking..
- checkVariablePopupClosed(bubble);
- yield resumeDebuggerThenCloseAndFinish(gPanel);
- });
- testPopupHiding();
- });
-}
-
-function addBreakpoint() {
- return actions.addBreakpoint({ actor: gSources.selectedValue, line: 21 });
-}
-
-function pauseDebuggee() {
- generateMouseClickInTab(gTab, "content.document.querySelector('button')");
-
- // The first 'with' scope should be expanded by default, but the
- // variables haven't been fetched yet. This is how 'with' scopes work.
- return promise.all([
- waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
- waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
- ]);
-}
-
-function checkVariablePopupClosed(bubble) {
- ok(!bubble.contentsShown(),
- "When stepping, popup should close and be hidden.");
- ok(bubble._tooltip.isEmpty(),
- "The variable inspection popup should now be empty.");
- ok(!bubble._markedText,
- "The marked text in the editor was removed.");
-}
-
-registerCleanupFunction(function () {
- gTab = null;
- gPanel = null;
- gDebugger = null;
- actions = null;
- gSources = null;
- gVariables = null;
-});
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Tests opening the variable inspection popup while stopped at a debugger statement,
+ * clicking "step in" and verifying that the popup is gone.
+ */
+
+const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
+
+let gTab, gPanel, gDebugger;
+let actions, gSources, gVariables;
+
+function test() {
+ let options = {
+ source: TAB_URL,
+ line: 1
+ };
+ initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
+ gTab = aTab;
+ gPanel = aPanel;
+ gDebugger = gPanel.panelWin;
+ actions = bindActionCreators(gPanel);
+ gSources = gDebugger.DebuggerView.Sources;
+ gVariables = gDebugger.DebuggerView.Variables;
+ let bubble = gDebugger.DebuggerView.VariableBubble;
+ let tooltip = bubble._tooltip.panel;
+ let testPopupHiding = Task.async(function* () {
+ yield addBreakpoint();
+ yield ensureThreadClientState(gPanel, "resumed");
+ yield pauseDebuggee();
+ yield openVarPopup(gPanel, { line: 20, ch: 17 });
+ is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 1,
+ "The popup should be open with a simple text entry");
+ // Now we're stopped at a breakpoint with an open popup
+ // we'll send a keypress and check if the popup closes
+ executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
+ // The keypress should cause one resumed event and one paused event
+ yield waitForThreadEvents(gPanel, "resumed");
+ yield waitForThreadEvents(gPanel, "paused");
+ // Here's the state we're actually interested in checking..
+ checkVariablePopupClosed(bubble);
+ yield resumeDebuggerThenCloseAndFinish(gPanel);
+ });
+ testPopupHiding();
+ });
+}
+
+function addBreakpoint() {
+ return actions.addBreakpoint({ actor: gSources.selectedValue, line: 21 });
+}
+
+function pauseDebuggee() {
+ generateMouseClickInTab(gTab, "content.document.querySelector('button')");
+
+ // The first 'with' scope should be expanded by default, but the
+ // variables haven't been fetched yet. This is how 'with' scopes work.
+ return promise.all([
+ waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
+ waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
+ ]);
+}
+
+function checkVariablePopupClosed(bubble) {
+ ok(!bubble.contentsShown(),
+ "When stepping, popup should close and be hidden.");
+ ok(bubble._tooltip.isEmpty(),
+ "The variable inspection popup should now be empty.");
+ ok(!bubble._markedText,
+ "The marked text in the editor was removed.");
+}
+
+registerCleanupFunction(function () {
+ gTab = null;
+ gPanel = null;
+ gDebugger = null;
+ actions = null;
+ gSources = null;
+ gVariables = null;
+});
diff --git a/devtools/client/locales/en-US/aboutdebugging.properties b/devtools/client/locales/en-US/aboutdebugging.properties
index f5449b3ec8b6..e84d32484f64 100644
--- a/devtools/client/locales/en-US/aboutdebugging.properties
+++ b/devtools/client/locales/en-US/aboutdebugging.properties
@@ -79,6 +79,10 @@ reload = Reload
# disabled 'reload' button.
reloadDisabledTooltip = Only temporarily installed add-ons can be reloaded
+# LOCALIZATION NOTE (location):
+# This string is displayed as a label for the filesystem location of an extension.
+location = Location
+
# LOCALIZATION NOTE (workers):
# This string is displayed as a header of the about:debugging#workers page.
workers = Workers
diff --git a/devtools/client/netmonitor/src/components/request-list-column-file.js b/devtools/client/netmonitor/src/components/request-list-column-file.js
index 5040ab918cc5..21034bbdc575 100644
--- a/devtools/client/netmonitor/src/components/request-list-column-file.js
+++ b/devtools/client/netmonitor/src/components/request-list-column-file.js
@@ -40,7 +40,6 @@ const RequestListColumnFile = createClass({
img({
className: "requests-list-icon",
src: responseContentDataUri,
- "data-type": responseContentDataUri ? "thumbnail" : undefined,
}),
urlDetails.baseNameWithQuery
)
diff --git a/devtools/client/netmonitor/src/constants.js b/devtools/client/netmonitor/src/constants.js
index a61f2dc73298..d9d706cb4047 100644
--- a/devtools/client/netmonitor/src/constants.js
+++ b/devtools/client/netmonitor/src/constants.js
@@ -93,18 +93,6 @@ const EVENTS = {
UPDATING_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdating:ResponseContent",
RECEIVED_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdated:ResponseContent",
- // When the request post params are displayed in the UI.
- REQUEST_POST_PARAMS_DISPLAYED: "NetMonitor:RequestPostParamsAvailable",
-
- // When the image response thumbnail is displayed in the UI.
- RESPONSE_IMAGE_THUMBNAIL_DISPLAYED:
- "NetMonitor:ResponseImageThumbnailAvailable",
-
- // Fired when charts have been displayed in the PerformanceStatisticsView.
- PLACEHOLDER_CHARTS_DISPLAYED: "NetMonitor:PlaceholderChartsDisplayed",
- PRIMED_CACHE_CHART_DISPLAYED: "NetMonitor:PrimedChartsDisplayed",
- EMPTY_CACHE_CHART_DISPLAYED: "NetMonitor:EmptyChartsDisplayed",
-
// Fired once the NetMonitorController establishes a connection to the debug
// target.
CONNECTED: "connected",
diff --git a/devtools/client/netmonitor/src/netmonitor-controller.js b/devtools/client/netmonitor/src/netmonitor-controller.js
index 1cb3f522d03b..727981be55a1 100644
--- a/devtools/client/netmonitor/src/netmonitor-controller.js
+++ b/devtools/client/netmonitor/src/netmonitor-controller.js
@@ -7,10 +7,7 @@
const { TimelineFront } = require("devtools/shared/fronts/timeline");
const { CurlUtils } = require("devtools/client/shared/curl");
const { ACTIVITY_TYPE, EVENTS } = require("./constants");
-const {
- getRequestById,
- getDisplayedRequestById,
-} = require("./selectors/index");
+const { getDisplayedRequestById } = require("./selectors/index");
const {
fetchHeaders,
formDataURI,
@@ -307,7 +304,6 @@ function NetworkEventsHandler() {
this._onRequestPostData = this._onRequestPostData.bind(this);
this._onResponseHeaders = this._onResponseHeaders.bind(this);
this._onResponseCookies = this._onResponseCookies.bind(this);
- this._onResponseContent = this._onResponseContent.bind(this);
this._onSecurityInfo = this._onSecurityInfo.bind(this);
this._onEventTimings = this._onEventTimings.bind(this);
}
@@ -428,45 +424,11 @@ NetworkEventsHandler.prototype = {
.then(() => window.emit(EVENTS.REQUEST_ADDED, id));
},
- async updateRequest(id, data) {
- await this.actions.updateRequest(id, data, true);
- let {
- responseContent,
- responseCookies,
- responseHeaders,
- requestCookies,
- requestHeaders,
- requestPostData,
- } = data;
- let request = getRequestById(window.gStore.getState(), id);
-
- if (requestHeaders && requestHeaders.headers && requestHeaders.headers.length) {
- let headers = await fetchHeaders(requestHeaders, getLongString);
- if (headers) {
- await this.actions.updateRequest(
- id,
- { requestHeaders: headers },
- true,
- );
- }
- }
-
- if (responseHeaders && responseHeaders.headers && responseHeaders.headers.length) {
- let headers = await fetchHeaders(responseHeaders, getLongString);
- if (headers) {
- await this.actions.updateRequest(
- id,
- { responseHeaders: headers },
- true,
- );
- }
- }
-
- if (request && responseContent && responseContent.content) {
- let { mimeType } = request;
- let { text, encoding } = responseContent.content;
+ async fetchImage(mimeType, responseContent) {
+ let payload = {};
+ if (mimeType && responseContent && responseContent.content) {
+ let { encoding, text } = responseContent.content;
let response = await getLongString(text);
- let payload = {};
if (mimeType.includes("image/")) {
payload.responseContentDataUri = formDataURI(mimeType, encoding, response);
@@ -474,16 +436,36 @@ NetworkEventsHandler.prototype = {
responseContent.content.text = response;
payload.responseContent = responseContent;
+ }
+ return payload;
+ },
- await this.actions.updateRequest(id, payload, true);
-
- if (mimeType.includes("image/")) {
- window.emit(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
+ async fetchRequestHeaders(requestHeaders) {
+ let payload = {};
+ if (requestHeaders && requestHeaders.headers && requestHeaders.headers.length) {
+ let headers = await fetchHeaders(requestHeaders, getLongString);
+ if (headers) {
+ payload.requestHeaders = headers;
}
}
+ return payload;
+ },
- // Search the POST data upload stream for request headers and add
- // them as a separate property, different from the classic headers.
+ async fetchResponseHeaders(responseHeaders) {
+ let payload = {};
+ if (responseHeaders && responseHeaders.headers && responseHeaders.headers.length) {
+ let headers = await fetchHeaders(responseHeaders, getLongString);
+ if (headers) {
+ payload.responseHeaders = headers;
+ }
+ }
+ return payload;
+ },
+
+ // Search the POST data upload stream for request headers and add
+ // them as a separate property, different from the classic headers.
+ async fetchPostData(requestPostData) {
+ let payload = {};
if (requestPostData && requestPostData.postData) {
let { text } = requestPostData.postData;
let postData = await getLongString(text);
@@ -491,35 +473,15 @@ NetworkEventsHandler.prototype = {
const headersSize = headers.reduce((acc, { name, value }) => {
return acc + name.length + value.length + 2;
}, 0);
- let payload = {};
requestPostData.postData.text = postData;
payload.requestPostData = Object.assign({}, requestPostData);
payload.requestHeadersFromUploadStream = { headers, headersSize };
-
- await this.actions.updateRequest(id, payload, true);
- }
-
- // Fetch request and response cookies long value.
- // Actor does not provide full sized cookie value when the value is too long
- // To display values correctly, we need fetch them in each request.
- if (requestCookies) {
- let reqCookies = [];
- // request store cookies in requestCookies or requestCookies.cookies
- let cookies = requestCookies.cookies ?
- requestCookies.cookies : requestCookies;
- // make sure cookies is iterable
- if (typeof cookies[Symbol.iterator] === "function") {
- for (let cookie of cookies) {
- reqCookies.push(Object.assign({}, cookie, {
- value: await getLongString(cookie.value),
- }));
- }
- if (reqCookies.length) {
- await this.actions.updateRequest(id, { requestCookies: reqCookies }, true);
- }
- }
}
+ return payload;
+ },
+ async fetchResponseCookies(responseCookies) {
+ let payload = {};
if (responseCookies) {
let resCookies = [];
// response store cookies in responseCookies or responseCookies.cookies
@@ -533,10 +495,70 @@ NetworkEventsHandler.prototype = {
}));
}
if (resCookies.length) {
- await this.actions.updateRequest(id, { responseCookies: resCookies }, true);
+ payload.responseCookies = resCookies;
}
}
}
+ return payload;
+ },
+
+ // Fetch request and response cookies long value.
+ // Actor does not provide full sized cookie value when the value is too long
+ // To display values correctly, we need fetch them in each request.
+ async fetchRequestCookies(requestCookies) {
+ let payload = {};
+ if (requestCookies) {
+ let reqCookies = [];
+ // request store cookies in requestCookies or requestCookies.cookies
+ let cookies = requestCookies.cookies ?
+ requestCookies.cookies : requestCookies;
+ // make sure cookies is iterable
+ if (typeof cookies[Symbol.iterator] === "function") {
+ for (let cookie of cookies) {
+ reqCookies.push(Object.assign({}, cookie, {
+ value: await getLongString(cookie.value),
+ }));
+ }
+ if (reqCookies.length) {
+ payload.requestCookies = reqCookies;
+ }
+ }
+ }
+ return payload;
+ },
+
+ async updateRequest(id, data) {
+ let {
+ mimeType,
+ responseContent,
+ responseCookies,
+ responseHeaders,
+ requestCookies,
+ requestHeaders,
+ requestPostData,
+ } = data;
+
+ // fetch request detail contents in parallel
+ let [
+ imageObj,
+ requestHeadersObj,
+ responseHeadersObj,
+ postDataObj,
+ requestCookiesObj,
+ responseCookiesObj,
+ ] = await Promise.all([
+ this.fetchImage(mimeType, responseContent),
+ this.fetchRequestHeaders(requestHeaders),
+ this.fetchResponseHeaders(responseHeaders),
+ this.fetchPostData(requestPostData),
+ this.fetchRequestCookies(requestCookies),
+ this.fetchResponseCookies(responseCookies),
+ ]);
+
+ let payload = Object.assign({}, data,
+ imageObj, requestHeadersObj, responseHeadersObj,
+ postDataObj, requestCookiesObj, responseCookiesObj);
+ await this.actions.updateRequest(id, payload, true);
},
/**
@@ -568,9 +590,10 @@ NetworkEventsHandler.prototype = {
case "securityInfo":
this.updateRequest(actor, {
securityState: networkInfo.securityInfo,
+ }).then(() => {
+ this.webConsoleClient.getSecurityInfo(actor, this._onSecurityInfo);
+ window.emit(EVENTS.UPDATING_SECURITY_INFO, actor);
});
- this.webConsoleClient.getSecurityInfo(actor, this._onSecurityInfo);
- window.emit(EVENTS.UPDATING_SECURITY_INFO, actor);
break;
case "responseHeaders":
this.webConsoleClient.getResponseHeaders(actor,
@@ -590,25 +613,26 @@ NetworkEventsHandler.prototype = {
status: networkInfo.response.status,
statusText: networkInfo.response.statusText,
headersSize: networkInfo.response.headersSize
+ }).then(() => {
+ window.emit(EVENTS.STARTED_RECEIVING_RESPONSE, actor);
});
- window.emit(EVENTS.STARTED_RECEIVING_RESPONSE, actor);
break;
case "responseContent":
- this.updateRequest(actor, {
- contentSize: networkInfo.response.bodySize,
- transferredSize: networkInfo.response.transferredSize,
- mimeType: networkInfo.response.content.mimeType
- });
this.webConsoleClient.getResponseContent(actor,
- this._onResponseContent);
+ this._onResponseContent.bind(this, {
+ contentSize: networkInfo.response.bodySize,
+ transferredSize: networkInfo.response.transferredSize,
+ mimeType: networkInfo.response.content.mimeType
+ }));
window.emit(EVENTS.UPDATING_RESPONSE_CONTENT, actor);
break;
case "eventTimings":
this.updateRequest(actor, {
totalTime: networkInfo.totalTime
+ }).then(() => {
+ this.webConsoleClient.getEventTimings(actor, this._onEventTimings);
+ window.emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
});
- this.webConsoleClient.getEventTimings(actor, this._onEventTimings);
- window.emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
break;
}
},
@@ -700,13 +724,14 @@ NetworkEventsHandler.prototype = {
/**
* Handles additional information received for a "responseContent" packet.
*
+ * @param object data
+ * The message received from the server event.
* @param object response
* The message received from the server.
*/
- _onResponseContent: function (response) {
- this.updateRequest(response.from, {
- responseContent: response
- }).then(() => {
+ _onResponseContent: function (data, response) {
+ let payload = Object.assign({ responseContent: response }, data);
+ this.updateRequest(response.from, payload).then(() => {
window.emit(EVENTS.RECEIVED_RESPONSE_CONTENT, response.from);
});
},
diff --git a/devtools/client/netmonitor/test/browser_net_icon-preview.js b/devtools/client/netmonitor/test/browser_net_icon-preview.js
index a1d14d7e155a..3de8d6a7c139 100644
--- a/devtools/client/netmonitor/test/browser_net_icon-preview.js
+++ b/devtools/client/netmonitor/test/browser_net_icon-preview.js
@@ -9,22 +9,21 @@
add_task(function* () {
let { tab, monitor } = yield initNetMonitor(CONTENT_TYPE_WITHOUT_CACHE_URL);
+ const SELECTOR = ".requests-list-icon[src]";
info("Starting test... ");
let { document, gStore, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
let { NetMonitorController } =
windowRequire("devtools/client/netmonitor/src/netmonitor-controller");
- let {
- ACTIVITY_TYPE,
- EVENTS,
- } = windowRequire("devtools/client/netmonitor/src/constants");
+ let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
gStore.dispatch(Actions.batchEnable(false));
- let wait = waitForEvents();
+ let wait = waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
yield performRequests();
yield wait;
+ yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail when all items are shown.");
checkImageThumbnail();
@@ -38,22 +37,16 @@ add_task(function* () {
checkImageThumbnail();
info("Reloading the debuggee and performing all requests again...");
- wait = waitForEvents();
+ wait = waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
yield reloadAndPerformRequests();
yield wait;
+ yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a reload.");
checkImageThumbnail();
yield teardown(monitor);
- function waitForEvents() {
- return promise.all([
- waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS),
- monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
- ]);
- }
-
function performRequests() {
return ContentTask.spawn(tab.linkedBrowser, {}, function* () {
content.wrappedJSObject.performRequests();
@@ -66,12 +59,11 @@ add_task(function* () {
}
function checkImageThumbnail() {
- is(document.querySelectorAll(".requests-list-icon[data-type=thumbnail]").length, 1,
+ is(document.querySelectorAll(SELECTOR).length, 1,
"There should be only one image request with a thumbnail displayed.");
- is(document.querySelector(".requests-list-icon[data-type=thumbnail]").src,
- TEST_IMAGE_DATA_URI,
+ is(document.querySelector(SELECTOR).src, TEST_IMAGE_DATA_URI,
"The image requests-list-icon thumbnail is displayed correctly.");
- is(document.querySelector(".requests-list-icon[data-type=thumbnail]").hidden, false,
+ is(document.querySelector(SELECTOR).hidden, false,
"The image requests-list-icon thumbnail should not be hidden.");
}
});
diff --git a/devtools/client/netmonitor/test/browser_net_image-tooltip.js b/devtools/client/netmonitor/test/browser_net_image-tooltip.js
index c8fa4c62b07e..4dbbd4127030 100644
--- a/devtools/client/netmonitor/test/browser_net_image-tooltip.js
+++ b/devtools/client/netmonitor/test/browser_net_image-tooltip.js
@@ -11,25 +11,22 @@ const IMAGE_TOOLTIP_REQUESTS = 1;
*/
add_task(function* test() {
let { tab, monitor } = yield initNetMonitor(IMAGE_TOOLTIP_URL);
+ const SELECTOR = ".requests-list-icon[src]";
info("Starting test... ");
let { document, gStore, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
let { NetMonitorController } =
windowRequire("devtools/client/netmonitor/src/netmonitor-controller");
- let {
- ACTIVITY_TYPE,
- EVENTS,
- } = windowRequire("devtools/client/netmonitor/src/constants");
+ let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
let toolboxDoc = monitor.panelWin.parent.document;
gStore.dispatch(Actions.batchEnable(false));
let onEvents = waitForNetworkEvents(monitor, IMAGE_TOOLTIP_REQUESTS);
- let onThumbnail = monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
yield performRequests();
yield onEvents;
- yield onThumbnail;
+ yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a few requests were made...");
yield showTooltipAndVerify(document.querySelectorAll(".request-list-item")[0]);
@@ -41,13 +38,12 @@ add_task(function* test() {
// +1 extra document reload
onEvents = waitForNetworkEvents(monitor, IMAGE_TOOLTIP_REQUESTS + 1);
- onThumbnail = monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
info("Reloading the debuggee and performing all requests again...");
yield NetMonitorController.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED);
yield performRequests();
yield onEvents;
- yield onThumbnail;
+ yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a reload.");
yield showTooltipAndVerify(document.querySelectorAll(".request-list-item")[1]);
diff --git a/devtools/client/netmonitor/test/browser_net_simple-request-data.js b/devtools/client/netmonitor/test/browser_net_simple-request-data.js
index 2f71b45458e1..cbd5908f283f 100644
--- a/devtools/client/netmonitor/test/browser_net_simple-request-data.js
+++ b/devtools/client/netmonitor/test/browser_net_simple-request-data.js
@@ -193,7 +193,7 @@ function test() {
);
});
- monitor.panelWin.once(EVENTS.UPDATING_RESPONSE_CONTENT, () => {
+ monitor.panelWin.once(EVENTS.RECEIVED_RESPONSE_CONTENT, () => {
let requestItem = getSortedRequests(gStore.getState()).get(0);
is(requestItem.transferredSize, "12",
@@ -203,24 +203,6 @@ function test() {
is(requestItem.mimeType, "text/plain; charset=utf-8",
"The mimeType data has an incorrect value.");
- verifyRequestItemTarget(
- document,
- getDisplayedRequests(gStore.getState()),
- requestItem,
- "GET",
- SIMPLE_SJS,
- {
- type: "plain",
- fullMimeType: "text/plain; charset=utf-8",
- transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12),
- size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12),
- }
- );
- });
-
- monitor.panelWin.once(EVENTS.RECEIVED_RESPONSE_CONTENT, () => {
- let requestItem = getSortedRequests(gStore.getState()).get(0);
-
ok(requestItem.responseContent,
"There should be a responseContent data available.");
// eslint-disable-next-line mozilla/no-cpows-in-tests
diff --git a/devtools/client/shared/components/notification-box.js b/devtools/client/shared/components/notification-box.js
index 87fc76cd6591..838d2ac297bf 100644
--- a/devtools/client/shared/components/notification-box.js
+++ b/devtools/client/shared/components/notification-box.js
@@ -29,7 +29,7 @@ const PriorityLevels = {
/**
* This component represents Notification Box - HTML alternative for
- * binding.
+ * binding.
*
* See also MDN for more info about :
* https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/notificationbox
diff --git a/devtools/shared/acorn/tests/unit/test_import_acorn.js b/devtools/shared/acorn/tests/unit/test_import_acorn.js
index 49b2b50cb903..42a0edcea4bb 100644
--- a/devtools/shared/acorn/tests/unit/test_import_acorn.js
+++ b/devtools/shared/acorn/tests/unit/test_import_acorn.js
@@ -1,18 +1,18 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that we can require acorn.
- */
-
-function run_test() {
- const acorn = require("acorn/acorn");
- const acorn_loose = require("acorn/acorn_loose");
- const walk = require("acorn/util/walk");
- do_check_true(isObject(acorn));
- do_check_true(isObject(acorn_loose));
- do_check_true(isObject(walk));
- do_check_eq(typeof acorn.parse, "function");
- do_check_eq(typeof acorn_loose.parse_dammit, "function");
- do_check_eq(typeof walk.simple, "function");
-}
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test that we can require acorn.
+ */
+
+function run_test() {
+ const acorn = require("acorn/acorn");
+ const acorn_loose = require("acorn/acorn_loose");
+ const walk = require("acorn/util/walk");
+ do_check_true(isObject(acorn));
+ do_check_true(isObject(acorn_loose));
+ do_check_true(isObject(walk));
+ do_check_eq(typeof acorn.parse, "function");
+ do_check_eq(typeof acorn_loose.parse_dammit, "function");
+ do_check_eq(typeof walk.simple, "function");
+}
diff --git a/devtools/shared/acorn/tests/unit/test_lenient_parser.js b/devtools/shared/acorn/tests/unit/test_lenient_parser.js
index 7586eb8a3342..bc7a3d7c8c7c 100644
--- a/devtools/shared/acorn/tests/unit/test_lenient_parser.js
+++ b/devtools/shared/acorn/tests/unit/test_lenient_parser.js
@@ -1,62 +1,62 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that acorn's lenient parser gives something usable.
- */
-
-const acorn_loose = require("acorn/acorn_loose");
-
-function run_test() {
- let actualAST = acorn_loose.parse_dammit("let x = 10", {});
-
- do_print("Actual AST:");
- do_print(JSON.stringify(actualAST, null, 2));
- do_print("Expected AST:");
- do_print(JSON.stringify(expectedAST, null, 2));
-
- checkEquivalentASTs(expectedAST, actualAST);
-}
-
-const expectedAST = {
- "type": "Program",
- "start": 0,
- "end": 10,
- "body": [
- {
- "type": "ExpressionStatement",
- "start": 0,
- "end": 3,
- "expression": {
- "type": "Identifier",
- "start": 0,
- "end": 3,
- "name": "let"
- }
- },
- {
- "type": "ExpressionStatement",
- "start": 4,
- "end": 10,
- "expression": {
- "type": "AssignmentExpression",
- "start": 4,
- "end": 10,
- "operator": "=",
- "left": {
- "type": "Identifier",
- "start": 4,
- "end": 5,
- "name": "x"
- },
- "right": {
- "type": "Literal",
- "start": 8,
- "end": 10,
- "value": 10,
- "raw": "10"
- }
- }
- }
- ]
-};
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test that acorn's lenient parser gives something usable.
+ */
+
+const acorn_loose = require("acorn/acorn_loose");
+
+function run_test() {
+ let actualAST = acorn_loose.parse_dammit("let x = 10", {});
+
+ do_print("Actual AST:");
+ do_print(JSON.stringify(actualAST, null, 2));
+ do_print("Expected AST:");
+ do_print(JSON.stringify(expectedAST, null, 2));
+
+ checkEquivalentASTs(expectedAST, actualAST);
+}
+
+const expectedAST = {
+ "type": "Program",
+ "start": 0,
+ "end": 10,
+ "body": [
+ {
+ "type": "ExpressionStatement",
+ "start": 0,
+ "end": 3,
+ "expression": {
+ "type": "Identifier",
+ "start": 0,
+ "end": 3,
+ "name": "let"
+ }
+ },
+ {
+ "type": "ExpressionStatement",
+ "start": 4,
+ "end": 10,
+ "expression": {
+ "type": "AssignmentExpression",
+ "start": 4,
+ "end": 10,
+ "operator": "=",
+ "left": {
+ "type": "Identifier",
+ "start": 4,
+ "end": 5,
+ "name": "x"
+ },
+ "right": {
+ "type": "Literal",
+ "start": 8,
+ "end": 10,
+ "value": 10,
+ "raw": "10"
+ }
+ }
+ }
+ ]
+};
diff --git a/devtools/shared/acorn/tests/unit/test_same_ast.js b/devtools/shared/acorn/tests/unit/test_same_ast.js
index d1d76bc500ff..ff4420d91d09 100644
--- a/devtools/shared/acorn/tests/unit/test_same_ast.js
+++ b/devtools/shared/acorn/tests/unit/test_same_ast.js
@@ -1,37 +1,37 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that Reflect and acorn create the same AST for ES5.
- */
-
-const acorn = require("acorn/acorn");
-const { Reflect } = require("resource://gre/modules/reflect.jsm");
-
-const testCode = "" + function main () {
- function makeAcc(n) {
- return function () {
- return ++n;
- };
- }
-
- var acc = makeAcc(10);
-
- for (var i = 0; i < 10; i++) {
- acc();
- }
-
- console.log(acc());
-};
-
-function run_test() {
- const reflectAST = Reflect.parse(testCode);
- const acornAST = acorn.parse(testCode);
-
- do_print("Reflect AST:");
- do_print(JSON.stringify(reflectAST, null, 2));
- do_print("acorn AST:");
- do_print(JSON.stringify(acornAST, null, 2));
-
- checkEquivalentASTs(reflectAST, acornAST);
-}
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+/**
+ * Test that Reflect and acorn create the same AST for ES5.
+ */
+
+const acorn = require("acorn/acorn");
+const { Reflect } = require("resource://gre/modules/reflect.jsm");
+
+const testCode = "" + function main () {
+ function makeAcc(n) {
+ return function () {
+ return ++n;
+ };
+ }
+
+ var acc = makeAcc(10);
+
+ for (var i = 0; i < 10; i++) {
+ acc();
+ }
+
+ console.log(acc());
+};
+
+function run_test() {
+ const reflectAST = Reflect.parse(testCode);
+ const acornAST = acorn.parse(testCode);
+
+ do_print("Reflect AST:");
+ do_print(JSON.stringify(reflectAST, null, 2));
+ do_print("acorn AST:");
+ do_print(JSON.stringify(acornAST, null, 2));
+
+ checkEquivalentASTs(reflectAST, acornAST);
+}
diff --git a/dom/base/domerr.msg b/dom/base/domerr.msg
index 5bc7b450143c..42ac0fb62117 100644
--- a/dom/base/domerr.msg
+++ b/dom/base/domerr.msg
@@ -145,6 +145,7 @@ DOM4_MSG_DEF(AbortError, "Error retrieving push subscription.", NS_ERROR_DOM_PUS
DOM4_MSG_DEF(NetworkError, "Push service unreachable.", NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE)
DOM4_MSG_DEF(InvalidAccessError, "Invalid raw ECDSA P-256 public key.", NS_ERROR_DOM_PUSH_INVALID_KEY_ERR)
DOM4_MSG_DEF(InvalidStateError, "A subscription with a different application server key already exists.", NS_ERROR_DOM_PUSH_MISMATCHED_KEY_ERR)
+DOM4_MSG_DEF(InvalidStateError, "GCM service disabled.", NS_ERROR_DOM_PUSH_GCM_DISABLED)
/* Media errors */
DOM4_MSG_DEF(AbortError, "The fetching process for the media resource was aborted by the user agent at the user's request.", NS_ERROR_DOM_MEDIA_ABORT_ERR)
diff --git a/dom/media/tests/mochitest/mochitest.ini b/dom/media/tests/mochitest/mochitest.ini
index 9bf1e7968943..abcf3dad9d8f 100644
--- a/dom/media/tests/mochitest/mochitest.ini
+++ b/dom/media/tests/mochitest/mochitest.ini
@@ -120,6 +120,8 @@ skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulato
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicVideo.html]
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
+[test_peerConnection_basicVideoRemoteHwEncoder.html]
+skip-if = os == 'linux' || os == 'mac' || os == 'win' || (android_version == '18' && debug) # android-specific feature. android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicScreenshare.html]
# frequent timeouts/crashes on e10s (bug 1048455)
skip-if = toolkit == 'android' # no screenshare on android
diff --git a/dom/media/tests/mochitest/test_peerConnection_basicVideoRemoteHwEncoder.html b/dom/media/tests/mochitest/test_peerConnection_basicVideoRemoteHwEncoder.html
new file mode 100644
index 000000000000..22a37f51cd8d
--- /dev/null
+++ b/dom/media/tests/mochitest/test_peerConnection_basicVideoRemoteHwEncoder.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/editor/libeditor/TextEditRules.cpp b/editor/libeditor/TextEditRules.cpp
index afff387109f9..014ec7e217d7 100644
--- a/editor/libeditor/TextEditRules.cpp
+++ b/editor/libeditor/TextEditRules.cpp
@@ -26,10 +26,8 @@
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIDOMDocument.h"
-#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIDOMNodeFilter.h"
-#include "nsIDOMNodeIterator.h"
#include "nsIDOMText.h"
#include "nsNameSpaceManager.h"
#include "nsINode.h"
@@ -191,7 +189,7 @@ TextEditRules::BeforeEdit(EditAction action,
RefPtr selection = mTextEditor->GetSelection();
NS_ENSURE_STATE(selection);
- selection->GetAnchorNode(getter_AddRefs(mCachedSelectionNode));
+ mCachedSelectionNode = selection->GetAnchorNode();
selection->GetAnchorOffset(&mCachedSelectionOffset);
return NS_OK;
@@ -216,7 +214,7 @@ TextEditRules::AfterEdit(EditAction action,
NS_ENSURE_STATE(mTextEditor);
nsresult rv =
mTextEditor->HandleInlineSpellCheck(action, selection,
- mCachedSelectionNode,
+ GetAsDOMNode(mCachedSelectionNode),
mCachedSelectionOffset,
nullptr, 0, nullptr, 0);
NS_ENSURE_SUCCESS(rv, rv);
@@ -995,7 +993,7 @@ TextEditRules::DidUndo(Selection* aSelection,
NS_ENSURE_TRUE(theRoot, NS_ERROR_FAILURE);
nsIContent* node = mTextEditor->GetLeftmostChild(theRoot);
if (node && mTextEditor->IsMozEditorBogusNode(node)) {
- mBogusNode = do_QueryInterface(node);
+ mBogusNode = node;
} else {
mBogusNode = nullptr;
}
@@ -1045,7 +1043,7 @@ TextEditRules::DidRedo(Selection* aSelection,
RefPtr node = nodeList->Item(0);
if (mTextEditor->IsMozEditorBogusNode(node)) {
- mBogusNode = do_QueryInterface(node);
+ mBogusNode = node;
} else {
mBogusNode = nullptr;
}
@@ -1131,7 +1129,7 @@ TextEditRules::RemoveRedundantTrailingBR()
elem->UnsetAttr(kNameSpaceID_None, nsGkAtoms::type, true);
// set mBogusNode to be this
- mBogusNode = do_QueryInterface(elem);
+ mBogusNode = elem;
// give it the bogus node attribute
elem->SetAttr(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
@@ -1220,16 +1218,14 @@ TextEditRules::CreateBogusNodeIfNeeded(Selection* aSelection)
NS_ENSURE_STATE(newContent);
// set mBogusNode to be the newly created
- mBogusNode = do_QueryInterface(newContent);
- NS_ENSURE_TRUE(mBogusNode, NS_ERROR_NULL_POINTER);
+ mBogusNode = newContent;
// Give it a special attribute.
newContent->SetAttr(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
kMOZEditorBogusNodeValue, false);
// Put the node in the document.
- nsCOMPtr bodyNode = do_QueryInterface(body);
- nsresult rv = mTextEditor->InsertNode(mBogusNode, bodyNode, 0);
+ nsresult rv = mTextEditor->InsertNode(*mBogusNode, *body, 0);
NS_ENSURE_SUCCESS(rv, rv);
// Set selection.
diff --git a/editor/libeditor/TextEditRules.h b/editor/libeditor/TextEditRules.h
index 602e703bd313..d1bb0bee160a 100644
--- a/editor/libeditor/TextEditRules.h
+++ b/editor/libeditor/TextEditRules.h
@@ -16,7 +16,6 @@
#include "nsString.h"
#include "nscore.h"
-class nsIDOMElement;
class nsIDOMNode;
namespace mozilla {
@@ -124,7 +123,6 @@ protected:
nsAString* outString,
int32_t aMaxLength);
nsresult DidInsertText(Selection* aSelection, nsresult aResult);
- nsresult GetTopEnclosingPre(nsIDOMNode* aNode, nsIDOMNode** aOutPreNode);
nsresult WillInsertBreak(Selection* aSelection, bool* aCancel,
bool* aHandled, int32_t aMaxLength);
@@ -235,9 +233,9 @@ protected:
nsString mPasswordIMEText;
uint32_t mPasswordIMEIndex;
// Magic node acts as placeholder in empty doc.
- nsCOMPtr mBogusNode;
+ nsCOMPtr mBogusNode;
// Cached selected node.
- nsCOMPtr mCachedSelectionNode;
+ nsCOMPtr mCachedSelectionNode;
// Cached selected offset.
int32_t mCachedSelectionOffset;
uint32_t mActionNesting;
diff --git a/gfx/ipc/GfxMessageUtils.h b/gfx/ipc/GfxMessageUtils.h
index 63d5cf32017d..7545f6bf49f3 100644
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -1298,6 +1298,7 @@ struct ParamTraits
WriteParam(aMsg, aParam.mDragStartSequenceNumber);
WriteParam(aMsg, aParam.mScrollbarDragOffset);
WriteParam(aMsg, aParam.mScrollTrack);
+ WriteParam(aMsg, aParam.mScrollThumbLength);
WriteParam(aMsg, aParam.mDirection);
}
@@ -1308,6 +1309,7 @@ struct ParamTraits
ReadParam(aMsg, aIter, &aResult->mDragStartSequenceNumber) &&
ReadParam(aMsg, aIter, &aResult->mScrollbarDragOffset) &&
ReadParam(aMsg, aIter, &aResult->mScrollTrack) &&
+ ReadParam(aMsg, aIter, &aResult->mScrollThumbLength) &&
ReadParam(aMsg, aIter, &aResult->mDirection));
}
};
diff --git a/gfx/layers/LayerMetricsWrapper.h b/gfx/layers/LayerMetricsWrapper.h
index 4fc9ed274c4f..10887c229b78 100644
--- a/gfx/layers/LayerMetricsWrapper.h
+++ b/gfx/layers/LayerMetricsWrapper.h
@@ -411,15 +411,6 @@ public:
return mLayer->GetScrollbarTargetContainerId();
}
- int32_t GetScrollThumbLength() const
- {
- if (GetScrollbarDirection() == ScrollDirection::VERTICAL) {
- return mLayer->GetVisibleRegion().GetBounds().height;
- } else {
- return mLayer->GetVisibleRegion().GetBounds().width;
- }
- }
-
bool IsScrollbarContainer() const
{
MOZ_ASSERT(IsValid());
diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp
index 48add7a94cd0..006c517aaf6f 100644
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -495,7 +495,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
GetEventRegionsOverride(aParent, aLayer));
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
- aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;
@@ -685,7 +684,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
// when those properties change.
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
- aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;
diff --git a/gfx/layers/apz/src/AsyncDragMetrics.h b/gfx/layers/apz/src/AsyncDragMetrics.h
index cd763a243e55..1ebfb5947742 100644
--- a/gfx/layers/apz/src/AsyncDragMetrics.h
+++ b/gfx/layers/apz/src/AsyncDragMetrics.h
@@ -34,6 +34,7 @@ public:
, mPresShellId(0)
, mDragStartSequenceNumber(0)
, mScrollbarDragOffset(0)
+ , mScrollThumbLength(0)
, mDirection(NONE)
{}
@@ -42,12 +43,14 @@ public:
uint64_t aDragStartSequenceNumber,
CSSCoord aScrollbarDragOffset,
const CSSRect& aScrollTrack,
+ CSSCoord aScrollThumbLength,
DragDirection aDirection)
: mViewId(aViewId)
, mPresShellId(aPresShellId)
, mDragStartSequenceNumber(aDragStartSequenceNumber)
, mScrollbarDragOffset(aScrollbarDragOffset)
, mScrollTrack(aScrollTrack)
+ , mScrollThumbLength(aScrollThumbLength)
, mDirection(aDirection)
{}
@@ -56,6 +59,7 @@ public:
uint64_t mDragStartSequenceNumber;
CSSCoord mScrollbarDragOffset;
CSSRect mScrollTrack;
+ CSSCoord mScrollThumbLength;
DragDirection mDirection;
};
diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp
index 6290bf51dab7..da35760ef1cf 100644
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -927,9 +927,7 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
GetAxisStart(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
CSSCoord scrollMax = GetAxisLength(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
- scrollMax -= node->GetScrollThumbLength() /
- GetAxisScale(aDragMetrics.mDirection, mFrameMetrics.GetZoom()) *
- mFrameMetrics.GetPresShellResolution();
+ scrollMax -= aDragMetrics.mScrollThumbLength;
float scrollPercent = mousePosition / scrollMax;
diff --git a/gfx/layers/apz/src/HitTestingTreeNode.cpp b/gfx/layers/apz/src/HitTestingTreeNode.cpp
index 0fe7ffa1d334..77be356af5c0 100644
--- a/gfx/layers/apz/src/HitTestingTreeNode.cpp
+++ b/gfx/layers/apz/src/HitTestingTreeNode.cpp
@@ -28,7 +28,6 @@ HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
, mLayersId(aLayersId)
, mScrollViewId(FrameMetrics::NULL_SCROLL_ID)
, mScrollDir(ScrollDirection::NONE)
- , mScrollThumbLength(0)
, mIsScrollbarContainer(false)
, mFixedPosTarget(FrameMetrics::NULL_SCROLL_ID)
, mOverride(EventRegionsOverride::NoOverride)
@@ -97,12 +96,10 @@ HitTestingTreeNode::SetLastChild(HitTestingTreeNode* aChild)
void
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
- int32_t aScrollThumbLength,
bool aIsScrollContainer)
{
mScrollViewId = aScrollViewId;
mScrollDir = aDir;
- mScrollThumbLength = aScrollThumbLength;
mIsScrollbarContainer = aIsScrollContainer;
}
@@ -116,12 +113,6 @@ HitTestingTreeNode::MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetric
mScrollViewId == aDragMetrics.mViewId;
}
-LayerIntCoord
-HitTestingTreeNode::GetScrollThumbLength() const
-{
- return mScrollThumbLength;
-}
-
bool
HitTestingTreeNode::IsScrollbarNode() const
{
diff --git a/gfx/layers/apz/src/HitTestingTreeNode.h b/gfx/layers/apz/src/HitTestingTreeNode.h
index 628259524620..606b758ff631 100644
--- a/gfx/layers/apz/src/HitTestingTreeNode.h
+++ b/gfx/layers/apz/src/HitTestingTreeNode.h
@@ -93,7 +93,6 @@ public:
void SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
- int32_t aScrollThumbLength,
bool aIsScrollContainer);
bool MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const;
LayerIntCoord GetScrollThumbLength() const;
@@ -135,7 +134,6 @@ private:
// This is set for scroll thumb Container layers only.
ScrollDirection mScrollDir;
- int32_t mScrollThumbLength;
// This is set for scroll track Container layers only.
bool mIsScrollbarContainer;
diff --git a/ipc/glue/MessageChannel.cpp b/ipc/glue/MessageChannel.cpp
index bd7fb8181230..f4f6ba4be3f3 100644
--- a/ipc/glue/MessageChannel.cpp
+++ b/ipc/glue/MessageChannel.cpp
@@ -717,7 +717,7 @@ MessageChannel::Clear()
gUnresolvedPromises -= mPendingPromises.size();
for (auto& pair : mPendingPromises) {
- pair.second.mRejectFunction(__func__);
+ pair.second.mRejectFunction(pair.second.mPromise, __func__);
}
mPendingPromises.clear();
diff --git a/ipc/glue/MessageChannel.h b/ipc/glue/MessageChannel.h
index 69d3225efebc..fd74ec7a3370 100644
--- a/ipc/glue/MessageChannel.h
+++ b/ipc/glue/MessageChannel.h
@@ -98,7 +98,7 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
struct PromiseHolder
{
RefPtr mPromise;
- std::function mRejectFunction;
+ std::function mRejectFunction;
};
static Atomic gUnresolvedPromises;
friend class PromiseReporter;
@@ -186,8 +186,10 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
}
PromiseHolder holder;
holder.mPromise = aPromise;
- holder.mRejectFunction = [aPromise](const char* aRejectSite) {
- aPromise->Reject(PromiseRejectReason::ChannelClosed, aRejectSite);
+ holder.mRejectFunction = [](MozPromiseRefcountable* aRejectPromise,
+ const char* aRejectSite) {
+ static_cast(aRejectPromise)->Reject(
+ PromiseRejectReason::ChannelClosed, aRejectSite);
};
mPendingPromises.insert(std::make_pair(seqno, Move(holder)));
gUnresolvedPromises++;
diff --git a/ipc/ipdl/test/cxx/TestAsyncReturns.cpp b/ipc/ipdl/test/cxx/TestAsyncReturns.cpp
index 12c6c4a7a37e..f34b46a9b269 100644
--- a/ipc/ipdl/test/cxx/TestAsyncReturns.cpp
+++ b/ipc/ipdl/test/cxx/TestAsyncReturns.cpp
@@ -2,6 +2,8 @@
#include "IPDLUnitTests.h" // fail etc.
+#include "mozilla/Unused.h"
+
namespace mozilla {
namespace _ipdltest {
@@ -79,7 +81,7 @@ mozilla::ipc::IPCResult
TestAsyncReturnsChild::RecvNoReturn(RefPtr&& aPromise)
{
// Leak the promise intentionally
- aPromise->AddRef();
+ Unused << do_AddRef(aPromise);
return IPC_OK();
}
diff --git a/layout/reftests/forms/progress/reftest-stylo.list b/layout/reftests/forms/progress/reftest-stylo.list
index 2c9fd8f1367e..c8619c5219b1 100644
--- a/layout/reftests/forms/progress/reftest-stylo.list
+++ b/layout/reftests/forms/progress/reftest-stylo.list
@@ -1,29 +1,29 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
-fails == values.html values.html
-fails == values-rtl.html values-rtl.html
-fails == margin-padding.html margin-padding.html
-fails == margin-padding-rtl.html margin-padding-rtl.html
+== values.html values.html
+== values-rtl.html values-rtl.html
+== margin-padding.html margin-padding.html
+== margin-padding-rtl.html margin-padding-rtl.html
fails == bar-pseudo-element.html bar-pseudo-element.html
-fails == bar-pseudo-element-rtl.html bar-pseudo-element-rtl.html
-fails == indeterminate-style-width.html indeterminate-style-width.html
+== bar-pseudo-element-rtl.html bar-pseudo-element-rtl.html
+== indeterminate-style-width.html indeterminate-style-width.html
# vertical tests
-fails == values-vertical.html values-vertical.html
-fails == values-vertical-rtl.html values-vertical-rtl.html
-fails == margin-padding-vertical.html margin-padding-vertical.html
-fails == margin-padding-vertical-rtl.html margin-padding-vertical-rtl.html
-fails == bar-pseudo-element-vertical.html bar-pseudo-element-vertical.html
-fails == bar-pseudo-element-vertical-rtl.html bar-pseudo-element-vertical-rtl.html
-fails == indeterminate-style-height.html indeterminate-style-height.html
+== values-vertical.html values-vertical.html
+== values-vertical-rtl.html values-vertical-rtl.html
+== margin-padding-vertical.html margin-padding-vertical.html
+== margin-padding-vertical-rtl.html margin-padding-vertical-rtl.html
+== bar-pseudo-element-vertical.html bar-pseudo-element-vertical.html
+== bar-pseudo-element-vertical-rtl.html bar-pseudo-element-vertical-rtl.html
+== indeterminate-style-height.html indeterminate-style-height.html
# The following test is disabled but kept in the repository because the
# transformations will not behave exactly the same for