diff --git a/Cargo.lock b/Cargo.lock
index 283b0a34d40b..21d59848e2f1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -181,11 +181,11 @@ dependencies = [
[[package]]
name = "binjs_meta"
-version = "0.3.6"
+version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"Inflector 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
+ "itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webidl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -194,7 +194,7 @@ dependencies = [
name = "binsource"
version = "0.1.0"
dependencies = [
- "binjs_meta 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "binjs_meta 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -947,14 +947,6 @@ dependencies = [
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "itertools"
-version = "0.6.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "either 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "itertools"
version = "0.7.6"
@@ -2551,7 +2543,7 @@ dependencies = [
"checksum binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "88ceb0d16c4fd0e42876e298d7d3ce3780dd9ebdcbe4199816a32c77e08597ff"
"checksum bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bda13183df33055cbb84b847becce220d392df502ebe7a4a78d7021771ed94d0"
"checksum bindgen 0.37.4 (registry+https://github.com/rust-lang/crates.io-index)" = "1b25ab82877ea8fe6ce1ce1f8ac54361f0218bad900af9eb11803994bf67c221"
-"checksum binjs_meta 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "9fcfc86eecb125147e907529a5f1ac7978f6f26d20a52b82a7e053da5faefbc3"
+"checksum binjs_meta 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "fd7ca5635f1c6f94aaef7de76cb834c5920578355ce41dbcaf731b7ebe348518"
"checksum bit-set 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c"
"checksum bit-vec 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
@@ -2627,7 +2619,6 @@ dependencies = [
"checksum ident_case 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c9826188e666f2ed92071d2dadef6edc430b11b158b5b2b3f4babbcc891eaaa"
"checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d"
"checksum iovec 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "29d062ee61fccdf25be172e70f34c9f6efc597e1fb8f6526e8437b2046ab26be"
-"checksum itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3f2be4da1690a039e9ae5fd575f706a63ad5a2120f161b1d653c9da3930dd21"
"checksum itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b07332223953b5051bceb67e8c4700aa65291535568e1f12408c43c4a42c0394"
"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js
index 2bf986a9bed1..9491a07a1902 100644
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -70,10 +70,7 @@ pref("extensions.geckoProfiler.getSymbolRules", "localBreakpad,dump_syms.exe");
pref("extensions.webextensions.base-content-security-policy", "script-src 'self' https://* moz-extension: blob: filesystem: 'unsafe-eval' 'unsafe-inline'; object-src 'self' https://* moz-extension: blob: filesystem:;");
pref("extensions.webextensions.default-content-security-policy", "script-src 'self'; object-src 'self';");
-#if defined(XP_WIN) || defined(XP_MACOSX)
pref("extensions.webextensions.remote", true);
-#endif
-
pref("extensions.webextensions.background-delayed-startup", true);
// Extensions that should not be flagged as legacy in about:addons
diff --git a/browser/base/content/browser-siteIdentity.js b/browser/base/content/browser-siteIdentity.js
index ca529b5ac125..c678c5e2b873 100644
--- a/browser/base/content/browser-siteIdentity.js
+++ b/browser/base/content/browser-siteIdentity.js
@@ -1023,7 +1023,7 @@ var gIdentityHandler = {
let block = document.createElement("vbox");
block.setAttribute("id", "identity-popup-popup-container");
menulist.setAttribute("sizetopopup", "none");
- menulist.setAttribute("class", "identity-popup-popup-menulist subviewkeynav");
+ menulist.setAttribute("class", "identity-popup-popup-menulist");
menulist.setAttribute("id", "identity-popup-popup-menulist");
for (let state of SitePermissions.getAvailableStates(aPermission.id)) {
@@ -1090,7 +1090,7 @@ var gIdentityHandler = {
}
let button = document.createElement("button");
- button.setAttribute("class", "identity-popup-permission-remove-button subviewkeynav");
+ button.setAttribute("class", "identity-popup-permission-remove-button");
let tooltiptext = gNavigatorBundle.getString("permissions.remove.tooltip");
button.setAttribute("tooltiptext", tooltiptext);
button.addEventListener("command", () => {
@@ -1146,7 +1146,7 @@ var gIdentityHandler = {
let text = document.createElement("label");
text.setAttribute("flex", "1");
- text.setAttribute("class", "identity-popup-permission-label text-link subviewkeynav");
+ text.setAttribute("class", "identity-popup-permission-label text-link");
let popupCount = gBrowser.selectedBrowser.blockedPopups.length;
let messageBase = gNavigatorBundle.getString("popupShowBlockedPopupsIndicatorText");
diff --git a/browser/components/controlcenter/content/panel.inc.xul b/browser/components/controlcenter/content/panel.inc.xul
index 1c7cf27a6528..de284d86ee7a 100644
--- a/browser/components/controlcenter/content/panel.inc.xul
+++ b/browser/components/controlcenter/content/panel.inc.xul
@@ -47,7 +47,7 @@
@@ -84,22 +84,22 @@
crop="end">&trackingProtection.reloadRequired2;
@@ -131,8 +131,7 @@
@@ -167,7 +166,6 @@
@@ -209,11 +207,11 @@
and-when-loginforms="insecure">&identity.description.activeLoaded;
-
-
@@ -221,7 +219,7 @@
diff --git a/browser/components/customizableui/PanelMultiView.jsm b/browser/components/customizableui/PanelMultiView.jsm
index fd8fd7f79fab..7425766b1b47 100644
--- a/browser/components/customizableui/PanelMultiView.jsm
+++ b/browser/components/customizableui/PanelMultiView.jsm
@@ -1357,17 +1357,29 @@ var PanelView = class extends AssociatedToNode {
}
/**
- * Retrieves the button elements that can be used for navigation using the
- * keyboard, that is all enabled buttons including the back button if visible.
+ * Array of enabled elements that can be selected with the keyboard. This
+ * means all buttons, menulists, and text links including the back button.
*
- * @return {Array}
+ * This list is cached until the view is closed, so elements that become
+ * enabled later may not be navigable.
*/
- _getNavigableElements() {
- let buttons = Array.from(this.node.querySelectorAll(
- ".subviewbutton:not([disabled]), .subviewkeynav:not([disabled])"));
+ get _navigableElements() {
+ if (this.__navigableElements) {
+ return this.__navigableElements;
+ }
+
+ let navigableElements = Array.from(this.node.querySelectorAll(
+ ":-moz-any(button,toolbarbutton,menulist,.text-link):not([disabled])"));
let dwu = this._dwu;
- return buttons.filter(button => {
- let bounds = dwu.getBoundsWithoutFlushing(button);
+ return this.__navigableElements = navigableElements.filter(element => {
+ // Set the "tabindex" attribute to make sure the element is focusable.
+ if (!element.hasAttribute("tabindex")) {
+ element.setAttribute("tabindex", "0");
+ }
+ if (element.hasAttribute("disabled")) {
+ return false;
+ }
+ let bounds = dwu.getBoundsWithoutFlushing(element);
return bounds.width > 0 && bounds.height > 0;
});
}
@@ -1377,8 +1389,7 @@ var PanelView = class extends AssociatedToNode {
* is selected. Since the reference is held weakly, it can become null or
* undefined at any time.
*
- * The element is usually, but not necessarily, in the "buttons" property
- * which in turn is initialized from the _getNavigableElements list.
+ * The element is usually, but not necessarily, among the _navigableElements.
*/
get selectedElement() {
return this._selectedElement && this._selectedElement.get();
@@ -1396,19 +1407,19 @@ var PanelView = class extends AssociatedToNode {
* This is a no-op if there are no navigable elements.
*/
focusFirstNavigableElement() {
- this.selectedElement = this._getNavigableElements()[0];
+ this.selectedElement = this._navigableElements[0];
this.focusSelectedElement();
}
/**
- * Based on going up or down, select the previous or next focusable button.
+ * Based on going up or down, select the previous or next focusable element.
*
* @param {Boolean} isDown whether we're going down (true) or up (false).
*
- * @return {DOMNode} the button we selected.
+ * @return {DOMNode} the element we selected.
*/
moveSelection(isDown) {
- let buttons = this.buttons;
+ let buttons = this._navigableElements;
let lastSelected = this.selectedElement;
let newButton = null;
let maxIdx = buttons.length - 1;
@@ -1478,19 +1489,10 @@ var PanelView = class extends AssociatedToNode {
return;
}
- let buttons = this.buttons;
- if (!buttons || !buttons.length) {
- buttons = this.buttons = this._getNavigableElements();
- // Set the 'tabindex' attribute on the buttons to make sure they're focussable.
- for (let button of buttons) {
- if (!button.classList.contains("subviewbutton-back") &&
- !button.hasAttribute("tabindex")) {
- button.setAttribute("tabindex", 0);
- }
- }
- }
- if (!buttons.length)
+ let buttons = this._navigableElements;
+ if (!buttons.length) {
return;
+ }
let stop = () => {
event.stopPropagation();
@@ -1559,7 +1561,7 @@ var PanelView = class extends AssociatedToNode {
* Clear all traces of keyboard navigation happening right now.
*/
clearNavigation() {
- delete this.buttons;
+ delete this.__navigableElements;
let selected = this.selectedElement;
if (selected) {
selected.blur();
diff --git a/browser/components/customizableui/content/panelUI.inc.xul b/browser/components/customizableui/content/panelUI.inc.xul
index 9433733f211e..3ff20525d99d 100644
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -217,7 +217,6 @@
label="&trackingProtection.title;"/>
diff --git a/browser/components/customizableui/test/browser_panel_keyboard_navigation.js b/browser/components/customizableui/test/browser_panel_keyboard_navigation.js
index 698674649e1a..d3d2c22a2d45 100644
--- a/browser/components/customizableui/test/browser_panel_keyboard_navigation.js
+++ b/browser/components/customizableui/test/browser_panel_keyboard_navigation.js
@@ -7,10 +7,19 @@
const {PanelView} = ChromeUtils.import("resource:///modules/PanelMultiView.jsm", {});
const kHelpButtonId = "appMenu-help-button";
+function getEnabledNavigableElementsForView(panelView) {
+ return Array.from(panelView.querySelectorAll(
+ "button,toolbarbutton,menulist,.text-link"
+ )).filter(element => {
+ let bounds = element.getBoundingClientRect();
+ return !element.disabled && (bounds.width > 0 && bounds.height > 0);
+ });
+}
+
add_task(async function testUpDownKeys() {
await gCUITestUtils.openMainMenu();
- let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
+ let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
for (let button of buttons) {
if (button.disabled)
@@ -39,7 +48,7 @@ add_task(async function testUpDownKeys() {
add_task(async function testEnterKeyBehaviors() {
await gCUITestUtils.openMainMenu();
- let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
+ let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
// Navigate to the 'Help' button, which points to a subview.
EventUtils.synthesizeKey("KEY_ArrowUp");
@@ -56,7 +65,7 @@ add_task(async function testEnterKeyBehaviors() {
EventUtils.synthesizeKey("KEY_Enter");
await promise;
- let helpButtons = PanelView.forNode(PanelUI.helpView)._getNavigableElements();
+ let helpButtons = getEnabledNavigableElementsForView(PanelUI.helpView);
Assert.ok(helpButtons[0].classList.contains("subviewbutton-back"),
"First button in help view should be a back button");
@@ -132,7 +141,7 @@ add_task(async function testLeftRightKeys() {
add_task(async function testTabKey() {
await gCUITestUtils.openMainMenu();
- let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
+ let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
for (let button of buttons) {
if (button.disabled)
@@ -165,7 +174,7 @@ add_task(async function testTabKey() {
add_task(async function testInterleavedTabAndArrowKeys() {
await gCUITestUtils.openMainMenu();
- let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
+ let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
let tab = false;
for (let button of buttons) {
@@ -188,7 +197,7 @@ add_task(async function testInterleavedTabAndArrowKeys() {
add_task(async function testSpaceDownAfterTabNavigation() {
await gCUITestUtils.openMainMenu();
- let buttons = PanelView.forNode(PanelUI.mainView)._getNavigableElements();
+ let buttons = getEnabledNavigableElementsForView(PanelUI.mainView);
let button;
for (button of buttons) {
diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js b/browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js
index b3b14b2e097e..8131d2ed6a13 100644
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_popup_preload.js
@@ -202,10 +202,12 @@ add_task(async function testBrowserActionTabPopulation() {
let widget = getBrowserActionWidget(extension).forWindow(win);
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mousedown", button: 0}, win);
- await extension.awaitMessage("tabTitle");
+ await new Promise(resolve => setTimeout(resolve, 100));
EventUtils.synthesizeMouseAtCenter(widget.node, {type: "mouseup", button: 0}, win);
+ await extension.awaitMessage("tabTitle");
+
await extension.unload();
await BrowserTestUtils.closeWindow(win);
});
diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css
index 0135be311a88..11330205d607 100644
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -213,14 +213,6 @@
%include ../shared/toolbarbutton-icons.inc.css
%include ../shared/menupanel.inc.css
-/* Override OSX-specific toolkit findbar button styles */
-.findbar-button {
- background: none;
- box-shadow: none;
- border: none;
- color: inherit;
-}
-
/* On Mac, native buttons keep their full opacity when they become disabled
* and only the glyph or text on top of them becomes less opaque. */
:root:not([customizing]) #back-button[disabled="true"] {
diff --git a/browser/themes/shared/toolbarbuttons.inc.css b/browser/themes/shared/toolbarbuttons.inc.css
index 70d590f174b3..ccf5e5d871e9 100644
--- a/browser/themes/shared/toolbarbuttons.inc.css
+++ b/browser/themes/shared/toolbarbuttons.inc.css
@@ -91,12 +91,6 @@ toolbar[brighttext] {
background-color: Highlight;
}
-.findbar-button {
- -moz-appearance: none;
- padding: 0;
- color: inherit;
-}
-
toolbar .toolbarbutton-1 {
-moz-appearance: none;
margin: 0;
diff --git a/config/system-headers.mozbuild b/config/system-headers.mozbuild
index 8f120f7cd267..97dc3f1cde66 100644
--- a/config/system-headers.mozbuild
+++ b/config/system-headers.mozbuild
@@ -1346,3 +1346,20 @@ if CONFIG['MOZ_WAYLAND']:
'wayland-client.h',
'wayland-egl.h',
]
+
+if CONFIG['MOZ_LIB_SECRET']:
+ system_headers += [
+ 'libsecret/secret.h',
+ 'libsecret/secret-attributes.h',
+ 'libsecret/secret-collection.h',
+ 'libsecret/secret-enum-types.h',
+ 'libsecret/secret-item.h',
+ 'libsecret/secret-password.h',
+ 'libsecret/secret-paths.h',
+ 'libsecret/secret-prompt.h',
+ 'libsecret/secret-schema.h',
+ 'libsecret/secret-schemas.h',
+ 'libsecret/secret-types.h',
+ 'libsecret/secret-value.h',
+ 'libsecret/secret-service.h',
+ ]
diff --git a/devtools/client/debugger/new/README.mozilla b/devtools/client/debugger/new/README.mozilla
index 6f64e2cccaa3..847ceede4473 100644
--- a/devtools/client/debugger/new/README.mozilla
+++ b/devtools/client/debugger/new/README.mozilla
@@ -1,9 +1,9 @@
This is the debugger.html project output.
See https://github.com/devtools-html/debugger.html
-Version 74
+Version 75
-Comparison: https://github.com/devtools-html/debugger.html/compare/release-73...release-74
+Comparison: https://github.com/devtools-html/debugger.html/compare/release-74...release-75
Packages:
- babel-plugin-transform-es2015-modules-commonjs @6.26.2
diff --git a/devtools/client/debugger/new/dist/debugger.css b/devtools/client/debugger/new/dist/debugger.css
index 198f21d76914..f7266623d476 100644
--- a/devtools/client/debugger/new/dist/debugger.css
+++ b/devtools/client/debugger/new/dist/debugger.css
@@ -55,8 +55,6 @@
.shortcuts-content {
padding: 15px;
- -moz-column-width: 250px;
- -webkit-column-width: 250px;
column-width: 250px;
cursor: default;
}
diff --git a/devtools/client/debugger/new/dist/parser-worker.js b/devtools/client/debugger/new/dist/parser-worker.js
index cb325b126346..d68e14164cd0 100644
--- a/devtools/client/debugger/new/dist/parser-worker.js
+++ b/devtools/client/debugger/new/dist/parser-worker.js
@@ -23171,8 +23171,9 @@ function buildMetaBindings(sourceId, node, ancestors, parentIndex = ancestors.le
};
}
- // Consider "Object(foo)" to be equivalent to "foo"
- if (t.isCallExpression(parent) && t.isIdentifier(parent.callee, { name: "Object" }) && parent.arguments.length === 1 && parent.arguments[0] === node) {
+ // Consider "Object(foo)", and "__webpack_require__.i(foo)" to be
+ // equivalent to "foo" since they are essentially identity functions.
+ if (t.isCallExpression(parent) && (t.isIdentifier(parent.callee, { name: "Object" }) || t.isMemberExpression(parent.callee, { computed: false }) && t.isIdentifier(parent.callee.object, { name: "__webpack_require__" }) && t.isIdentifier(parent.callee.property, { name: "i" })) && parent.arguments.length === 1 && parent.arguments[0] === node) {
return {
type: "inherit",
start: fromBabelLocation(parent.loc.start, sourceId),
diff --git a/devtools/client/debugger/new/src/components/Editor/Breakpoint.js b/devtools/client/debugger/new/src/components/Editor/Breakpoint.js
index b8ada2bf9fd6..13529e145f98 100644
--- a/devtools/client/debugger/new/src/components/Editor/Breakpoint.js
+++ b/devtools/client/debugger/new/src/components/Editor/Breakpoint.js
@@ -44,11 +44,11 @@ function makeMarker(isDisabled) {
return bp;
}
-class Breakpoint extends _react.Component {
- constructor() {
- super();
+class Breakpoint extends _react.PureComponent {
+ constructor(...args) {
+ var _temp;
- this.addBreakpoint = () => {
+ return _temp = super(...args), this.addBreakpoint = () => {
const {
breakpoint,
editor,
@@ -75,7 +75,7 @@ class Breakpoint extends _react.Component {
} else {
editor.codeMirror.removeLineClass(line, "line", "has-condition");
}
- };
+ }, _temp;
}
componentDidMount() {
diff --git a/devtools/client/debugger/new/src/components/Editor/index.js b/devtools/client/debugger/new/src/components/Editor/index.js
index a1fec30f7a43..dbb8872b3d5c 100644
--- a/devtools/client/debugger/new/src/components/Editor/index.js
+++ b/devtools/client/debugger/new/src/components/Editor/index.js
@@ -168,7 +168,7 @@ class Editor extends _react.PureComponent {
continueToHere
} = this.props; // ignore right clicks in the gutter
- if (ev.ctrlKey && ev.button === 0 || ev.which === 3 || selectedSource && selectedSource.isBlackBoxed || !selectedSource) {
+ if (ev.ctrlKey && ev.button === 0 || ev.button === 2 || selectedSource && selectedSource.isBlackBoxed || !selectedSource) {
return;
}
@@ -343,6 +343,11 @@ class Editor extends _react.PureComponent {
const {
selectedSource
} = this.props;
+
+ if (!selectedSource) {
+ return;
+ }
+
const line = (0, _editor.getCursorLine)(codeMirror);
return (0, _editor.toSourceLine)(selectedSource.id, line);
}
@@ -382,8 +387,9 @@ class Editor extends _react.PureComponent {
const {
setContextMenu
} = this.props;
+ const target = event.target;
- if (event.target.classList.contains("CodeMirror-linenumber")) {
+ if (target.classList.contains("CodeMirror-linenumber")) {
return setContextMenu("Gutter", event);
}
@@ -396,7 +402,7 @@ class Editor extends _react.PureComponent {
jumpToMappedLocation
} = this.props;
- if (e.metaKey && e.altKey) {
+ if (selectedLocation && e.metaKey && e.altKey) {
const sourceLocation = (0, _editor.getSourceLocationFromMouseEvent)(this.state.editor, selectedLocation, e);
jumpToMappedLocation(sourceLocation);
}
@@ -411,7 +417,7 @@ class Editor extends _react.PureComponent {
editor
} = this.state;
- if (!editor || !nextProps.selectedSource || !nextProps.selectedLocation || !(0, _source.isLoaded)(nextProps.selectedSource)) {
+ if (!editor || !nextProps.selectedSource || !nextProps.selectedLocation || !nextProps.selectedLocation.line || !(0, _source.isLoaded)(nextProps.selectedSource)) {
return false;
}
@@ -424,15 +430,19 @@ class Editor extends _react.PureComponent {
const {
editor
} = this.state;
+ const {
+ selectedLocation,
+ selectedSource
+ } = nextProps;
- if (this.shouldScrollToLocation(nextProps)) {
+ if (selectedLocation && this.shouldScrollToLocation(nextProps)) {
let {
line,
column
- } = (0, _editor.toEditorPosition)(nextProps.selectedLocation);
+ } = (0, _editor.toEditorPosition)(selectedLocation);
- if ((0, _editor.hasDocument)(nextProps.selectedSource.id)) {
- const doc = (0, _editor.getDocument)(nextProps.selectedSource.id);
+ if (selectedSource && (0, _editor.hasDocument)(selectedSource.id)) {
+ const doc = (0, _editor.getDocument)(selectedSource.id);
const lineText = doc.getLine(line);
column = Math.max(column, (0, _indentation.getIndentation)(lineText));
}
diff --git a/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js b/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js
index 20303f7402b0..3d43f23f07f6 100644
--- a/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js
+++ b/devtools/client/debugger/new/src/components/SecondaryPanes/CommandBar.js
@@ -149,11 +149,11 @@ class CommandBar extends _react.Component {
canRewind
} = this.props;
- if (canRewind) {
- return;
- }
-
if (isPaused) {
+ if (canRewind) {
+ return null;
+ }
+
return (0, _CommandBarButton.debugBtn)(() => this.resume(), "resume", "active", L10N.getFormatStr("resumeButtonTooltip", formatKey("resume")));
}
@@ -179,7 +179,7 @@ class CommandBar extends _react.Component {
}
const isDisabled = !isPaused;
- return [(0, _CommandBarButton.debugBtn)(this.props.rewind, "rewind", "active", "Rewind Execution"), (0, _CommandBarButton.debugBtn)(() => this.props.resume, "resume", "active", L10N.getFormatStr("resumeButtonTooltip", formatKey("resume"))), _react2.default.createElement("div", {
+ return [(0, _CommandBarButton.debugBtn)(this.props.rewind, "rewind", "active", "Rewind Execution"), (0, _CommandBarButton.debugBtn)(this.props.resume, "resume", "active", L10N.getFormatStr("resumeButtonTooltip", formatKey("resume"))), _react2.default.createElement("div", {
key: "divider-1",
className: "divider"
}), (0, _CommandBarButton.debugBtn)(this.props.reverseStepOver, "reverseStepOver", "active", "Reverse step over"), (0, _CommandBarButton.debugBtn)(this.props.stepOver, "stepOver", "active", L10N.getFormatStr("stepOverTooltip", formatKey("stepOver")), isDisabled), _react2.default.createElement("div", {
diff --git a/devtools/client/debugger/new/src/components/SecondaryPanes/index.js b/devtools/client/debugger/new/src/components/SecondaryPanes/index.js
index 2a6fcaf1a94e..4d6e75b9ca37 100644
--- a/devtools/client/debugger/new/src/components/SecondaryPanes/index.js
+++ b/devtools/client/debugger/new/src/components/SecondaryPanes/index.js
@@ -68,10 +68,6 @@ var _FrameworkComponent = require("./FrameworkComponent");
var _FrameworkComponent2 = _interopRequireDefault(_FrameworkComponent);
-var _ReactComponentStack = require("./ReactComponentStack");
-
-var _ReactComponentStack2 = _interopRequireDefault(_ReactComponentStack);
-
var _Scopes = require("./Scopes");
var _Scopes2 = _interopRequireDefault(_Scopes);
@@ -181,17 +177,6 @@ class SecondaryPanes extends _react.Component {
};
}
- getComponentStackItem() {
- return {
- header: L10N.getStr("components.header"),
- component: _react2.default.createElement(_ReactComponentStack2.default, null),
- opened: _prefs.prefs.componentStackVisible,
- onToggle: opened => {
- _prefs.prefs.componentStackVisible = opened;
- }
- };
- }
-
getComponentItem() {
const {
extra: {
@@ -292,11 +277,7 @@ class SecondaryPanes extends _react.Component {
items.push(this.getCallStackItem());
if (this.props.horizontal) {
- if (extra && extra.react) {
- if (_prefs.features.componentStack && extra.react.componentStack.length > 1) {
- items.push(this.getComponentStackItem());
- }
-
+ if (_prefs.features.componentPane && extra && extra.react) {
items.push(this.getComponentItem());
}
@@ -338,7 +319,7 @@ class SecondaryPanes extends _react.Component {
items.push(this.getWatchItem());
- if (extra && extra.react) {
+ if (_prefs.features.componentPane && extra && extra.react) {
items.push(this.getComponentItem());
}
diff --git a/devtools/client/debugger/new/src/components/SecondaryPanes/moz.build b/devtools/client/debugger/new/src/components/SecondaryPanes/moz.build
index 49d4991446d9..c19daafbe0ee 100644
--- a/devtools/client/debugger/new/src/components/SecondaryPanes/moz.build
+++ b/devtools/client/debugger/new/src/components/SecondaryPanes/moz.build
@@ -14,7 +14,6 @@ DevToolsModules(
'Expressions.js',
'FrameworkComponent.js',
'index.js',
- 'ReactComponentStack.js',
'Scopes.js',
'UtilsBar.js',
'Workers.js',
diff --git a/devtools/client/debugger/new/src/components/shared/Accordion.js b/devtools/client/debugger/new/src/components/shared/Accordion.js
index 76c1ba620290..e584366d4904 100644
--- a/devtools/client/debugger/new/src/components/shared/Accordion.js
+++ b/devtools/client/debugger/new/src/components/shared/Accordion.js
@@ -32,6 +32,7 @@ class Accordion extends _react.Component {
}, _react2.default.createElement("h2", {
className: "_header",
tabIndex: "0",
+ onKeyDown: e => this.onHandleHeaderKeyDown(e, i),
onClick: () => this.handleHeaderClick(i)
}, _react2.default.createElement(_Svg2.default, {
name: "arrow",
@@ -64,6 +65,12 @@ class Accordion extends _react.Component {
this.forceUpdate();
}
+ onHandleHeaderKeyDown(e, i) {
+ if (e && (e.key === " " || e.key === "Enter")) {
+ this.handleHeaderClick(i);
+ }
+ }
+
render() {
return _react2.default.createElement("ul", {
role: "list",
diff --git a/devtools/client/debugger/new/src/utils/editor/source-documents.js b/devtools/client/debugger/new/src/utils/editor/source-documents.js
index 0610b5042b47..76e4e3ab9ccd 100644
--- a/devtools/client/debugger/new/src/utils/editor/source-documents.js
+++ b/devtools/client/debugger/new/src/utils/editor/source-documents.js
@@ -160,7 +160,7 @@ function showSourceText(editor, source, symbols) {
const mode = (0, _source.getMode)(source, symbols);
const currentMode = editor.codeMirror.getOption("mode");
- if (currentMode.name !== mode.name) {
+ if (currentMode.name != mode.name) {
editor.setMode(mode);
}
diff --git a/devtools/client/debugger/new/src/utils/indentation.js b/devtools/client/debugger/new/src/utils/indentation.js
index 72a43fe9ebe3..ec197c5b86dc 100644
--- a/devtools/client/debugger/new/src/utils/indentation.js
+++ b/devtools/client/debugger/new/src/utils/indentation.js
@@ -14,7 +14,13 @@ function getIndentation(line) {
return 0;
}
- return line.match(/^\s*/)[0].length;
+ const lineMatch = line.match(/^\s*/);
+
+ if (!lineMatch) {
+ return 0;
+ }
+
+ return lineMatch[0].length;
}
function getMaxIndentation(lines) {
diff --git a/devtools/client/debugger/new/src/utils/pause/mapScopes/findGeneratedBindingFromPosition.js b/devtools/client/debugger/new/src/utils/pause/mapScopes/findGeneratedBindingFromPosition.js
index 2302fece8c5a..420b5cb8b145 100644
--- a/devtools/client/debugger/new/src/utils/pause/mapScopes/findGeneratedBindingFromPosition.js
+++ b/devtools/client/debugger/new/src/utils/pause/mapScopes/findGeneratedBindingFromPosition.js
@@ -196,7 +196,12 @@ async function mapImportReferenceToDescriptor({
// ^^^ // binding
// vs
//
- // Object(foo.bar)() // Webpack
+ // __webpack_require__.i(foo.bar)() // Webpack 2
+ // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // mapping
+ // ^^^ // binding
+ // vs
+ //
+ // Object(foo.bar)() // Webpack >= 3
// ^^^^^^^^^^^^^^^ // mapping
// ^^^ // binding
//
@@ -211,6 +216,13 @@ async function mapImportReferenceToDescriptor({
if (!(0, _mappingContains.mappingContains)(range, binding.loc)) {
return null;
+ } // Webpack 2's import declarations wrap calls with an identity fn, so we
+ // need to make sure to skip that binding because it is mapped to the
+ // location of the original binding usage.
+
+
+ if (binding.name === "__webpack_require__" && binding.loc.meta && binding.loc.meta.type === "member" && binding.loc.meta.property === "i") {
+ return null;
}
let expression = binding.name;
diff --git a/devtools/client/debugger/new/src/utils/pause/pausePoints.js b/devtools/client/debugger/new/src/utils/pause/pausePoints.js
index 80b1c8359650..3d57c03f59a6 100644
--- a/devtools/client/debugger/new/src/utils/pause/pausePoints.js
+++ b/devtools/client/debugger/new/src/utils/pause/pausePoints.js
@@ -48,10 +48,8 @@ function formatPausePoints(text, pausePoints) {
break: breakPoint,
step
} = node.types;
- const num = nodes.length - index;
const types = `${breakPoint ? "b" : ""}${step ? "s" : ""}`;
- const spacer = breakPoint || step ? " " : "";
- lines[line - 1] = insertStrtAt(lines[line - 1], column, `/*${types}${spacer}${num}*/`);
+ lines[line - 1] = insertStrtAt(lines[line - 1], column, `/*${types}*/`);
});
return lines.join("\n");
}
\ No newline at end of file
diff --git a/devtools/client/debugger/new/src/utils/prefs.js b/devtools/client/debugger/new/src/utils/prefs.js
index 6e191834dad7..2cb90cb18d13 100644
--- a/devtools/client/debugger/new/src/utils/prefs.js
+++ b/devtools/client/debugger/new/src/utils/prefs.js
@@ -29,7 +29,6 @@ if (isDevelopment()) {
pref("devtools.debugger.call-stack-visible", true);
pref("devtools.debugger.scopes-visible", true);
pref("devtools.debugger.component-visible", true);
- pref("devtools.debugger.component-stack-visible", false);
pref("devtools.debugger.workers-visible", true);
pref("devtools.debugger.expressions-visible", true);
pref("devtools.debugger.breakpoints-visible", true);
@@ -62,9 +61,8 @@ if (isDevelopment()) {
pref("devtools.debugger.features.column-breakpoints", true);
pref("devtools.debugger.features.replay", true);
pref("devtools.debugger.features.pause-points", true);
- pref("devtools.debugger.features.skip-pausing", false);
- pref("devtools.debugger.features.component-pane", false);
pref("devtools.debugger.features.skip-pausing", true);
+ pref("devtools.debugger.features.component-pane", false);
pref("devtools.debugger.features.autocomplete-expressions", false);
pref("devtools.debugger.features.map-expression-bindings", true);
}
@@ -79,7 +77,6 @@ const prefs = exports.prefs = new PrefsHelper("devtools", {
callStackVisible: ["Bool", "debugger.call-stack-visible"],
scopesVisible: ["Bool", "debugger.scopes-visible"],
componentVisible: ["Bool", "debugger.component-visible"],
- componentStackVisible: ["Bool", "debugger.component-stack-visible"],
workersVisible: ["Bool", "debugger.workers-visible"],
breakpointsVisible: ["Bool", "debugger.breakpoints-visible"],
expressionsVisible: ["Bool", "debugger.expressions-visible"],
@@ -115,7 +112,8 @@ const features = exports.features = new PrefsHelper("devtools.debugger.features"
pausePoints: ["Bool", "pause-points"],
skipPausing: ["Bool", "skip-pausing"],
autocompleteExpression: ["Bool", "autocomplete-expressions"],
- mapExpressionBindings: ["Bool", "map-expression-bindings"]
+ mapExpressionBindings: ["Bool", "map-expression-bindings"],
+ componentPane: ["Bool", "component-pane"]
});
if (prefs.debuggerPrefsSchemaVersion !== prefsSchemaVersion) {
diff --git a/devtools/client/preferences/debugger.js b/devtools/client/preferences/debugger.js
index 74f86f7e65cd..5e211b4866e7 100644
--- a/devtools/client/preferences/debugger.js
+++ b/devtools/client/preferences/debugger.js
@@ -29,7 +29,6 @@ pref("devtools.debugger.ui.variables-only-enum-visible", false);
pref("devtools.debugger.ui.variables-searchbox-visible", false);
pref("devtools.debugger.ui.framework-grouping-on", true);
pref("devtools.debugger.call-stack-visible", true);
-pref("devtools.debugger.component-stack-visible", true);
pref("devtools.debugger.scopes-visible", true);
pref("devtools.debugger.component-visible", true);
pref("devtools.debugger.workers-visible", true);
@@ -62,7 +61,7 @@ pref("devtools.debugger.features.code-folding", false);
pref("devtools.debugger.features.outline", true);
pref("devtools.debugger.features.replay", false);
pref("devtools.debugger.features.pause-points", true);
-pref("devtools.debugger.features.component-stack", false);
+pref("devtools.debugger.features.component-pane", false);
pref("devtools.debugger.features.async-stepping", true);
pref("devtools.debugger.features.skip-pausing", true);
pref("devtools.debugger.features.autocomplete-expressions", false);
diff --git a/devtools/client/shared/components/tabs/Tabs.js b/devtools/client/shared/components/tabs/Tabs.js
index 5b11db2f9b9c..3c581c3c4ad3 100644
--- a/devtools/client/shared/components/tabs/Tabs.js
+++ b/devtools/client/shared/components/tabs/Tabs.js
@@ -325,7 +325,7 @@ define(function(require, exports, module) {
// Display the menu only if there is not enough horizontal
// space for all tabs (and overflow happened).
const allTabsMenu = this.state.overflow ? (
- dom.div({
+ dom.button({
className: "all-tabs-menu",
onClick: this.props.onAllTabsMenuClick,
})
diff --git a/devtools/client/themes/common.css b/devtools/client/themes/common.css
index ee605267dac6..a193d96c2463 100644
--- a/devtools/client/themes/common.css
+++ b/devtools/client/themes/common.css
@@ -755,12 +755,24 @@ checkbox:-moz-focusring {
width: 15px;
height: 100%;
+ padding: 0;
+ border: none;
border-inline-start: 1px solid var(--theme-splitter-color);
background: var(--theme-tab-toolbar-background);
background-image: url("chrome://devtools/skin/images/dropmarker.svg");
background-repeat: no-repeat;
background-position: center;
+ -moz-context-properties: fill;
+ fill: var(--theme-toolbar-photon-icon-color);
+}
+
+.all-tabs-menu:hover {
+ background-color: var(--theme-toolbar-hover);
+}
+
+.all-tabs-menu:hover:active {
+ background-color: var(--theme-toolbar-hover-active);
}
.devtools-tab-line {
@@ -770,7 +782,7 @@ checkbox:-moz-focusring {
width: 100%;
height: 2px;
background: transparent;
- transition: transform 250ms var(--animation-easing-function), opacity 250ms var(--animation-easing-function);
+ transition: transform 250ms var(--animation-curve), opacity 250ms var(--animation-curve);
opacity: 0;
transform: scaleX(0);
}
diff --git a/devtools/client/themes/images/dropmarker.svg b/devtools/client/themes/images/dropmarker.svg
index 7592790c4f65..0cd5ad25db05 100644
--- a/devtools/client/themes/images/dropmarker.svg
+++ b/devtools/client/themes/images/dropmarker.svg
@@ -1,6 +1,6 @@
-
-
+
+
diff --git a/devtools/server/actors/animation.js b/devtools/server/actors/animation.js
index a7df4201c106..594cc7430689 100644
--- a/devtools/server/actors/animation.js
+++ b/devtools/server/actors/animation.js
@@ -930,13 +930,6 @@ exports.AnimationsActor = protocol.ActorClassWithSpec(animationsSpec, {
* @param {Object} player
*/
pauseSync(player) {
- // Gecko includes an optimization that means that if the animation is play-pending
- // and we set the startTime to null, the change will be ignored and the animation
- // will continue to be play-pending. This violates the spec but until the spec is
- // clarified[1] on this point we work around this by ensuring the animation's
- // startTime is set to something non-null before setting it to null.
- // [1] https://github.com/w3c/csswg-drafts/issues/2691
- this.playSync(player);
player.startTime = null;
},
diff --git a/devtools/server/actors/highlighters/flexbox.js b/devtools/server/actors/highlighters/flexbox.js
index 2850d82ea065..3bff3f8c52fd 100644
--- a/devtools/server/actors/highlighters/flexbox.js
+++ b/devtools/server/actors/highlighters/flexbox.js
@@ -45,7 +45,6 @@ const FLEXBOX_CONTAINER_PATTERN_HEIGHT = 14; // px
const FLEXBOX_JUSTIFY_CONTENT_PATTERN_WIDTH = 7; // px
const FLEXBOX_JUSTIFY_CONTENT_PATTERN_HEIGHT = 7; // px
const FLEXBOX_CONTAINER_PATTERN_LINE_DISH = [5, 3]; // px
-const BASIS_FILL_COLOR = "rgb(109, 184, 255, 0.4)";
/**
* Cached used by `FlexboxHighlighter.getFlexContainerPattern`.
@@ -66,9 +65,6 @@ const JUSTIFY_CONTENT = "justify-content";
* - showAlignment(isShown)
* @param {Boolean} isShown
* Shows the alignment in the flexbox highlighter.
- * - showFlexBasis(isShown)
- * @param {Boolean} isShown
- * Shows the flex basis in the flexbox highlighter.
*/
class FlexboxHighlighter extends AutoRefreshHighlighter {
constructor(highlighterEnv) {
@@ -296,10 +292,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
this.alignItemsValue = this.computedStyle.alignItems;
const newAlignItems = this.alignItemsValue;
- const oldFlexBasis = this.flexBasis;
- this.flexBasis = this.computedStyle.flexBasis;
- const newFlexBasis = this.flexBasis;
-
const oldFlexDirection = this.flexDirection;
this.flexDirection = this.computedStyle.flexDirection;
const newFlexDirection = this.flexDirection;
@@ -315,7 +307,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
return hasMoved ||
hasFlexDataChanged ||
oldAlignItems !== newAlignItems ||
- oldFlexBasis !== newFlexBasis ||
oldFlexDirection !== newFlexDirection ||
oldFlexWrap !== newFlexWrap ||
oldJustifyContent !== newJustifyContent;
@@ -324,7 +315,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
_hide() {
this.alignItemsValue = null;
this.computedStyle = null;
- this.flexBasis = null;
this.flexData = null;
this.flexDirection = null;
this.flexWrap = null;
@@ -542,28 +532,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
this.ctx.restore();
}
- /**
- * Renders the flex basis for a given flex item.
- */
- renderFlexItemBasis(flexItem, left, top, right, bottom, boundsWidth) {
- if (!this.options.showFlexBasis || !this.computedStyle) {
- return;
- }
-
- let basis = this.flexBasis;
-
- if (basis.endsWith("px")) {
- right = Math.round(left + parseFloat(basis));
- } else if (basis.endsWith("%")) {
- basis = parseFloat(basis) / 100 * boundsWidth;
- right = Math.round(left + basis);
- }
-
- this.ctx.fillStyle = BASIS_FILL_COLOR;
- drawRect(this.ctx, left, top, right, bottom, this.currentMatrix);
- this.ctx.fill();
- }
-
renderFlexItems() {
if (!this.flexData || !this.currentQuads.content || !this.currentQuads.content[0]) {
return;
@@ -600,8 +568,6 @@ class FlexboxHighlighter extends AutoRefreshHighlighter {
clearRect(this.ctx, left, top, right, bottom, this.currentMatrix);
drawRect(this.ctx, left, top, right, bottom, this.currentMatrix);
this.ctx.stroke();
-
- this.renderFlexItemBasis(flexItem.node, left, top, right, bottom, bounds.width);
}
}
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index c77eca4fb77c..d5a532dfca55 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -677,6 +677,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
nsCOMPtr referrer;
nsCOMPtr originalURI;
Maybe> resultPrincipalURI;
+ bool keepResultPrincipalURIIfSet = false;
bool loadReplace = false;
nsCOMPtr postStream;
nsCOMPtr headersStream;
@@ -708,6 +709,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
referrer = aLoadInfo->Referrer();
originalURI = aLoadInfo->OriginalURI();
aLoadInfo->GetMaybeResultPrincipalURI(resultPrincipalURI);
+ keepResultPrincipalURIIfSet = aLoadInfo->KeepResultPrincipalURIIfSet();
loadReplace = aLoadInfo->LoadReplace();
// Get the appropriate loadType from nsIDocShellLoadInfo type
loadType = aLoadInfo->LoadType();
@@ -1001,6 +1003,7 @@ nsDocShell::LoadURI(nsIURI* aURI,
return InternalLoad(aURI,
originalURI,
resultPrincipalURI,
+ keepResultPrincipalURIIfSet,
loadReplace,
referrer,
referrerPolicy,
@@ -4798,7 +4801,7 @@ nsDocShell::LoadErrorPage(nsIURI* aURI, const char16_t* aURL,
nsresult rv = NS_NewURI(getter_AddRefs(errorPageURI), errorPageUrl);
NS_ENSURE_SUCCESS(rv, rv);
- return InternalLoad(errorPageURI, nullptr, Nothing(), false, nullptr, RP_Unset,
+ return InternalLoad(errorPageURI, nullptr, Nothing(), false, false, nullptr, RP_Unset,
nsContentUtils::GetSystemPrincipal(), nullptr,
INTERNAL_LOAD_FLAGS_NONE, EmptyString(),
nullptr, VoidString(), nullptr, nullptr,
@@ -4893,6 +4896,7 @@ nsDocShell::Reload(uint32_t aReloadFlags)
rv = InternalLoad(currentURI,
originalURI,
emplacedResultPrincipalURI,
+ false,
loadReplace,
referrerURI,
referrerPolicy,
@@ -6184,6 +6188,11 @@ nsDocShell::ForceRefreshURI(nsIURI* aURI, nsIPrincipal* aPrincipal, int32_t aDel
*/
loadInfo->SetReferrer(mCurrentURI);
+ loadInfo->SetOriginalURI(mCurrentURI);
+ loadInfo->SetResultPrincipalURI(aURI);
+ loadInfo->SetResultPrincipalURIIsSome(true);
+ loadInfo->SetKeepResultPrincipalURIIfSet(true);
+
// Set the triggering pricipal to aPrincipal if available, or current
// document's principal otherwise.
nsCOMPtr principal = aPrincipal;
@@ -9003,6 +9012,7 @@ public:
nsIURI* aURI,
nsIURI* aOriginalURI,
Maybe> const& aResultPrincipalURI,
+ bool aKeepResultPrincipalURIIfSet,
bool aLoadReplace,
nsIURI* aReferrer, uint32_t aReferrerPolicy,
nsIPrincipal* aTriggeringPrincipal,
@@ -9023,6 +9033,7 @@ public:
, mURI(aURI)
, mOriginalURI(aOriginalURI)
, mResultPrincipalURI(aResultPrincipalURI)
+ , mKeepResultPrincipalURIIfSet(aKeepResultPrincipalURIIfSet)
, mLoadReplace(aLoadReplace)
, mReferrer(aReferrer)
, mReferrerPolicy(aReferrerPolicy)
@@ -9049,6 +9060,7 @@ public:
Run() override
{
return mDocShell->InternalLoad(mURI, mOriginalURI, mResultPrincipalURI,
+ mKeepResultPrincipalURIIfSet,
mLoadReplace,
mReferrer,
mReferrerPolicy,
@@ -9071,6 +9083,7 @@ private:
nsCOMPtr mURI;
nsCOMPtr mOriginalURI;
Maybe> mResultPrincipalURI;
+ bool mKeepResultPrincipalURIIfSet;
bool mLoadReplace;
nsCOMPtr mReferrer;
uint32_t mReferrerPolicy;
@@ -9117,6 +9130,7 @@ NS_IMETHODIMP
nsDocShell::InternalLoad(nsIURI* aURI,
nsIURI* aOriginalURI,
Maybe> const& aResultPrincipalURI,
+ bool aKeepResultPrincipalURIIfSet,
bool aLoadReplace,
nsIURI* aReferrer,
uint32_t aReferrerPolicy,
@@ -9415,6 +9429,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER));
loadInfo->SetOriginalURI(aOriginalURI);
loadInfo->SetMaybeResultPrincipalURI(aResultPrincipalURI);
+ loadInfo->SetKeepResultPrincipalURIIfSet(aKeepResultPrincipalURIIfSet);
loadInfo->SetLoadReplace(aLoadReplace);
loadInfo->SetTriggeringPrincipal(aTriggeringPrincipal);
loadInfo->SetInheritPrincipal(
@@ -9464,6 +9479,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
rv = targetDocShell->InternalLoad(aURI,
aOriginalURI,
aResultPrincipalURI,
+ aKeepResultPrincipalURIIfSet,
aLoadReplace,
aReferrer,
aReferrerPolicy,
@@ -9562,6 +9578,7 @@ nsDocShell::InternalLoad(nsIURI* aURI,
// Do this asynchronously
nsCOMPtr ev =
new InternalLoadEvent(this, aURI, aOriginalURI, aResultPrincipalURI,
+ aKeepResultPrincipalURIIfSet,
aLoadReplace, aReferrer, aReferrerPolicy,
aTriggeringPrincipal, principalToInherit,
aFlags, aTypeHint, aPostData,
@@ -10079,7 +10096,8 @@ nsDocShell::InternalLoad(nsIURI* aURI,
nsINetworkPredictor::PREDICT_LOAD, attrs, nullptr);
nsCOMPtr req;
- rv = DoURILoad(aURI, aOriginalURI, aResultPrincipalURI, aLoadReplace,
+ rv = DoURILoad(aURI, aOriginalURI, aResultPrincipalURI,
+ aKeepResultPrincipalURIIfSet, aLoadReplace,
loadFromExternal,
(aFlags & INTERNAL_LOAD_FLAGS_FORCE_ALLOW_DATA_URI),
(aFlags & INTERNAL_LOAD_FLAGS_ORIGINAL_FRAME_SRC),
@@ -10219,6 +10237,7 @@ nsresult
nsDocShell::DoURILoad(nsIURI* aURI,
nsIURI* aOriginalURI,
Maybe> const& aResultPrincipalURI,
+ bool aKeepResultPrincipalURIIfSet,
bool aLoadReplace,
bool aLoadFromExternal,
bool aForceAllowDataURI,
@@ -10568,7 +10587,10 @@ nsDocShell::DoURILoad(nsIURI* aURI,
channel->SetOriginalURI(aURI);
}
- if (aResultPrincipalURI) {
+ nsCOMPtr rpURI;
+ loadInfo->GetResultPrincipalURI(getter_AddRefs(rpURI));
+ if (aResultPrincipalURI &&
+ (!aKeepResultPrincipalURIIfSet || !rpURI)) {
// Unconditionally override, we want the replay to be equal to what has
// been captured.
loadInfo->SetResultPrincipalURI(aResultPrincipalURI.ref());
@@ -12145,6 +12167,7 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
rv = InternalLoad(uri,
originalURI,
emplacedResultPrincipalURI,
+ false,
loadReplace,
referrerURI,
referrerPolicy,
@@ -13424,6 +13447,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
nsresult rv = InternalLoad(aURI, // New URI
nullptr, // Original URI
Nothing(), // Let the protocol handler assign it
+ false,
false, // LoadReplace
referer, // Referer URI
refererPolicy, // Referer policy
diff --git a/docshell/base/nsDocShell.h b/docshell/base/nsDocShell.h
index 8147e8c0747f..89f3f28b89a5 100644
--- a/docshell/base/nsDocShell.h
+++ b/docshell/base/nsDocShell.h
@@ -520,6 +520,7 @@ private: // member functions
nsresult DoURILoad(nsIURI* aURI,
nsIURI* aOriginalURI,
mozilla::Maybe> const& aResultPrincipalURI,
+ bool aKeepResultPrincipalURIIfSet,
bool aLoadReplace,
bool aLoadFromExternal,
bool aForceAllowDataURI,
diff --git a/docshell/base/nsDocShellLoadInfo.cpp b/docshell/base/nsDocShellLoadInfo.cpp
index 256e9e108d35..d3ba6e659805 100644
--- a/docshell/base/nsDocShellLoadInfo.cpp
+++ b/docshell/base/nsDocShellLoadInfo.cpp
@@ -20,6 +20,7 @@ namespace mozilla {
nsDocShellLoadInfo::nsDocShellLoadInfo()
: mResultPrincipalURIIsSome(false)
+ , mKeepResultPrincipalURIIfSet(false)
, mLoadReplace(false)
, mInheritPrincipal(false)
, mPrincipalIsExplicit(false)
@@ -84,6 +85,18 @@ nsDocShellLoadInfo::SetResultPrincipalURIIsSome(bool aIsSome)
mResultPrincipalURIIsSome = aIsSome;
}
+bool
+nsDocShellLoadInfo::KeepResultPrincipalURIIfSet() const
+{
+ return mKeepResultPrincipalURIIfSet;
+}
+
+void
+nsDocShellLoadInfo::SetKeepResultPrincipalURIIfSet(bool aKeep)
+{
+ mKeepResultPrincipalURIIfSet = aKeep;
+}
+
bool
nsDocShellLoadInfo::LoadReplace() const
{
diff --git a/docshell/base/nsDocShellLoadInfo.h b/docshell/base/nsDocShellLoadInfo.h
index 720b4aba5c40..caeda5c79970 100644
--- a/docshell/base/nsDocShellLoadInfo.h
+++ b/docshell/base/nsDocShellLoadInfo.h
@@ -45,6 +45,10 @@ public:
void SetResultPrincipalURIIsSome(bool aIsSome);
+ bool KeepResultPrincipalURIIfSet() const;
+
+ void SetKeepResultPrincipalURIIfSet(bool aKeep);
+
bool LoadReplace() const;
void SetLoadReplace(bool aLoadReplace);
@@ -140,6 +144,10 @@ protected:
// will be identical.
nsCOMPtr mTriggeringPrincipal;
+ // if http-equiv="refresh" cause reload we do not want to replace
+ // ResultPrinicpalURI if it was already set.
+ bool mKeepResultPrincipalURIIfSet;
+
// loadReplace flag to be passed to nsIDocShell.internalLoad.
bool mLoadReplace;
diff --git a/docshell/base/nsIDocShell.idl b/docshell/base/nsIDocShell.idl
index 9eb646943a6b..c2a52c582417 100644
--- a/docshell/base/nsIDocShell.idl
+++ b/docshell/base/nsIDocShell.idl
@@ -132,6 +132,13 @@ interface nsIDocShell : nsIDocShellTreeItem
* When Nothing, there will be no change
* When Some, the principal URI will overwrite even
* with a null value.
+ * @param aKeepResultPrincipalURIIfSet - If a refresh is caused by
+ * http-equiv="refresh" we want to set
+ * aResultPrincipalURI, but we do not want
+ * to overwrite the channel's
+ * ResultPrincipalURI, if it has already
+ * been set on the channel by a protocol
+ * handler.
* @param aLoadReplace - If set LOAD_REPLACE flag will be set on the
* channel. aOriginalURI is null, this argument is
* ignored.
@@ -180,6 +187,7 @@ interface nsIDocShell : nsIDocShellTreeItem
[noscript]void internalLoad(in nsIURI aURI,
in nsIURI aOriginalURI,
[const] in MaybeURI aResultPrincipalURI,
+ in bool aKeepResultPrincipalURIIfSet,
in boolean aLoadReplace,
in nsIURI aReferrer,
in unsigned long aReferrerPolicy,
diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp
index eebcb491180a..0eb87ff6b1f4 100644
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -227,7 +227,11 @@ Animation::SetTimelineNoUpdate(AnimationTimeline* aTimeline)
void
Animation::SetStartTime(const Nullable& aNewStartTime)
{
- if (aNewStartTime == mStartTime) {
+ // Return early if the start time will not change. However, if we
+ // are pending, then setting the start time to any value
+ // including the current value has the effect of aborting
+ // pending tasks so we should not return early in that case.
+ if (!Pending() && aNewStartTime == mStartTime) {
return;
}
diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp
index 8580bf1ce14b..9abd6fdd09f9 100644
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -26,6 +26,7 @@
#include "nsTextNode.h"
#include "mozAutoDocUpdate.h"
#include "nsWrapperCacheInlines.h"
+#include "NodeUbiReporting.h"
namespace mozilla {
namespace dom {
@@ -308,5 +309,11 @@ Attr::WrapNode(JSContext* aCx, JS::Handle aGivenProto)
return Attr_Binding::Wrap(aCx, this, aGivenProto);
}
+void
+Attr::ConstructUbiNode(void* storage)
+{
+ JS::ubi::Concrete::construct(storage, this);
+}
+
} // namespace dom
} // namespace mozilla
diff --git a/dom/base/Attr.h b/dom/base/Attr.h
index b7c146233a1e..93ede4c9585e 100644
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -51,6 +51,8 @@ public:
void GetEventTargetParent(EventChainPreVisitor& aVisitor) override;
+ void ConstructUbiNode(void* storage) override;
+
nsDOMAttributeMap* GetMap()
{
return mAttrMap;
diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp
index 448627d9b481..ee6fbc775afb 100644
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -125,6 +125,8 @@
#include "nsChildContentList.h"
#include "mozilla/BloomFilter.h"
+#include "NodeUbiReporting.h"
+
using namespace mozilla;
using namespace mozilla::dom;
@@ -445,6 +447,12 @@ nsIContent::GetURLDataForStyleAttr(nsIPrincipal* aSubjectPrincipal) const
return do_AddRef(OwnerDoc()->DefaultStyleAttrURLData());
}
+void
+nsIContent::ConstructUbiNode(void* storage)
+{
+ JS::ubi::Concrete::construct(storage, this);
+}
+
//----------------------------------------------------------------------
static inline JSObject*
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index 81aad13c0228..314d0326f7af 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -30,6 +30,7 @@
#include "nsContentUtils.h"
#include "nsUnicharUtils.h"
#include "mozilla/Preferences.h"
+#include "mozilla/StaticPrefs.h"
#include "mozilla/Telemetry.h"
#include "BatteryManager.h"
#include "mozilla/dom/CredentialsContainer.h"
@@ -519,9 +520,8 @@ Navigator::Storage()
bool
Navigator::CookieEnabled()
{
- bool cookieEnabled =
- (Preferences::GetInt("network.cookie.cookieBehavior",
- COOKIE_BEHAVIOR_REJECT) != COOKIE_BEHAVIOR_REJECT);
+ bool cookieEnabled = (StaticPrefs::network_cookie_cookieBehavior() !=
+ COOKIE_BEHAVIOR_REJECT);
// Check whether an exception overrides the global cookie behavior
// Note that the code for getting the URI here matches that in
diff --git a/dom/base/NodeUbiReporting.cpp b/dom/base/NodeUbiReporting.cpp
new file mode 100644
index 000000000000..662afbbc04e2
--- /dev/null
+++ b/dom/base/NodeUbiReporting.cpp
@@ -0,0 +1,75 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "NodeUbiReporting.h"
+#include "js/UbiNodeUtils.h"
+#include "nsWindowSizes.h"
+
+using JS::ubi::SimpleEdgeRange;
+using JS::ubi::EdgeRange;
+
+const char16_t JS::ubi::Concrete::concreteTypeName[] = u"nsIDocument";
+const char16_t JS::ubi::Concrete::concreteTypeName[] = u"nsIContent";
+const char16_t JS::ubi::Concrete::concreteTypeName[] = u"Attr";
+
+void
+JS::ubi::Concrete::construct(void* storage, nsINode* ptr)
+{
+ // nsINode is abstract, and all of its inherited instances have
+ // an overridden function with instructions to construct ubi::Nodes.
+ // We actually want to call that function and construct from those instances.
+ ptr->ConstructUbiNode(storage);
+}
+
+js::UniquePtr
+JS::ubi::Concrete::edges(JSContext* cx, bool wantNames) const
+{
+ AutoSuppressGCAnalysis suppress;
+ auto range = js::MakeUnique();
+ if (!range) {
+ return nullptr;
+ }
+ if (get().GetParent()) {
+ char16_t* edgeName = nullptr;
+ if (wantNames) {
+ edgeName = NS_strdup(u"Parent Node");
+ }
+ if (!range->addEdge(JS::ubi::Edge(edgeName, get().GetParent()))) {
+ return nullptr;
+ }
+ }
+ for (auto curr = get().GetFirstChild(); curr; curr = curr->GetNextSibling()) {
+ char16_t* edgeName = nullptr;
+ if (wantNames) {
+ edgeName = NS_strdup(u"Child Node");
+ }
+ if (!range->addEdge(JS::ubi::Edge(edgeName, curr))) {
+ return nullptr;
+ }
+ }
+ return range;
+}
+
+JS::ubi::Node::Size
+JS::ubi::Concrete::size(mozilla::MallocSizeOf mallocSizeOf) const
+{
+ AutoSuppressGCAnalysis suppress;
+ mozilla::SizeOfState sz(mallocSizeOf);
+ nsWindowSizes wn(sz);
+ size_t n = 0;
+ get().AddSizeOfIncludingThis(wn, &n);
+ return n;
+}
+
+JS::ubi::Node::Size
+JS::ubi::Concrete::size(mozilla::MallocSizeOf mallocSizeOf) const
+{
+ AutoSuppressGCAnalysis suppress;
+ mozilla::SizeOfState sz(mallocSizeOf);
+ nsWindowSizes wn(sz);
+ getDoc().DocAddSizeOfIncludingThis(wn);
+ return wn.getTotalSize();
+}
diff --git a/dom/base/NodeUbiReporting.h b/dom/base/NodeUbiReporting.h
new file mode 100644
index 000000000000..e825187a70bd
--- /dev/null
+++ b/dom/base/NodeUbiReporting.h
@@ -0,0 +1,84 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * 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/. */
+
+#ifndef dom_NodeUbiReporting_h
+#define dom_NodeUbiReporting_h
+
+#include "nsINode.h"
+#include "js/UbiNode.h"
+
+/*
+ * This file defines specializations of JS::ubi::Concrete for DOM nodes
+ * so that the JS memory tools, which operate on the UbiNode graph, can
+ * define subclasses of JS::ubi::Base that represent DOM nodes and
+ * yield the outgoing edges in a DOM node graph for reporting.
+*/
+
+using mozilla::dom::Attr;
+
+namespace JS {
+namespace ubi {
+
+// The DOM node base class.
+// This is an abstract class and therefore does not require a concreteTypeName.
+template<>
+class Concrete : public Base
+{
+protected:
+ explicit Concrete(nsINode *ptr) : Base(ptr) { }
+
+public:
+ static void construct(void *storage, nsINode *ptr);
+ Size size(mozilla::MallocSizeOf mallocSizeOf) const override;
+ js::UniquePtr edges(JSContext* cx, bool wantNames) const override;
+
+ nsINode& get() const { return *static_cast(ptr); }
+ CoarseType coarseType() const final { return CoarseType::Other; }
+};
+
+template<>
+class Concrete : public Concrete
+{
+protected:
+ explicit Concrete(nsIContent *ptr) : Concrete(ptr) { }
+
+public:
+ static void construct(void *storage, nsIContent *ptr) { new (storage) Concrete(ptr); }
+ const char16_t* typeName() const override { return concreteTypeName; };
+ static const char16_t concreteTypeName[];
+};
+
+template<>
+class Concrete : public Concrete
+{
+protected:
+ explicit Concrete(nsIDocument *ptr) : Concrete(ptr) { }
+
+public:
+ static void construct(void *storage, nsIDocument *ptr) { new (storage) Concrete(ptr); }
+ Size size(mozilla::MallocSizeOf mallocSizeOf) const override;
+
+ nsIDocument& getDoc() const { return *static_cast(ptr); }
+ const char16_t* typeName() const override { return concreteTypeName; };
+ static const char16_t concreteTypeName[];
+};
+
+template<>
+class Concrete : public Concrete
+{
+protected:
+ explicit Concrete(Attr *ptr) : Concrete(ptr) { }
+
+public:
+ static void construct(void *storage, Attr *ptr) { new (storage) Concrete(ptr); }
+ const char16_t* typeName() const override { return concreteTypeName; };
+ static const char16_t concreteTypeName[];
+};
+
+} //namespace ubi
+} //namespace JS
+
+#endif
diff --git a/dom/base/ScreenLuminance.h b/dom/base/ScreenLuminance.h
index 4ece9ee42340..220dc49dfec9 100644
--- a/dom/base/ScreenLuminance.h
+++ b/dom/base/ScreenLuminance.h
@@ -9,6 +9,7 @@
#include "nsCycleCollectionParticipant.h"
#include "nsISupportsImpl.h"
+#include "nsWrapperCache.h"
class nsScreen;
diff --git a/dom/base/moz.build b/dom/base/moz.build
index 0dbf2e65e6da..aadffb390984 100644
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -38,6 +38,7 @@ EXPORTS += [
'HTMLSplitOnSpacesTokenizer.h',
'IframeSandboxKeywordList.h',
'mozAutoDocUpdate.h',
+ 'NodeUbiReporting.h',
'nsAttrAndChildArray.h',
'nsAttrName.h',
'nsAttrValue.h',
@@ -287,6 +288,7 @@ UNIFIED_SOURCES += [
'Navigator.cpp',
'NodeInfo.cpp',
'NodeIterator.cpp',
+ 'NodeUbiReporting.cpp',
'nsAttrAndChildArray.cpp',
'nsAttrValue.cpp',
'nsAttrValueOrString.cpp',
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 9213bcd22520..4a211ea9c806 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -326,7 +326,6 @@ nsContentUtils::sUserInteractionObserver = nullptr;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
uint32_t nsContentUtils::sCookiesLifetimePolicy = nsICookieService::ACCEPT_NORMALLY;
-uint32_t nsContentUtils::sCookiesBehavior = nsICookieService::BEHAVIOR_ACCEPT;
nsHtml5StringParser* nsContentUtils::sHTMLFragmentParser = nullptr;
nsIParser* nsContentUtils::sXMLFragmentParser = nullptr;
@@ -689,10 +688,6 @@ nsContentUtils::Init()
"network.cookie.lifetimePolicy",
nsICookieService::ACCEPT_NORMALLY);
- Preferences::AddUintVarCache(&sCookiesBehavior,
- "network.cookie.cookieBehavior",
- nsICookieService::BEHAVIOR_ACCEPT);
-
Preferences::AddBoolVarCache(&sDoNotTrackEnabled,
"privacy.donottrackheader.enabled", false);
@@ -8783,7 +8778,7 @@ nsContentUtils::GetCookieBehaviorForPrincipal(nsIPrincipal* aPrincipal,
uint32_t* aBehavior)
{
*aLifetimePolicy = sCookiesLifetimePolicy;
- *aBehavior = sCookiesBehavior;
+ *aBehavior = StaticPrefs::network_cookie_cookieBehavior();
// Any permissions set for the given principal will override our default
// settings from preferences.
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index 9984e13e5ff9..b514adbe0a43 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -3426,7 +3426,6 @@ private:
static bool sIsBytecodeCacheEnabled;
static int32_t sBytecodeCacheStrategy;
static uint32_t sCookiesLifetimePolicy;
- static uint32_t sCookiesBehavior;
static bool sShortcutsCustomized;
static int32_t sPrivacyMaxInnerWidth;
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index be7b7ae3fdee..c439810d8fa8 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -275,6 +275,7 @@
#include "mozilla/RestyleManager.h"
#include "mozilla/ClearOnShutdown.h"
#include "nsHTMLTags.h"
+#include "NodeUbiReporting.h"
using namespace mozilla;
using namespace mozilla::dom;
@@ -1576,6 +1577,13 @@ nsIDocument::IsAboutPage() const
return isAboutScheme;
}
+void
+nsIDocument::ConstructUbiNode(void* storage)
+{
+ JS::ubi::Concrete::construct(storage, this);
+}
+
+
nsDocument::~nsDocument()
{
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug, ("DOCUMENT %p destroyed", this));
diff --git a/dom/base/nsIContent.h b/dom/base/nsIContent.h
index 66dfb58db555..8e5cbba7861c 100644
--- a/dom/base/nsIContent.h
+++ b/dom/base/nsIContent.h
@@ -55,6 +55,8 @@ class nsIContent : public nsINode {
public:
typedef mozilla::widget::IMEState IMEState;
+ void ConstructUbiNode(void* storage) override;
+
#ifdef MOZILLA_INTERNAL_API
// If you're using the external API, the only thing you can know about
// nsIContent is that it exists with an IID
diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h
index 35572a79ac24..280902462734 100644
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3042,6 +3042,8 @@ public:
// declaration of nsINode::SizeOfIncludingThis.
virtual void DocAddSizeOfIncludingThis(nsWindowSizes& aWindowSizes) const;
+ void ConstructUbiNode(void* storage) override;
+
bool MayHaveDOMMutationObservers()
{
return mMayHaveDOMMutationObservers;
diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h
index 9e0d5dcc94fa..2c191e7a0409 100644
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -455,6 +455,12 @@ public:
virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override;
+ /**
+ * Hook for constructing JS::ubi::Concrete specializations for memory reporting.
+ * Specializations are defined in NodeUbiReporting.h.
+ */
+ virtual void ConstructUbiNode(void* storage) = 0;
+
/**
* returns true if we are in priviliged code or
* layout.css.getBoxQuads.enabled == true.
diff --git a/dom/fetch/FetchUtil.cpp b/dom/fetch/FetchUtil.cpp
index d0d6555d02a3..9620c8ffdd14 100644
--- a/dom/fetch/FetchUtil.cpp
+++ b/dom/fetch/FetchUtil.cpp
@@ -601,7 +601,7 @@ FetchUtil::StreamResponseToJS(JSContext* aCx,
return ThrowException(aCx, JSMSG_ERROR_CONSUMING_RESPONSE);
}
- nsIGlobalObject* global = xpc::NativeGlobal(aObj);
+ nsIGlobalObject* global = xpc::NativeGlobal(js::UncheckedUnwrap(aObj));
if (!JSStreamConsumer::Start(body, aConsumer, global, aMaybeWorker)) {
return ThrowException(aCx, JSMSG_OUT_OF_MEMORY);
diff --git a/dom/html/nsBrowserElement.cpp b/dom/html/nsBrowserElement.cpp
index d5e1ea4f2303..ba616a70102a 100644
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -19,6 +19,8 @@
#include "nsINode.h"
#include "nsIPrincipal.h"
+#include "js/Wrapper.h"
+
using namespace mozilla::dom;
namespace mozilla {
@@ -184,6 +186,7 @@ nsBrowserElement::Download(const nsAString& aUrl,
RefPtr req;
nsCOMPtr wrappedObj = do_QueryInterface(mBrowserElementAPI);
MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component.");
+ MOZ_RELEASE_ASSERT(!js::IsWrapper(wrappedObj->GetJSObject()));
AutoJSAPI jsapi;
if (!jsapi.Init(wrappedObj->GetJSObject())) {
aRv.Throw(NS_ERROR_UNEXPECTED);
@@ -403,6 +406,7 @@ nsBrowserElement::ExecuteScript(const nsAString& aScript,
RefPtr req;
nsCOMPtr wrappedObj = do_QueryInterface(mBrowserElementAPI);
MOZ_ASSERT(wrappedObj, "Failed to get wrapped JS from XPCOM component.");
+ MOZ_RELEASE_ASSERT(!js::IsWrapper(wrappedObj->GetJSObject()));
AutoJSAPI jsapi;
if (!jsapi.Init(wrappedObj->GetJSObject())) {
aRv.Throw(NS_ERROR_UNEXPECTED);
diff --git a/dom/script/ScriptSettings.cpp b/dom/script/ScriptSettings.cpp
index b1af45b31b5b..5169b911f027 100644
--- a/dom/script/ScriptSettings.cpp
+++ b/dom/script/ScriptSettings.cpp
@@ -490,6 +490,7 @@ AutoJSAPI::Init(nsIGlobalObject* aGlobalObject)
bool
AutoJSAPI::Init(JSObject* aObject)
{
+ MOZ_ASSERT(!js::IsCrossCompartmentWrapper(aObject));
return Init(xpc::NativeGlobal(aObject));
}
diff --git a/dom/script/ScriptSettings.h b/dom/script/ScriptSettings.h
index 830ccb1aba01..cce5607c3771 100644
--- a/dom/script/ScriptSettings.h
+++ b/dom/script/ScriptSettings.h
@@ -228,7 +228,8 @@ public:
MOZ_MUST_USE bool Init(nsIGlobalObject* aGlobalObject);
// This is a helper that grabs the native global associated with aObject and
- // invokes the above Init() with that.
+ // invokes the above Init() with that. aObject must not be a cross-compartment
+ // wrapper: CCWs are not associated with a single global.
MOZ_MUST_USE bool Init(JSObject* aObject);
// Unsurprisingly, this uses aCx and enters the compartment of aGlobalObject.
diff --git a/dom/serviceworkers/ServiceWorkerScriptCache.cpp b/dom/serviceworkers/ServiceWorkerScriptCache.cpp
index 9a2691123416..5ceab0351ee1 100644
--- a/dom/serviceworkers/ServiceWorkerScriptCache.cpp
+++ b/dom/serviceworkers/ServiceWorkerScriptCache.cpp
@@ -41,26 +41,21 @@ namespace serviceWorkerScriptCache {
namespace {
-// XXX A sandbox nsIGlobalObject does not preserve its reflector, so |aSandbox|
-// must be kept alive as long as the CacheStorage if you want to ensure that
-// the CacheStorage will continue to work. Failures will manifest as errors
-// like "JavaScript error: , line 0: TypeError: The expression cannot be
-// converted to return the specified type."
already_AddRefed
-CreateCacheStorage(JSContext* aCx, nsIPrincipal* aPrincipal, ErrorResult& aRv,
- JS::MutableHandle aSandbox)
+CreateCacheStorage(JSContext* aCx, nsIPrincipal* aPrincipal, ErrorResult& aRv)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aPrincipal);
nsIXPConnect* xpc = nsContentUtils::XPConnect();
MOZ_ASSERT(xpc, "This should never be null!");
- aRv = xpc->CreateSandbox(aCx, aPrincipal, aSandbox.address());
+ JS::Rooted sandbox(aCx);
+ aRv = xpc->CreateSandbox(aCx, aPrincipal, sandbox.address());
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
- nsCOMPtr sandboxGlobalObject = xpc::NativeGlobal(aSandbox);
+ nsCOMPtr sandboxGlobalObject = xpc::NativeGlobal(sandbox);
if (!sandboxGlobalObject) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
@@ -666,7 +661,6 @@ private:
RefPtr mRegistration;
RefPtr mCallback;
- JS::PersistentRooted mSandbox;
RefPtr mCacheStorage;
nsTArray> mCNList;
@@ -1286,8 +1280,7 @@ CompareManager::Initialize(nsIPrincipal* aPrincipal,
AutoJSAPI jsapi;
jsapi.Init();
ErrorResult result;
- mSandbox.init(jsapi.cx());
- mCacheStorage = CreateCacheStorage(jsapi.cx(), aPrincipal, result, &mSandbox);
+ mCacheStorage = CreateCacheStorage(jsapi.cx(), aPrincipal, result);
if (NS_WARN_IF(result.Failed())) {
MOZ_ASSERT(!result.IsErrorWithMessage());
return result.StealNSResult();
@@ -1429,8 +1422,7 @@ PurgeCache(nsIPrincipal* aPrincipal, const nsAString& aCacheName)
AutoJSAPI jsapi;
jsapi.Init();
ErrorResult rv;
- JS::Rooted sandboxObject(jsapi.cx());
- RefPtr cacheStorage = CreateCacheStorage(jsapi.cx(), aPrincipal, rv, &sandboxObject);
+ RefPtr cacheStorage = CreateCacheStorage(jsapi.cx(), aPrincipal, rv);
if (NS_WARN_IF(rv.Failed())) {
return rv.StealNSResult();
}
diff --git a/dom/serviceworkers/test/test_serviceworker_interfaces.js b/dom/serviceworkers/test/test_serviceworker_interfaces.js
index 7cbae92359e6..7109b9493257 100644
--- a/dom/serviceworkers/test/test_serviceworker_interfaces.js
+++ b/dom/serviceworkers/test/test_serviceworker_interfaces.js
@@ -57,7 +57,6 @@ var ecmaGlobals =
"RegExp",
"Set",
{name: "SharedArrayBuffer", disabled: true},
- {name: "SIMD", nightly: true},
"String",
"Symbol",
"SyntaxError",
diff --git a/dom/svg/SVGAnimationElement.cpp b/dom/svg/SVGAnimationElement.cpp
index 9a70e2077c70..b863f62f95ee 100644
--- a/dom/svg/SVGAnimationElement.cpp
+++ b/dom/svg/SVGAnimationElement.cpp
@@ -282,6 +282,10 @@ SVGAnimationElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
}
}
+ if (!IsInComposedDoc()) {
+ return rv;
+ }
+
if (!((aNamespaceID == kNameSpaceID_None ||
aNamespaceID == kNameSpaceID_XLink) &&
aName == nsGkAtoms::href)) {
@@ -305,8 +309,7 @@ SVGAnimationElement::AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
AnimationTargetChanged();
} // else: we unset xlink:href, but we still have href attribute, so keep
// mHrefTarget linking to href.
- } else if (IsInComposedDoc() &&
- !(aNamespaceID == kNameSpaceID_XLink &&
+ } else if (!(aNamespaceID == kNameSpaceID_XLink &&
HasAttr(kNameSpaceID_None, nsGkAtoms::href))) {
// Note: "href" takes priority over xlink:href. So if "xlink:href" is being
// set here, we only let that update our target if "href" is *unset*.
diff --git a/dom/tests/mochitest/general/test_interfaces.js b/dom/tests/mochitest/general/test_interfaces.js
index 07d7282e4c69..cb1cf69f581d 100644
--- a/dom/tests/mochitest/general/test_interfaces.js
+++ b/dom/tests/mochitest/general/test_interfaces.js
@@ -78,7 +78,6 @@ var ecmaGlobals =
{name: "RegExp", insecureContext: true},
{name: "Set", insecureContext: true},
{name: "SharedArrayBuffer", insecureContext: true, disabled: true},
- {name: "SIMD", insecureContext: true, nightly: true},
{name: "String", insecureContext: true},
{name: "Symbol", insecureContext: true},
{name: "SyntaxError", insecureContext: true},
diff --git a/dom/workers/test/test_worker_interfaces.js b/dom/workers/test/test_worker_interfaces.js
index 45b3767a5e51..20d5ef0f743b 100644
--- a/dom/workers/test/test_worker_interfaces.js
+++ b/dom/workers/test/test_worker_interfaces.js
@@ -63,7 +63,6 @@ var ecmaGlobals =
{name: "RegExp", insecureContext: true},
{name: "Set", insecureContext: true},
{name: "SharedArrayBuffer", insecureContext: true, disabled: true},
- {name: "SIMD", insecureContext: true, nightly: true},
{name: "String", insecureContext: true},
{name: "Symbol", insecureContext: true},
{name: "SyntaxError", insecureContext: true},
diff --git a/dom/xbl/nsXBLBinding.cpp b/dom/xbl/nsXBLBinding.cpp
index 15bf49c361d4..33afd260f565 100644
--- a/dom/xbl/nsXBLBinding.cpp
+++ b/dom/xbl/nsXBLBinding.cpp
@@ -892,7 +892,8 @@ GetOrCreateMapEntryForPrototype(JSContext *cx, JS::Handle proto)
// Now, enter the XBL scope, since that's where we need to operate, and wrap
// the proto accordingly. We hang the map off of the content XBL scope for
// content, and the Window for chrome (whether add-ons are involved or not).
- JS::Rooted scope(cx, xpc::GetXBLScopeOrGlobal(cx, proto));
+ JS::Rooted scope(cx,
+ xpc::GetXBLScopeOrGlobal(cx, JS::CurrentGlobalOrNull(cx)));
NS_ENSURE_TRUE(scope, nullptr);
MOZ_ASSERT(JS_IsGlobalObject(scope));
@@ -958,7 +959,10 @@ nsXBLBinding::DoInitJSClass(JSContext *cx,
// and defining it as a property on the XBL scope's global. This works fine,
// but we need to make sure never to assume that the the reflector and
// prototype are same-compartment with the bound document.
- JS::Rooted global(cx, js::GetGlobalForObjectCrossCompartment(obj));
+ JS::Rooted global(cx, JS::GetNonCCWObjectGlobal(obj));
+
+ // We must be in obj's realm.
+ MOZ_ASSERT(JS::CurrentGlobalOrNull(cx) == global);
// We never store class objects in add-on scopes.
JS::Rooted xblScope(cx, xpc::GetXBLScopeOrGlobal(cx, global));
@@ -1115,7 +1119,7 @@ nsXBLBinding::LookupMember(JSContext* aCx, JS::Handle aId,
// This code is only called for content XBL, so we don't have to worry about
// add-on scopes here.
JS::Rooted boundScope(aCx,
- js::GetGlobalForObjectCrossCompartment(mBoundElement->GetWrapper()));
+ JS::GetNonCCWObjectGlobal(mBoundElement->GetWrapper()));
MOZ_RELEASE_ASSERT(!xpc::IsInContentXBLScope(boundScope));
JS::Rooted xblScope(aCx, xpc::GetXBLScope(aCx, boundScope));
NS_ENSURE_TRUE(xblScope, false);
diff --git a/dom/xbl/nsXBLProtoImpl.cpp b/dom/xbl/nsXBLProtoImpl.cpp
index 5fdddef750f1..ec30b9a6b12e 100644
--- a/dom/xbl/nsXBLProtoImpl.cpp
+++ b/dom/xbl/nsXBLProtoImpl.cpp
@@ -22,7 +22,6 @@
using namespace mozilla;
using namespace mozilla::dom;
-using js::GetGlobalForObjectCrossCompartment;
using js::AssertSameCompartment;
nsresult
@@ -82,7 +81,7 @@ nsXBLProtoImpl::InstallImplementation(nsXBLPrototypeBinding* aPrototypeBinding,
// First, start by entering the realm of the XBL scope. This may or may
// not be the same realm as globalObject.
JS::Rooted globalObject(cx,
- GetGlobalForObjectCrossCompartment(targetClassObject));
+ JS::GetNonCCWObjectGlobal(targetClassObject));
JS::Rooted scopeObject(cx, xpc::GetXBLScopeOrGlobal(cx, globalObject));
NS_ENSURE_TRUE(scopeObject, NS_ERROR_OUT_OF_MEMORY);
MOZ_ASSERT(JS_IsGlobalObject(scopeObject));
@@ -218,6 +217,10 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
JS::Rooted value(cx, &v.toObject());
JSAutoRealm ar2(cx, value);
+ // We passed aAllowWrapping = false to nsContentUtils::WrapNative so we
+ // should not have a wrapper.
+ MOZ_ASSERT(!js::IsWrapper(value));
+
// All of the above code was just obtaining the bound element's script object and its immediate
// concrete base class. We need to alter the object so that our concrete class is interposed
// between the object and its base class. We become the new base class of the object, and the
diff --git a/gfx/qcms/fuzztest/qcms_fuzzer.dict b/gfx/qcms/fuzztest/qcms_fuzzer.dict
new file mode 100644
index 000000000000..213193c7d181
--- /dev/null
+++ b/gfx/qcms/fuzztest/qcms_fuzzer.dict
@@ -0,0 +1,26 @@
+# v2
+0x41324230="A2B0"
+0x42324130="B2A0"
+0x47524159="GRAY"
+0x4C616220="Lab "
+0x52474220="RGB "
+0x58595a20="XYZ "
+0x62545243="bTRC"
+0x6258595a="bXYZ"
+0x63686164="chad"
+0x63757276="curv"
+0x67545243="gTRC"
+0x6758595a="gXYZ"
+0x6D667431="mft1"
+0x6D667432="mft2"
+0x6b545243="kTRC"
+0x6d6e7472="mntr"
+0x72545243="rTRC"
+0x7258595a="rXYZ"
+0x73636e72="scnr"
+0x73663332="sf32"
+
+# v4
+0x6D414220="mAB "
+0x6D424120="mBA "
+0x70617261="para"
diff --git a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
index 25a3f38cc6f0..f392211105a8 100644
--- a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
+++ b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
@@ -305,18 +305,14 @@ SkScalerContext_DW::SkScalerContext_DW(sk_sp typefaceRef,
fTextSizeMeasure = realTextSize;
fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
- IDWriteFactory* factory = sk_get_dwrite_factory();
- if (factory != nullptr) {
- HRVM(factory->CreateRenderingParams(&fDefaultRenderingParams),
- "Could not create default rendering params");
- }
-
+ IDWriteRenderingParams* params = sk_get_dwrite_default_rendering_params();
DWriteFontTypeface* typeface = static_cast(getTypeface());
- if (!SUCCEEDED(typeface->fDWriteFontFace->GetRecommendedRenderingMode(
+ if (params &&
+ !SUCCEEDED(typeface->fDWriteFontFace->GetRecommendedRenderingMode(
fTextSizeRender,
1.0f,
fMeasuringMode,
- fDefaultRenderingParams.get(),
+ params,
&fRenderingMode))) {
fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
}
diff --git a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
index 03384203397a..6d098558841b 100644
--- a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
+++ b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.h
@@ -70,7 +70,6 @@ private:
DWRITE_MEASURING_MODE fMeasuringMode;
DWRITE_TEXT_ANTIALIAS_MODE fAntiAliasMode;
DWRITE_GRID_FIT_MODE fGridFitMode;
- SkTScopedComPtr fDefaultRenderingParams;
bool fIsColorFont;
};
diff --git a/gfx/skia/skia/src/utils/win/SkDWrite.cpp b/gfx/skia/skia/src/utils/win/SkDWrite.cpp
index c7438bf332e0..8395b3b02691 100644
--- a/gfx/skia/skia/src/utils/win/SkDWrite.cpp
+++ b/gfx/skia/skia/src/utils/win/SkDWrite.cpp
@@ -49,6 +49,30 @@ IDWriteFactory* sk_get_dwrite_factory() {
return gDWriteFactory;
}
+static IDWriteRenderingParams* gDWriteRenderingParams = nullptr;
+
+static void release_dwrite_rendering_params() {
+ if (gDWriteRenderingParams) {
+ gDWriteRenderingParams->Release();
+ }
+}
+
+static void create_dwrite_rendering_params(IDWriteRenderingParams** params) {
+ IDWriteFactory* factory = sk_get_dwrite_factory();
+ if (!factory) {
+ return;
+ }
+ HRVM(factory->CreateRenderingParams(params),
+ "Could not create DWrite default rendering params");
+ atexit(release_dwrite_rendering_params);
+}
+
+IDWriteRenderingParams* sk_get_dwrite_default_rendering_params() {
+ static SkOnce once;
+ once(create_dwrite_rendering_params, &gDWriteRenderingParams);
+ return gDWriteRenderingParams;
+}
+
////////////////////////////////////////////////////////////////////////////////
// String conversion
diff --git a/gfx/skia/skia/src/utils/win/SkDWrite.h b/gfx/skia/skia/src/utils/win/SkDWrite.h
index de2293df9731..fe34ebbee9f6 100644
--- a/gfx/skia/skia/src/utils/win/SkDWrite.h
+++ b/gfx/skia/skia/src/utils/win/SkDWrite.h
@@ -20,6 +20,7 @@ class SkString;
// Factory
IDWriteFactory* sk_get_dwrite_factory();
+IDWriteRenderingParams* sk_get_dwrite_default_rendering_params();
////////////////////////////////////////////////////////////////////////////////
// String conversion
diff --git a/gfx/src/moz.build b/gfx/src/moz.build
index 118a242ba188..b37b57caad44 100644
--- a/gfx/src/moz.build
+++ b/gfx/src/moz.build
@@ -35,7 +35,6 @@ EXPORTS += [
'nsRegion.h',
'nsRegionFwd.h',
'nsSize.h',
- 'nsThemeConstants.h',
'nsTransform2D.h',
'RegionBuilder.h',
'X11UndefineNone.h'
diff --git a/gfx/src/nsITheme.h b/gfx/src/nsITheme.h
index 1d08da631989..26724fe036e3 100644
--- a/gfx/src/nsITheme.h
+++ b/gfx/src/nsITheme.h
@@ -25,6 +25,7 @@ class nsIWidget;
namespace mozilla {
class ComputedStyle;
+enum class StyleAppearance : uint8_t;
namespace layers {
class StackingContextHelper;
class WebRenderLayerManager;
@@ -58,6 +59,7 @@ class IpcResourceUpdateQueue;
class nsITheme: public nsISupports {
protected:
using LayoutDeviceIntMargin = mozilla::LayoutDeviceIntMargin;
+ using WidgetType = mozilla::StyleAppearance;
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITHEME_IID)
@@ -72,7 +74,7 @@ public:
*/
NS_IMETHOD DrawWidgetBackground(gfxContext* aContext,
nsIFrame* aFrame,
- uint8_t aWidgetType,
+ WidgetType aWidgetType,
const nsRect& aRect,
const nsRect& aDirtyRect) = 0;
@@ -81,7 +83,7 @@ public:
* It's currently only used for scrollbar-*-color properties.
*/
virtual nscolor GetWidgetAutoColor(mozilla::ComputedStyle* aStyle,
- uint8_t aWidgetType)
+ WidgetType aWidgetType)
{ return NS_RGB(0, 0, 0); }
/**
@@ -95,7 +97,7 @@ public:
const mozilla::layers::StackingContextHelper& aSc,
mozilla::layers::WebRenderLayerManager* aManager,
nsIFrame* aFrame,
- uint8_t aWidgetType,
+ WidgetType aWidgetType,
const nsRect& aRect) { return false; }
/**
@@ -103,7 +105,7 @@ public:
*/
virtual MOZ_MUST_USE LayoutDeviceIntMargin GetWidgetBorder(nsDeviceContext* aContext,
nsIFrame* aFrame,
- uint8_t aWidgetType) = 0;
+ WidgetType aWidgetType) = 0;
/**
* This method can return false to indicate that the CSS padding
@@ -115,9 +117,9 @@ public:
* the computed padding and potentially the size.
*/
virtual bool GetWidgetPadding(nsDeviceContext* aContext,
- nsIFrame* aFrame,
- uint8_t aWidgetType,
- LayoutDeviceIntMargin* aResult) = 0;
+ nsIFrame* aFrame,
+ WidgetType aWidgetType,
+ LayoutDeviceIntMargin* aResult) = 0;
/**
* On entry, *aResult is positioned at 0,0 and sized to the new size
@@ -134,9 +136,9 @@ public:
* scrollable overflow.)
*/
virtual bool GetWidgetOverflow(nsDeviceContext* aContext,
- nsIFrame* aFrame,
- uint8_t aWidgetType,
- /*INOUT*/ nsRect* aOverflowRect)
+ nsIFrame* aFrame,
+ WidgetType aWidgetType,
+ /*INOUT*/ nsRect* aOverflowRect)
{ return false; }
/**
@@ -147,7 +149,7 @@ public:
*/
NS_IMETHOD GetMinimumWidgetSize(nsPresContext* aPresContext,
nsIFrame* aFrame,
- uint8_t aWidgetType,
+ WidgetType aWidgetType,
mozilla::LayoutDeviceIntSize* aResult,
bool* aIsOverridable)=0;
@@ -161,7 +163,7 @@ public:
/**
* Returns what we know about the transparency of the widget.
*/
- virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, uint8_t aWidgetType)
+ virtual Transparency GetWidgetTransparency(nsIFrame* aFrame, WidgetType aWidgetType)
{ return eUnknownTransparency; }
/**
@@ -169,17 +171,16 @@ public:
* change should trigger a repaint. Call with null |aAttribute| (and
* null |aOldValue|) for content state changes.
*/
- NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, uint8_t aWidgetType,
+ NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, WidgetType aWidgetType,
nsAtom* aAttribute, bool* aShouldRepaint,
const nsAttrValue* aOldValue)=0;
NS_IMETHOD ThemeChanged()=0;
- virtual bool WidgetAppearanceDependsOnWindowFocus(uint8_t aWidgetType)
+ virtual bool WidgetAppearanceDependsOnWindowFocus(WidgetType aWidgetType)
{ return false; }
- virtual bool NeedToClearBackgroundBehindWidget(nsIFrame* aFrame,
- uint8_t aWidgetType)
+ virtual bool NeedToClearBackgroundBehindWidget(nsIFrame* aFrame, WidgetType aWidgetType)
{ return false; }
/**
@@ -206,27 +207,27 @@ public:
* not be included in the ThemeGeometry array.
*/
virtual ThemeGeometryType ThemeGeometryTypeForWidget(nsIFrame* aFrame,
- uint8_t aWidgetType)
+ WidgetType aWidgetType)
{ return eThemeGeometryTypeUnknown; }
/**
* Can the nsITheme implementation handle this widget?
*/
virtual bool ThemeSupportsWidget(nsPresContext* aPresContext,
- nsIFrame* aFrame,
- uint8_t aWidgetType)=0;
+ nsIFrame* aFrame,
+ WidgetType aWidgetType) = 0;
- virtual bool WidgetIsContainer(uint8_t aWidgetType)=0;
+ virtual bool WidgetIsContainer(WidgetType aWidgetType) = 0;
/**
* Does the nsITheme implementation draw its own focus ring for this widget?
*/
- virtual bool ThemeDrawsFocusForWidget(uint8_t aWidgetType)=0;
+ virtual bool ThemeDrawsFocusForWidget(WidgetType aWidgetType) = 0;
/**
* Should we insert a dropmarker inside of combobox button?
*/
- virtual bool ThemeNeedsComboboxDropmarker()=0;
+ virtual bool ThemeNeedsComboboxDropmarker() = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
diff --git a/gfx/src/nsThemeConstants.h b/gfx/src/nsThemeConstants.h
deleted file mode 100644
index c5a93033dca0..000000000000
--- a/gfx/src/nsThemeConstants.h
+++ /dev/null
@@ -1,316 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsThemeConstants_h_
-#define nsThemeConstants_h_
-
-enum ThemeWidgetType : uint8_t {
-
- // No appearance at all.
- NS_THEME_NONE,
-
- // A typical dialog button.
- NS_THEME_BUTTON,
-
- // A radio element within a radio group.
- NS_THEME_RADIO,
-
- // A checkbox element.
- NS_THEME_CHECKBOX,
-
- // A rectangular button that contains complex content
- // like images (e.g. HTML