зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1454696 - Fix leftover issues for prefer-const;r=yulia
MozReview-Commit-ID: JwOXoqw2mks --HG-- extra : rebase_source : a3f07665a42c2779a85b7901a07206266a9d1616 extra : source : ae946f375e0d0f4f0f0fc859c54040fef42cbc2c
This commit is contained in:
Родитель
640fe52298
Коммит
7fdc2c153f
|
@ -133,7 +133,8 @@ class WorkersPanel extends Component {
|
||||||
const isServiceWorkerDisabled = !Services.prefs
|
const isServiceWorkerDisabled = !Services.prefs
|
||||||
.getBoolPref("dom.serviceWorkers.enabled");
|
.getBoolPref("dom.serviceWorkers.enabled");
|
||||||
|
|
||||||
const isDisabled = isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
|
const isDisabled =
|
||||||
|
isWindowPrivate || isPrivateBrowsingMode || isServiceWorkerDisabled;
|
||||||
if (!isDisabled) {
|
if (!isDisabled) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,8 @@ add_task(async function testTemporaryWebExtension() {
|
||||||
isWebExtension: true
|
isWebExtension: true
|
||||||
});
|
});
|
||||||
|
|
||||||
const addons = document.querySelectorAll("#temporary-extensions .addon-target-container");
|
const addons =
|
||||||
|
document.querySelectorAll("#temporary-extensions .addon-target-container");
|
||||||
// Assuming that our temporary add-on is now at the top.
|
// Assuming that our temporary add-on is now at the top.
|
||||||
const container = addons[addons.length - 1];
|
const container = addons[addons.length - 1];
|
||||||
const addonId = container.dataset.addonId;
|
const addonId = container.dataset.addonId;
|
||||||
|
|
|
@ -66,7 +66,8 @@ window.Application = {
|
||||||
*/
|
*/
|
||||||
async createMessageContexts() {
|
async createMessageContexts() {
|
||||||
const locales = Services.locale.getAppLocalesAsBCP47();
|
const locales = Services.locale.getAppLocalesAsBCP47();
|
||||||
const generator = L10nRegistry.generateContexts(locales, ["devtools/application.ftl"]);
|
const generator =
|
||||||
|
L10nRegistry.generateContexts(locales, ["devtools/application.ftl"]);
|
||||||
|
|
||||||
// Return value of generateContexts is a generator and should be converted to
|
// Return value of generateContexts is a generator and should be converted to
|
||||||
// a sync iterable before using it with React.
|
// a sync iterable before using it with React.
|
||||||
|
|
|
@ -32,7 +32,8 @@ async function testEditing(inspector, boxmodel, testActor) {
|
||||||
|
|
||||||
await selectNode("#div1", inspector);
|
await selectNode("#div1", inspector);
|
||||||
|
|
||||||
const span = boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
|
const span =
|
||||||
|
boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
|
||||||
is(span.textContent, 5, "Should have the right value in the box model.");
|
is(span.textContent, 5, "Should have the right value in the box model.");
|
||||||
|
|
||||||
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
|
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
|
||||||
|
|
|
@ -17,7 +17,8 @@ add_task(async function() {
|
||||||
await selectNode("p", inspector);
|
await selectNode("p", inspector);
|
||||||
|
|
||||||
info("Modify padding-bottom in box model view");
|
info("Modify padding-bottom in box model view");
|
||||||
const span = boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
|
const span =
|
||||||
|
boxmodel.document.querySelector(".boxmodel-padding.boxmodel-bottom > span");
|
||||||
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
|
EventUtils.synthesizeMouseAtCenter(span, {}, boxmodel.document.defaultView);
|
||||||
const editor = boxmodel.document.querySelector(".styleinspector-propertyeditor");
|
const editor = boxmodel.document.querySelector(".styleinspector-propertyeditor");
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,8 @@ class FontInspector {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const fonts = await this.pageStyle.getUsedFontFaces(node, options).catch(console.error);
|
const fonts =
|
||||||
|
await this.pageStyle.getUsedFontFaces(node, options).catch(console.error);
|
||||||
if (!fonts) {
|
if (!fonts) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1065,7 +1065,8 @@ Inspector.prototype = {
|
||||||
this.eyeDropperButton.title = INSPECTOR_L10N.getStr("inspector.eyedropper.label");
|
this.eyeDropperButton.title = INSPECTOR_L10N.getStr("inspector.eyedropper.label");
|
||||||
this.eyeDropperButton.addEventListener("click", this.onEyeDropperButtonClicked);
|
this.eyeDropperButton.addEventListener("click", this.onEyeDropperButtonClicked);
|
||||||
} else {
|
} else {
|
||||||
const eyeDropperButton = this.panelDoc.getElementById("inspector-eyedropper-toggle");
|
const eyeDropperButton =
|
||||||
|
this.panelDoc.getElementById("inspector-eyedropper-toggle");
|
||||||
eyeDropperButton.disabled = true;
|
eyeDropperButton.disabled = true;
|
||||||
eyeDropperButton.title = INSPECTOR_L10N.getStr("eyedropper.disabled.title");
|
eyeDropperButton.title = INSPECTOR_L10N.getStr("eyedropper.disabled.title");
|
||||||
}
|
}
|
||||||
|
|
|
@ -648,7 +648,7 @@ MarkupView.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const done = this.inspector.updating("markup-view");
|
const done = this.inspector.updating("markup-view");
|
||||||
let onShowBoxModel, onShow;
|
let onShowBoxModel;
|
||||||
|
|
||||||
// Highlight the element briefly if needed.
|
// Highlight the element briefly if needed.
|
||||||
if (this._shouldNewSelectionBeHighlighted()) {
|
if (this._shouldNewSelectionBeHighlighted()) {
|
||||||
|
@ -656,7 +656,7 @@ MarkupView.prototype = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const slotted = selection.isSlotted();
|
const slotted = selection.isSlotted();
|
||||||
onShow = this.showNode(selection.nodeFront, { slotted }).then(() => {
|
const onShow = this.showNode(selection.nodeFront, { slotted }).then(() => {
|
||||||
// We could be destroyed by now.
|
// We could be destroyed by now.
|
||||||
if (this._destroyer) {
|
if (this._destroyer) {
|
||||||
return promise.reject("markupview destroyed");
|
return promise.reject("markupview destroyed");
|
||||||
|
|
|
@ -84,8 +84,8 @@ const TEST_DATA = [
|
||||||
];
|
];
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const {inspector, testActor} = await openInspectorForURL("data:text/html;charset=utf-8," +
|
const {inspector, testActor} = await openInspectorForURL(
|
||||||
encodeURIComponent(TEST_URI));
|
"data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
|
||||||
|
|
||||||
for (const data of TEST_DATA) {
|
for (const data of TEST_DATA) {
|
||||||
info("Running test case: " + data.desc);
|
info("Running test case: " + data.desc);
|
||||||
|
|
|
@ -115,7 +115,9 @@ async function testCompletion([key, completion, open, selected],
|
||||||
|
|
||||||
// Also listening for popup opened/closed events if needed.
|
// Also listening for popup opened/closed events if needed.
|
||||||
const popupEvent = open ? "popup-opened" : "popup-closed";
|
const popupEvent = open ? "popup-opened" : "popup-closed";
|
||||||
const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
|
const onPopupEvent = editor.popup.isOpen !== open
|
||||||
|
? once(editor.popup, popupEvent)
|
||||||
|
: null;
|
||||||
|
|
||||||
info("Synthesizing key " + key);
|
info("Synthesizing key " + key);
|
||||||
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
||||||
|
|
|
@ -95,7 +95,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
|
||||||
|
|
||||||
// Also listening for popup opened/closed events if needed.
|
// Also listening for popup opened/closed events if needed.
|
||||||
const popupEvent = open ? "popup-opened" : "popup-closed";
|
const popupEvent = open ? "popup-opened" : "popup-closed";
|
||||||
const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
|
const onPopupEvent = editor.popup.isOpen !== open
|
||||||
|
? once(editor.popup, popupEvent)
|
||||||
|
: null;
|
||||||
|
|
||||||
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,9 @@ async function testCompletion([key, completion, open, isSelected], editor, view)
|
||||||
|
|
||||||
// Also listening for popup opened/closed events if needed.
|
// Also listening for popup opened/closed events if needed.
|
||||||
const popupEvent = open ? "popup-opened" : "popup-closed";
|
const popupEvent = open ? "popup-opened" : "popup-closed";
|
||||||
const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
|
const onPopupEvent = editor.popup.isOpen !== open
|
||||||
|
? once(editor.popup, popupEvent)
|
||||||
|
: null;
|
||||||
|
|
||||||
info("Synthesizing key " + key);
|
info("Synthesizing key " + key);
|
||||||
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
EventUtils.synthesizeKey(key, {}, view.styleWindow);
|
||||||
|
|
|
@ -102,7 +102,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
|
||||||
|
|
||||||
// Also listening for popup opened/closed events if needed.
|
// Also listening for popup opened/closed events if needed.
|
||||||
const popupEvent = open ? "popup-opened" : "popup-closed";
|
const popupEvent = open ? "popup-opened" : "popup-closed";
|
||||||
const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
|
const onPopupEvent = editor.popup.isOpen !== open
|
||||||
|
? once(editor.popup, popupEvent)
|
||||||
|
: null;
|
||||||
|
|
||||||
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
|
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
|
||||||
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
EventUtils.synthesizeKey(key, modifiers, view.styleWindow);
|
||||||
|
|
|
@ -25,7 +25,8 @@ add_task(async function() {
|
||||||
await selectNode("#testid", inspector);
|
await selectNode("#testid", inspector);
|
||||||
const ruleEditor = getRuleViewRuleEditor(view, 1);
|
const ruleEditor = getRuleViewRuleEditor(view, 1);
|
||||||
const propEditor = ruleEditor.rule.textProps[0].editor;
|
const propEditor = ruleEditor.rule.textProps[0].editor;
|
||||||
const anchor = propEditor.valueSpan.querySelector(".ruleview-propertyvalue .theme-link");
|
const anchor =
|
||||||
|
propEditor.valueSpan.querySelector(".ruleview-propertyvalue .theme-link");
|
||||||
|
|
||||||
info("Focus the background name span");
|
info("Focus the background name span");
|
||||||
await focusEditableField(view, propEditor.nameSpan);
|
await focusEditableField(view, propEditor.nameSpan);
|
||||||
|
|
|
@ -140,7 +140,9 @@ async function testCompletion([key, modifiers, completion, open, selected, chang
|
||||||
|
|
||||||
// Also listening for popup opened/closed events if needed.
|
// Also listening for popup opened/closed events if needed.
|
||||||
const popupEvent = open ? "popup-opened" : "popup-closed";
|
const popupEvent = open ? "popup-opened" : "popup-closed";
|
||||||
const onPopupEvent = editor.popup.isOpen !== open ? once(editor.popup, popupEvent) : null;
|
const onPopupEvent = editor.popup.isOpen !== open
|
||||||
|
? once(editor.popup, popupEvent)
|
||||||
|
: null;
|
||||||
|
|
||||||
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
|
info("Synthesizing key " + key + ", modifiers: " + Object.keys(modifiers));
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,8 @@ add_task(async function() {
|
||||||
const shapeToggle = container.querySelector(".ruleview-shapeswatch");
|
const shapeToggle = container.querySelector(".ruleview-shapeswatch");
|
||||||
const shapeToggleStyle = getComputedStyle(shapeToggle);
|
const shapeToggleStyle = getComputedStyle(shapeToggle);
|
||||||
const overriddenContainer = getRuleViewProperty(view, "div", "clip-path").valueSpan;
|
const overriddenContainer = getRuleViewProperty(view, "div", "clip-path").valueSpan;
|
||||||
const overriddenShapeToggle = overriddenContainer.querySelector(".ruleview-shapeswatch");
|
const overriddenShapeToggle =
|
||||||
|
overriddenContainer.querySelector(".ruleview-shapeswatch");
|
||||||
const overriddenShapeToggleStyle = getComputedStyle(overriddenShapeToggle);
|
const overriddenShapeToggleStyle = getComputedStyle(overriddenShapeToggle);
|
||||||
|
|
||||||
ok(shapeToggle && overriddenShapeToggle,
|
ok(shapeToggle && overriddenShapeToggle,
|
||||||
|
|
|
@ -73,9 +73,10 @@ ClassListPreviewerModel.prototype = {
|
||||||
if (!CLASSES.has(this.currentNode)) {
|
if (!CLASSES.has(this.currentNode)) {
|
||||||
// Use the proxy node to get a clean list of classes.
|
// Use the proxy node to get a clean list of classes.
|
||||||
this.classListProxyNode.className = this.currentNode.className;
|
this.classListProxyNode.className = this.currentNode.className;
|
||||||
const nodeClasses = [...new Set([...this.classListProxyNode.classList])].map(name => {
|
const nodeClasses = [...new Set([...this.classListProxyNode.classList])]
|
||||||
return { name, isApplied: true };
|
.map(name => {
|
||||||
});
|
return { name, isApplied: true };
|
||||||
|
});
|
||||||
|
|
||||||
CLASSES.set(this.currentNode, nodeClasses);
|
CLASSES.set(this.currentNode, nodeClasses);
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,8 @@ async function testZoomSize(testActor, helper) {
|
||||||
await helper.show("#polygon", {mode: "cssClipPath"});
|
await helper.show("#polygon", {mode: "cssClipPath"});
|
||||||
const quads = await testActor.getAllAdjustedQuads("#polygon");
|
const quads = await testActor.getAllAdjustedQuads("#polygon");
|
||||||
const { top, left, width, height } = quads.border[0].bounds;
|
const { top, left, width, height } = quads.border[0].bounds;
|
||||||
const expectedStyle = `top:${top}px;left:${left}px;width:${width}px;height:${height}px;`;
|
const expectedStyle =
|
||||||
|
`top:${top}px;left:${left}px;width:${width}px;height:${height}px;`;
|
||||||
|
|
||||||
// The top/left/width/height of the highlighter should not change at any zoom level.
|
// The top/left/width/height of the highlighter should not change at any zoom level.
|
||||||
// It should always match the element being highlighted.
|
// It should always match the element being highlighted.
|
||||||
|
|
|
@ -9,8 +9,9 @@ const HIGHLIGHTER_TYPE = "EyeDropper";
|
||||||
const ID = "eye-dropper-";
|
const ID = "eye-dropper-";
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const helper = await openInspectorForURL("data:text/html;charset=utf-8,eye-dropper test")
|
const helper =
|
||||||
.then(getHighlighterHelperFor(HIGHLIGHTER_TYPE));
|
await openInspectorForURL("data:text/html;charset=utf-8,eye-dropper test")
|
||||||
|
.then(getHighlighterHelperFor(HIGHLIGHTER_TYPE));
|
||||||
helper.prefix = ID;
|
helper.prefix = ID;
|
||||||
|
|
||||||
await isInitiallyHidden(helper);
|
await isInitiallyHidden(helper);
|
||||||
|
|
|
@ -47,7 +47,7 @@ async function isUpdatedAfterScroll(highlighterFront, inspector, testActor) {
|
||||||
|
|
||||||
info("Ask the content window to scroll to specific coords");
|
info("Ask the content window to scroll to specific coords");
|
||||||
|
|
||||||
let x = 200, y = 300;
|
const x = 200, y = 300;
|
||||||
|
|
||||||
let data = await testActor.scrollWindow(x, y);
|
let data = await testActor.scrollWindow(x, y);
|
||||||
|
|
||||||
|
|
|
@ -50,6 +50,7 @@ add_task(async function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function getElementsNodeStyle(testActor) {
|
async function getElementsNodeStyle(testActor) {
|
||||||
const value = await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
|
const value =
|
||||||
|
await testActor.getHighlighterNodeAttribute("box-model-elements", "style");
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,16 @@ add_task(async function() {
|
||||||
info("Test expand/collapse JSON started");
|
info("Test expand/collapse JSON started");
|
||||||
|
|
||||||
await addJsonViewTab(TEST_JSON_URL);
|
await addJsonViewTab(TEST_JSON_URL);
|
||||||
let browser = gBrowser.selectedBrowser, selector, countAfter, countBefore, json;
|
const browser = gBrowser.selectedBrowser;
|
||||||
|
|
||||||
/* Initial sanity check */
|
/* Initial sanity check */
|
||||||
countBefore = await getElementCount(".treeRow");
|
const countBefore = await getElementCount(".treeRow");
|
||||||
ok(countBefore == 6, "There must be six rows");
|
ok(countBefore == 6, "There must be six rows");
|
||||||
|
|
||||||
/* Test the "Collapse All" button */
|
/* Test the "Collapse All" button */
|
||||||
selector = ".jsonPanelBox .toolbar button.collapse";
|
let selector = ".jsonPanelBox .toolbar button.collapse";
|
||||||
await BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
|
await BrowserTestUtils.synthesizeMouseAtCenter(selector, {}, browser);
|
||||||
countAfter = await getElementCount(".treeRow");
|
let countAfter = await getElementCount(".treeRow");
|
||||||
ok(countAfter == 3, "There must be three rows");
|
ok(countAfter == 3, "There must be three rows");
|
||||||
|
|
||||||
/* Test the "Expand All" button */
|
/* Test the "Expand All" button */
|
||||||
|
@ -31,7 +31,7 @@ add_task(async function() {
|
||||||
ok(countAfter == 6, "There must be six expanded rows");
|
ok(countAfter == 6, "There must be six expanded rows");
|
||||||
|
|
||||||
/* Test big file handling */
|
/* Test big file handling */
|
||||||
json = JSON.stringify({data: Array(1e5).fill().map(x => "hoot"), status: "ok"});
|
const json = JSON.stringify({data: Array(1e5).fill().map(x => "hoot"), status: "ok"});
|
||||||
ok(json.length > EXPAND_THRESHOLD, "The generated JSON must be larger than 100kB");
|
ok(json.length > EXPAND_THRESHOLD, "The generated JSON must be larger than 100kB");
|
||||||
await addJsonViewTab("data:application/json," + json);
|
await addJsonViewTab("data:application/json," + json);
|
||||||
ok(document.querySelector(selector) == null, "The Expand All button must be gone");
|
ok(document.querySelector(selector) == null, "The Expand All button must be gone");
|
||||||
|
|
|
@ -27,7 +27,9 @@ const { getDisplayedRequests } = require("../selectors/index");
|
||||||
function openNetworkDetails(open) {
|
function openNetworkDetails(open) {
|
||||||
return (dispatch, getState) => {
|
return (dispatch, getState) => {
|
||||||
const visibleRequestItems = getDisplayedRequests(getState());
|
const visibleRequestItems = getDisplayedRequests(getState());
|
||||||
const defaultSelectedId = visibleRequestItems.length ? visibleRequestItems[0].id : null;
|
const defaultSelectedId = visibleRequestItems.length
|
||||||
|
? visibleRequestItems[0].id
|
||||||
|
: null;
|
||||||
|
|
||||||
return dispatch({
|
return dispatch({
|
||||||
type: OPEN_NETWORK_DETAILS,
|
type: OPEN_NETWORK_DETAILS,
|
||||||
|
|
|
@ -40,7 +40,9 @@ class RequestListColumnSetCookies extends Component {
|
||||||
render() {
|
render() {
|
||||||
let { responseCookies = { cookies: [] } } = this.props.item;
|
let { responseCookies = { cookies: [] } } = this.props.item;
|
||||||
responseCookies = responseCookies.cookies || responseCookies;
|
responseCookies = responseCookies.cookies || responseCookies;
|
||||||
const responseCookiesLength = responseCookies.length > 0 ? responseCookies.length : "";
|
const responseCookiesLength = responseCookies.length > 0
|
||||||
|
? responseCookies.length
|
||||||
|
: "";
|
||||||
return (
|
return (
|
||||||
div({
|
div({
|
||||||
className: "requests-list-column requests-list-set-cookies",
|
className: "requests-list-column requests-list-set-cookies",
|
||||||
|
|
|
@ -64,10 +64,10 @@ function Header(id, headers) {
|
||||||
}
|
}
|
||||||
function PostData(id, postData, header) {
|
function PostData(id, postData, header) {
|
||||||
const {headers, headersSize} = header;
|
const {headers, headersSize} = header;
|
||||||
let payload = {},
|
const payload = {};
|
||||||
requestPostData = {
|
const requestPostData = {
|
||||||
from: id, postDataDiscarded: false, postData: {}
|
from: id, postDataDiscarded: false, postData: {}
|
||||||
};
|
};
|
||||||
if (postData) {
|
if (postData) {
|
||||||
requestPostData.postData.text = postData;
|
requestPostData.postData.text = postData;
|
||||||
payload.requestPostData = Object.assign({}, requestPostData);
|
payload.requestPostData = Object.assign({}, requestPostData);
|
||||||
|
|
|
@ -481,7 +481,8 @@ class FirefoxDataProvider {
|
||||||
// The name of the callback that processes request response
|
// The name of the callback that processes request response
|
||||||
const callbackMethodName = `on${method.charAt(0).toUpperCase()}${method.slice(1)}`;
|
const callbackMethodName = `on${method.charAt(0).toUpperCase()}${method.slice(1)}`;
|
||||||
// And the event to fire before updating this data
|
// And the event to fire before updating this data
|
||||||
const updatingEventName = `UPDATING_${method.replace(/([A-Z])/g, "_$1").toUpperCase()}`;
|
const updatingEventName =
|
||||||
|
`UPDATING_${method.replace(/([A-Z])/g, "_$1").toUpperCase()}`;
|
||||||
|
|
||||||
// Emit event that tell we just start fetching some data
|
// Emit event that tell we just start fetching some data
|
||||||
this.emit(EVENTS[updatingEventName], actor);
|
this.emit(EVENTS[updatingEventName], actor);
|
||||||
|
|
|
@ -107,7 +107,8 @@ class WaterfallBackground {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const delta = Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
|
const delta =
|
||||||
|
Math.floor((timestamp - state.firstRequestStartedMillis) * state.scale);
|
||||||
drawPixelAt(delta, color);
|
drawPixelAt(delta, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,8 @@ add_task(async function() {
|
||||||
EventUtils.sendMouseEvent({ type: "contextmenu" },
|
EventUtils.sendMouseEvent({ type: "contextmenu" },
|
||||||
document.querySelector(`#requests-list-${column}-button`));
|
document.querySelector(`#requests-list-${column}-button`));
|
||||||
|
|
||||||
const menuItem = parent.document.querySelector(`#request-list-header-${column}-toggle`);
|
const menuItem =
|
||||||
|
parent.document.querySelector(`#request-list-header-${column}-toggle`);
|
||||||
ok(menuItem.disabled, "Last visible column menu item should be disabled.");
|
ok(menuItem.disabled, "Last visible column menu item should be disabled.");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,10 +67,11 @@ add_task(async function() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const valueTransfer = document.querySelector(".requests-list-network-summary-transfer")
|
const valueTransfer =
|
||||||
.textContent;
|
document.querySelector(".requests-list-network-summary-transfer").textContent;
|
||||||
info("Current summary transfer: " + valueTransfer);
|
info("Current summary transfer: " + valueTransfer);
|
||||||
const expectedTransfer = L10N.getFormatStrWithNumbers("networkMenu.summary.transferred",
|
const expectedTransfer = L10N.getFormatStrWithNumbers(
|
||||||
|
"networkMenu.summary.transferred",
|
||||||
getFormattedSize(requestsSummary.contentSize),
|
getFormattedSize(requestsSummary.contentSize),
|
||||||
getFormattedSize(requestsSummary.transferredSize));
|
getFormattedSize(requestsSummary.transferredSize));
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,8 @@ add_task(async function() {
|
||||||
async function checkTabResponse(checkedTab, method) {
|
async function checkTabResponse(checkedTab, method) {
|
||||||
await ContentTask.spawn(checkedTab.linkedBrowser, method, async function(met) {
|
await ContentTask.spawn(checkedTab.linkedBrowser, method, async function(met) {
|
||||||
const { body } = content.wrappedJSObject.document;
|
const { body } = content.wrappedJSObject.document;
|
||||||
const responseRE = RegExp(met + (met == "POST" ? "\n*\s*foo\=bar\&baz\=42" : ""));
|
const responseRE =
|
||||||
|
RegExp(met + (met == "POST" ? "\n*\s*foo\=bar\&baz\=42" : ""));
|
||||||
ok(body.innerHTML.match(responseRE), "Tab method and data match original request");
|
ok(body.innerHTML.match(responseRE), "Tab method and data match original request");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -256,7 +256,8 @@ var PerformanceController = {
|
||||||
if (!hasActor) {
|
if (!hasActor) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
const actorCanCheck = await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
|
const actorCanCheck =
|
||||||
|
await gTarget.actorHasMethod("performance", "canCurrentlyRecord");
|
||||||
if (!actorCanCheck) {
|
if (!actorCanCheck) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,8 @@ var PerformanceView = {
|
||||||
// Wrap the label in quotes if it exists for the commands.
|
// Wrap the label in quotes if it exists for the commands.
|
||||||
label = label ? `"${label}"` : "";
|
label = label ? `"${label}"` : "";
|
||||||
|
|
||||||
const startCommand = $(".console-profile-recording-notice .console-profile-command");
|
const startCommand =
|
||||||
|
$(".console-profile-recording-notice .console-profile-command");
|
||||||
const stopCommand = $(".console-profile-stop-notice .console-profile-command");
|
const stopCommand = $(".console-profile-stop-notice .console-profile-command");
|
||||||
|
|
||||||
startCommand.value = `console.profile(${label})`;
|
startCommand.value = `console.profile(${label})`;
|
||||||
|
|
|
@ -27,7 +27,8 @@ exports.once = function(target, eventName, options = {}) {
|
||||||
* Possible options: `useCapture`, `spreadArgs`, `expectedArgs`
|
* Possible options: `useCapture`, `spreadArgs`, `expectedArgs`
|
||||||
*/
|
*/
|
||||||
exports.times = function(target, eventName, receiveCount, options = {}) {
|
exports.times = function(target, eventName, receiveCount, options = {}) {
|
||||||
const msg = `Waiting for event: '${eventName}' on ${target} for ${receiveCount} time(s)`;
|
const msg =
|
||||||
|
`Waiting for event: '${eventName}' on ${target} for ${receiveCount} time(s)`;
|
||||||
if ("expectedArgs" in options) {
|
if ("expectedArgs" in options) {
|
||||||
dump(`${msg} with arguments: ${JSON.stringify(options.expectedArgs)}.\n`);
|
dump(`${msg} with arguments: ${JSON.stringify(options.expectedArgs)}.\n`);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,7 +45,8 @@ exports.removeTab = function(tab) {
|
||||||
* Adds a browser window with the provided options.
|
* Adds a browser window with the provided options.
|
||||||
*/
|
*/
|
||||||
exports.addWindow = async function(options) {
|
exports.addWindow = async function(options) {
|
||||||
const { OpenBrowserWindow } = Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
|
const { OpenBrowserWindow } =
|
||||||
|
Services.wm.getMostRecentWindow(gDevTools.chromeWindowType);
|
||||||
const win = OpenBrowserWindow(options);
|
const win = OpenBrowserWindow(options);
|
||||||
await waitForDelayedStartupFinished(win);
|
await waitForDelayedStartupFinished(win);
|
||||||
return win;
|
return win;
|
||||||
|
|
|
@ -63,7 +63,8 @@ var JsCallTreeView = extend(DetailsSubview, {
|
||||||
flattenRecursion: PerformanceController.getOption("flatten-tree-recursion"),
|
flattenRecursion: PerformanceController.getOption("flatten-tree-recursion"),
|
||||||
showOptimizationHint: showOptimizations
|
showOptimizationHint: showOptimizations
|
||||||
};
|
};
|
||||||
const threadNode = this.threadNode = this._prepareCallTree(profile, interval, options);
|
const threadNode =
|
||||||
|
this.threadNode = this._prepareCallTree(profile, interval, options);
|
||||||
this._populateCallTree(threadNode, options);
|
this._populateCallTree(threadNode, options);
|
||||||
|
|
||||||
// For better or worse, re-rendering loses frame selection,
|
// For better or worse, re-rendering loses frame selection,
|
||||||
|
@ -137,8 +138,8 @@ var JsCallTreeView = extend(DetailsSubview, {
|
||||||
_prepareCallTree: function(profile, { startTime, endTime }, options) {
|
_prepareCallTree: function(profile, { startTime, endTime }, options) {
|
||||||
const thread = profile.threads[0];
|
const thread = profile.threads[0];
|
||||||
const { contentOnly, invertTree, flattenRecursion } = options;
|
const { contentOnly, invertTree, flattenRecursion } = options;
|
||||||
const threadNode = new ThreadNode(thread, { startTime, endTime, contentOnly, invertTree,
|
const threadNode = new ThreadNode(thread,
|
||||||
flattenRecursion });
|
{ startTime, endTime, contentOnly, invertTree, flattenRecursion });
|
||||||
|
|
||||||
// Real profiles from nsProfiler (i.e. not synthesized from allocation
|
// Real profiles from nsProfiler (i.e. not synthesized from allocation
|
||||||
// logs) always have a (root) node. Go down one level in the uninverted
|
// logs) always have a (root) node. Go down one level in the uninverted
|
||||||
|
|
|
@ -63,7 +63,8 @@ addRDMTask(TEST_URL, async function({ ui }) {
|
||||||
submitButton.click();
|
submitButton.click();
|
||||||
|
|
||||||
info("Look for custom device in device selector");
|
info("Look for custom device in device selector");
|
||||||
const selectorOption = [...deviceSelector.options].find(opt => opt.value == device.name);
|
const selectorOption =
|
||||||
|
[...deviceSelector.options].find(opt => opt.value == device.name);
|
||||||
ok(selectorOption, "Custom device option added to device selector");
|
ok(selectorOption, "Custom device option added to device selector");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -103,7 +104,8 @@ addRDMTask(TEST_URL, async function({ ui }) {
|
||||||
info("Ensure custom device was removed from device selector");
|
info("Ensure custom device was removed from device selector");
|
||||||
await waitUntilState(store, state => state.viewports[0].device == "");
|
await waitUntilState(store, state => state.viewports[0].device == "");
|
||||||
is(deviceSelector.value, "", "Device selector reset to no device");
|
is(deviceSelector.value, "", "Device selector reset to no device");
|
||||||
const selectorOption = [...deviceSelector.options].find(opt => opt.value == device.name);
|
const selectorOption =
|
||||||
|
[...deviceSelector.options].find(opt => opt.value == device.name);
|
||||||
ok(!selectorOption, "Custom device option removed from device selector");
|
ok(!selectorOption, "Custom device option removed from device selector");
|
||||||
|
|
||||||
info("Ensure device properties like UA have been reset");
|
info("Ensure device properties like UA have been reset");
|
||||||
|
@ -167,7 +169,8 @@ function testDeviceAdder(ui, expected) {
|
||||||
const { document } = ui.toolWindow;
|
const { document } = ui.toolWindow;
|
||||||
|
|
||||||
const nameInput = document.querySelector("#device-adder-name input");
|
const nameInput = document.querySelector("#device-adder-name input");
|
||||||
const [ widthInput, heightInput ] = document.querySelectorAll("#device-adder-size input");
|
const [ widthInput, heightInput ] =
|
||||||
|
document.querySelectorAll("#device-adder-size input");
|
||||||
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
|
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
|
||||||
const userAgentInput = document.querySelector("#device-adder-user-agent input");
|
const userAgentInput = document.querySelector("#device-adder-user-agent input");
|
||||||
const touchInput = document.querySelector("#device-adder-touch input");
|
const touchInput = document.querySelector("#device-adder-touch input");
|
||||||
|
|
|
@ -100,11 +100,13 @@ addRDMTask(TEST_URL, async function({ ui }) {
|
||||||
const deviceSelector = document.querySelector(".viewport-device-selector");
|
const deviceSelector = document.querySelector(".viewport-device-selector");
|
||||||
|
|
||||||
info("Ensure device 1 is still in device selector");
|
info("Ensure device 1 is still in device selector");
|
||||||
const deviceOption1 = [...deviceSelector.options].find(opt => opt.value == device1.name);
|
const deviceOption1 =
|
||||||
|
[...deviceSelector.options].find(opt => opt.value == device1.name);
|
||||||
ok(deviceOption1, "Test device 1 option exists");
|
ok(deviceOption1, "Test device 1 option exists");
|
||||||
|
|
||||||
info("Ensure device 2 is no longer in device selector");
|
info("Ensure device 2 is no longer in device selector");
|
||||||
const deviceOption2 = [...deviceSelector.options].find(opt => opt.value == device2.name);
|
const deviceOption2 =
|
||||||
|
[...deviceSelector.options].find(opt => opt.value == device2.name);
|
||||||
ok(!deviceOption2, "Test device 2 option removed");
|
ok(!deviceOption2, "Test device 2 option removed");
|
||||||
|
|
||||||
openDeviceModal(ui);
|
openDeviceModal(ui);
|
||||||
|
|
|
@ -34,7 +34,7 @@ addRDMTask(TEST_URL, async function({ ui, manager }) {
|
||||||
});
|
});
|
||||||
|
|
||||||
async function setViewportSizeWithInputKeys(ui) {
|
async function setViewportSizeWithInputKeys(ui) {
|
||||||
let width = 320, height = 500;
|
const width = 320, height = 500;
|
||||||
let resized = waitForViewportResizeTo(ui, width, height);
|
let resized = waitForViewportResizeTo(ui, width, height);
|
||||||
ui.setViewportSize({ width, height });
|
ui.setViewportSize({ width, height });
|
||||||
await resized;
|
await resized;
|
||||||
|
|
|
@ -394,7 +394,8 @@ function addDeviceInModal(ui, device) {
|
||||||
const { store, document } = ui.toolWindow;
|
const { store, document } = ui.toolWindow;
|
||||||
|
|
||||||
const nameInput = document.querySelector("#device-adder-name input");
|
const nameInput = document.querySelector("#device-adder-name input");
|
||||||
const [ widthInput, heightInput ] = document.querySelectorAll("#device-adder-size input");
|
const [ widthInput, heightInput ] =
|
||||||
|
document.querySelectorAll("#device-adder-size input");
|
||||||
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
|
const pixelRatioInput = document.querySelector("#device-adder-pixel-ratio input");
|
||||||
const userAgentInput = document.querySelector("#device-adder-user-agent input");
|
const userAgentInput = document.querySelector("#device-adder-user-agent input");
|
||||||
const touchInput = document.querySelector("#device-adder-touch input");
|
const touchInput = document.querySelector("#device-adder-touch input");
|
||||||
|
|
|
@ -1083,8 +1083,9 @@ var Scratchpad = {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
_getUnicodeContent: function SP__getUnicodeContent(aContent, aCharsetArray) {
|
_getUnicodeContent: function SP__getUnicodeContent(aContent, aCharsetArray) {
|
||||||
let content = null,
|
const converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
|
||||||
converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
|
|
||||||
|
let content = null;
|
||||||
aCharsetArray.some(charset => {
|
aCharsetArray.some(charset => {
|
||||||
try {
|
try {
|
||||||
converter.charset = charset;
|
converter.charset = charset;
|
||||||
|
|
|
@ -14,7 +14,7 @@ function test() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function testThrowOutput() {
|
function testThrowOutput() {
|
||||||
let scratchpad = gScratchpadWindow.Scratchpad, tests = [];
|
const scratchpad = gScratchpadWindow.Scratchpad, tests = [];
|
||||||
|
|
||||||
const falsyValues = ["false", "0", "-0", "null", "undefined", "Infinity",
|
const falsyValues = ["false", "0", "-0", "null", "undefined", "Infinity",
|
||||||
"-Infinity", "NaN"];
|
"-Infinity", "NaN"];
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
let canvas = [], gl = [];
|
const canvas = [], gl = [];
|
||||||
const program = [];
|
const program = [];
|
||||||
const squareVerticesPositionBuffer = [];
|
const squareVerticesPositionBuffer = [];
|
||||||
const vertexPositionAttribute = [];
|
const vertexPositionAttribute = [];
|
||||||
|
|
|
@ -264,7 +264,9 @@ function hasAttribute(attributes, attributeName) {
|
||||||
* @return {Array}
|
* @return {Array}
|
||||||
*/
|
*/
|
||||||
function splitBy(value, splitChar) {
|
function splitBy(value, splitChar) {
|
||||||
let data = [], i = 0, buffer = "";
|
const data = [];
|
||||||
|
|
||||||
|
let i = 0, buffer = "";
|
||||||
while (i <= value.length) {
|
while (i <= value.length) {
|
||||||
if (i === value.length && buffer) {
|
if (i === value.length && buffer) {
|
||||||
data.push({value: buffer});
|
data.push({value: buffer});
|
||||||
|
|
|
@ -336,8 +336,8 @@ OutputParser.prototype = {
|
||||||
const variableNode = this._parseVariable(token, text, tokenStream, options);
|
const variableNode = this._parseVariable(token, text, tokenStream, options);
|
||||||
this.parsed.push(variableNode);
|
this.parsed.push(variableNode);
|
||||||
} else {
|
} else {
|
||||||
const {functionData, sawVariable} = this._parseMatchingParens(text, tokenStream,
|
const {functionData, sawVariable} =
|
||||||
options);
|
this._parseMatchingParens(text, tokenStream, options);
|
||||||
|
|
||||||
const functionName = text.substring(token.startOffset, token.endOffset);
|
const functionName = text.substring(token.startOffset, token.endOffset);
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ add_task(async function() {
|
||||||
|
|
||||||
function testRenderedFilters(filters, expected) {
|
function testRenderedFilters(filters, expected) {
|
||||||
for (const [index, filter] of [...filters].entries()) {
|
for (const [index, filter] of [...filters].entries()) {
|
||||||
let [name, value] = filter.children,
|
const [name, value] = filter.children,
|
||||||
label = name.children[1],
|
label = name.children[1],
|
||||||
[input, unit] = value.children;
|
[input, unit] = value.children;
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ add_task(async function() {
|
||||||
const box2 = doc.getElementById("box2");
|
const box2 = doc.getElementById("box2");
|
||||||
const box3 = doc.getElementById("box3");
|
const box3 = doc.getElementById("box3");
|
||||||
const box4 = doc.getElementById("box4");
|
const box4 = doc.getElementById("box4");
|
||||||
let height = TOOLTIP_HEIGHT, width = TOOLTIP_WIDTH;
|
const height = TOOLTIP_HEIGHT, width = TOOLTIP_WIDTH;
|
||||||
|
|
||||||
// box1: Can only fit below box1
|
// box1: Can only fit below box1
|
||||||
info("Display the tooltip on box1.");
|
info("Display the tooltip on box1.");
|
||||||
|
|
|
@ -30,7 +30,7 @@ add_task(async function() {
|
||||||
const box3 = doc.getElementById("box3");
|
const box3 = doc.getElementById("box3");
|
||||||
const box4 = doc.getElementById("box4");
|
const box4 = doc.getElementById("box4");
|
||||||
|
|
||||||
let width = 100, height = 50;
|
const width = 100, height = 50;
|
||||||
|
|
||||||
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
|
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
|
||||||
tooltip.setContent(getTooltipContent(doc), {width, height});
|
tooltip.setContent(getTooltipContent(doc), {width, height});
|
||||||
|
|
|
@ -19,7 +19,7 @@ add_task(async function() {
|
||||||
// Wait for full page load before synthesizing events on the page.
|
// Wait for full page load before synthesizing events on the page.
|
||||||
await waitUntil(() => doc.readyState === "complete");
|
await waitUntil(() => doc.readyState === "complete");
|
||||||
|
|
||||||
let width = 100, height = 50;
|
const width = 100, height = 50;
|
||||||
const tooltipContent = doc.createElementNS(HTML_NS, "div");
|
const tooltipContent = doc.createElementNS(HTML_NS, "div");
|
||||||
tooltipContent.textContent = "tooltip";
|
tooltipContent.textContent = "tooltip";
|
||||||
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
|
const tooltip = new HTMLTooltip(doc, {useXulWrapper: false});
|
||||||
|
|
|
@ -25,7 +25,10 @@ const {loader, require} = scopedCuImport("resource://devtools/shared/Loader.jsm"
|
||||||
const {gDevTools} = require("devtools/client/framework/devtools");
|
const {gDevTools} = require("devtools/client/framework/devtools");
|
||||||
const {TargetFactory} = require("devtools/client/framework/target");
|
const {TargetFactory} = require("devtools/client/framework/target");
|
||||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||||
const promise = require("promise");
|
|
||||||
|
// This is overridden in files that load shared-head via loadSubScript.
|
||||||
|
// eslint-disable-next-line prefer-const
|
||||||
|
let promise = require("promise");
|
||||||
const defer = require("devtools/shared/defer");
|
const defer = require("devtools/shared/defer");
|
||||||
const Services = require("Services");
|
const Services = require("Services");
|
||||||
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
||||||
|
|
|
@ -110,7 +110,7 @@ BezierCanvas.prototype = {
|
||||||
* @return {Array} Returns an array of 2 {top:String,left:String} objects
|
* @return {Array} Returns an array of 2 {top:String,left:String} objects
|
||||||
*/
|
*/
|
||||||
get offsets() {
|
get offsets() {
|
||||||
let p = this.padding, w = this.canvas.width, h = this.canvas.height;
|
const p = this.padding, w = this.canvas.width, h = this.canvas.height;
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
left: w * (this.bezier.coordinates[0] * (1 - p[3] - p[1]) - p[3]) + "px",
|
left: w * (this.bezier.coordinates[0] * (1 - p[3] - p[1]) - p[3]) + "px",
|
||||||
|
@ -127,10 +127,10 @@ BezierCanvas.prototype = {
|
||||||
* Convert an element's left/top offsets into coordinates
|
* Convert an element's left/top offsets into coordinates
|
||||||
*/
|
*/
|
||||||
offsetsToCoordinates: function(element) {
|
offsetsToCoordinates: function(element) {
|
||||||
let p = this.padding, w = this.canvas.width, h = this.canvas.height;
|
const w = this.canvas.width, h = this.canvas.height;
|
||||||
|
|
||||||
// Convert padding percentage to actual padding
|
// Convert padding percentage to actual padding
|
||||||
p = p.map((a, i) => a * (i % 2 ? w : h));
|
const p = this.padding.map((a, i) => a * (i % 2 ? w : h));
|
||||||
|
|
||||||
return [
|
return [
|
||||||
(parseFloat(element.style.left) - p[3]) / (w + p[1] + p[3]),
|
(parseFloat(element.style.left) - p[3]) / (w + p[1] + p[3]),
|
||||||
|
|
|
@ -112,12 +112,14 @@ Spectrum.rgbToHsv = function(r, g, b, a) {
|
||||||
g = g / 255;
|
g = g / 255;
|
||||||
b = b / 255;
|
b = b / 255;
|
||||||
|
|
||||||
let max = Math.max(r, g, b), min = Math.min(r, g, b);
|
const max = Math.max(r, g, b);
|
||||||
let h, s, v = max;
|
const min = Math.min(r, g, b);
|
||||||
|
|
||||||
|
const v = max;
|
||||||
const d = max - min;
|
const d = max - min;
|
||||||
s = max == 0 ? 0 : d / max;
|
const s = max == 0 ? 0 : d / max;
|
||||||
|
|
||||||
|
let h;
|
||||||
if (max == min) {
|
if (max == min) {
|
||||||
// achromatic
|
// achromatic
|
||||||
h = 0;
|
h = 0;
|
||||||
|
|
|
@ -314,8 +314,6 @@ TableWidget.prototype = {
|
||||||
// within the table can change. Because of this we need to wait for
|
// within the table can change. Because of this we need to wait for
|
||||||
// EVENTS.ROW_EDIT and then move the textbox.
|
// EVENTS.ROW_EDIT and then move the textbox.
|
||||||
this.once(EVENTS.ROW_EDIT, uniqueId => {
|
this.once(EVENTS.ROW_EDIT, uniqueId => {
|
||||||
let cell;
|
|
||||||
let cells;
|
|
||||||
let columnObj;
|
let columnObj;
|
||||||
const cols = this.editableColumns;
|
const cols = this.editableColumns;
|
||||||
let rowIndex = this.visibleSelectedIndex;
|
let rowIndex = this.visibleSelectedIndex;
|
||||||
|
@ -366,8 +364,8 @@ TableWidget.prototype = {
|
||||||
rowIndex = this.visibleSelectedIndex;
|
rowIndex = this.visibleSelectedIndex;
|
||||||
|
|
||||||
// Edit the appropriate cell.
|
// Edit the appropriate cell.
|
||||||
cells = columnObj.visibleCellNodes;
|
const cells = columnObj.visibleCellNodes;
|
||||||
cell = cells[rowIndex];
|
const cell = cells[rowIndex];
|
||||||
editor.edit(cell);
|
editor.edit(cell);
|
||||||
|
|
||||||
// Remove flash-out class... it won't have been auto-removed because the
|
// Remove flash-out class... it won't have been auto-removed because the
|
||||||
|
|
|
@ -3524,7 +3524,8 @@ VariablesView.stringifiers.byObjectKind = {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
let shown = 0, result = [], lastHole = null;
|
let shown = 0, lastHole = null;
|
||||||
|
const result = [];
|
||||||
for (const item of preview.items) {
|
for (const item of preview.items) {
|
||||||
if (item === null) {
|
if (item === null) {
|
||||||
if (lastHole !== null) {
|
if (lastHole !== null) {
|
||||||
|
|
|
@ -55,13 +55,11 @@ class SwatchColorPickerTooltip extends SwatchBasedEditorTooltip {
|
||||||
const container = doc.createElementNS(XHTML_NS, "div");
|
const container = doc.createElementNS(XHTML_NS, "div");
|
||||||
container.id = "spectrum-tooltip";
|
container.id = "spectrum-tooltip";
|
||||||
|
|
||||||
let widget;
|
|
||||||
|
|
||||||
const node = doc.createElementNS(XHTML_NS, "div");
|
const node = doc.createElementNS(XHTML_NS, "div");
|
||||||
node.id = "spectrum";
|
node.id = "spectrum";
|
||||||
container.appendChild(node);
|
container.appendChild(node);
|
||||||
|
|
||||||
widget = new Spectrum(node, color);
|
const widget = new Spectrum(node, color);
|
||||||
this.tooltip.setContent(container, { width: 218, height: 224 });
|
this.tooltip.setContent(container, { width: 218, height: 224 });
|
||||||
|
|
||||||
widget.inspector = this.inspector;
|
widget.inspector = this.inspector;
|
||||||
|
|
|
@ -22,7 +22,7 @@ function getWasmText(subject, data) {
|
||||||
result = { lines: ["No luck with wast conversion"], offsets: [0], done, };
|
result = { lines: ["No luck with wast conversion"], offsets: [0], done, };
|
||||||
}
|
}
|
||||||
|
|
||||||
let offsets = result.offsets, lines = [];
|
const offsets = result.offsets, lines = [];
|
||||||
for (let i = 0; i < offsets.length; i++) {
|
for (let i = 0; i < offsets.length; i++) {
|
||||||
lines[offsets[i]] = i;
|
lines[offsets[i]] = i;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1345,7 +1345,8 @@ exports.StorageUI = StorageUI;
|
||||||
|
|
||||||
function createGUID() {
|
function createGUID() {
|
||||||
return "{cccccccc-cccc-4ccc-yccc-cccccccccccc}".replace(/[cy]/g, c => {
|
return "{cccccccc-cccc-4ccc-yccc-cccccccccccc}".replace(/[cy]/g, c => {
|
||||||
let r = Math.random() * 16 | 0, v = c == "c" ? r : (r & 0x3 | 0x8);
|
const r = Math.random() * 16 | 0;
|
||||||
|
const v = c == "c" ? r : (r & 0x3 | 0x8);
|
||||||
return v.toString(16);
|
return v.toString(16);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ add_task(async function() {
|
||||||
const counter = () => count++;
|
const counter = () => count++;
|
||||||
front.on("automation-event", counter);
|
front.on("automation-event", counter);
|
||||||
|
|
||||||
let t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
|
const t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
|
||||||
const curve = [-1, 0, 1];
|
const curve = [-1, 0, 1];
|
||||||
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
|
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
|
||||||
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
|
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
|
||||||
|
|
|
@ -13,7 +13,7 @@ add_task(async function() {
|
||||||
get3(front, "create-node")
|
get3(front, "create-node")
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
|
const t0 = 0, t1 = 0.1, t2 = 0.2, t3 = 0.3, t4 = 0.4, t5 = 0.6, t6 = 0.7, t7 = 1;
|
||||||
const curve = [-1, 0, 1];
|
const curve = [-1, 0, 1];
|
||||||
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
|
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.2, t0]);
|
||||||
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
|
await oscNode.addAutomationEvent("frequency", "setValueAtTime", [0.3, t1]);
|
||||||
|
|
|
@ -251,7 +251,9 @@ function formatStub(key, packet) {
|
||||||
|
|
||||||
function formatNetworkEventStub(key, packet) {
|
function formatNetworkEventStub(key, packet) {
|
||||||
const cleanedPacket = getCleanedPacket(key, packet);
|
const cleanedPacket = getCleanedPacket(key, packet);
|
||||||
const networkInfo = cleanedPacket.networkInfo ? cleanedPacket.networkInfo : cleanedPacket;
|
const networkInfo = cleanedPacket.networkInfo
|
||||||
|
? cleanedPacket.networkInfo
|
||||||
|
: cleanedPacket;
|
||||||
|
|
||||||
const prepared = prepareMessage(
|
const prepared = prepareMessage(
|
||||||
networkInfo,
|
networkInfo,
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
const { ConsoleMessage } =
|
const { ConsoleMessage } =
|
||||||
require("devtools/client/webconsole/types");
|
require("devtools/client/webconsole/types");
|
||||||
|
|
||||||
const stubPreparedMessages = new Map();
|
let stubPreparedMessages = new Map();
|
||||||
const stubPackets = new Map();
|
let stubPackets = new Map();
|
||||||
stubPreparedMessages.set(`console.log('foobar', 'test')`, new ConsoleMessage({
|
stubPreparedMessages.set(`console.log('foobar', 'test')`, new ConsoleMessage({
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"allowRepeating": true,
|
"allowRepeating": true,
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
const { ConsoleMessage } =
|
const { ConsoleMessage } =
|
||||||
require("devtools/client/webconsole/types");
|
require("devtools/client/webconsole/types");
|
||||||
|
|
||||||
const stubPreparedMessages = new Map();
|
let stubPreparedMessages = new Map();
|
||||||
const stubPackets = new Map();
|
let stubPackets = new Map();
|
||||||
stubPreparedMessages.set(`Unknown property ‘such-unknown-property’. Declaration dropped.`, new ConsoleMessage({
|
stubPreparedMessages.set(`Unknown property ‘such-unknown-property’. Declaration dropped.`, new ConsoleMessage({
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"allowRepeating": true,
|
"allowRepeating": true,
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
const { ConsoleMessage } =
|
const { ConsoleMessage } =
|
||||||
require("devtools/client/webconsole/types");
|
require("devtools/client/webconsole/types");
|
||||||
|
|
||||||
const stubPreparedMessages = new Map();
|
let stubPreparedMessages = new Map();
|
||||||
const stubPackets = new Map();
|
let stubPackets = new Map();
|
||||||
stubPreparedMessages.set(`new Date(0)`, new ConsoleMessage({
|
stubPreparedMessages.set(`new Date(0)`, new ConsoleMessage({
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"allowRepeating": true,
|
"allowRepeating": true,
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
const { NetworkEventMessage } =
|
const { NetworkEventMessage } =
|
||||||
require("devtools/client/webconsole/types");
|
require("devtools/client/webconsole/types");
|
||||||
|
|
||||||
const stubPreparedMessages = new Map();
|
let stubPreparedMessages = new Map();
|
||||||
const stubPackets = new Map();
|
let stubPackets = new Map();
|
||||||
stubPreparedMessages.set("GET request", new NetworkEventMessage({
|
stubPreparedMessages.set("GET request", new NetworkEventMessage({
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"actor": "server1.conn0.child1/netEvent30",
|
"actor": "server1.conn0.child1/netEvent30",
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
const { ConsoleMessage } =
|
const { ConsoleMessage } =
|
||||||
require("devtools/client/webconsole/types");
|
require("devtools/client/webconsole/types");
|
||||||
|
|
||||||
const stubPreparedMessages = new Map();
|
let stubPreparedMessages = new Map();
|
||||||
const stubPackets = new Map();
|
let stubPackets = new Map();
|
||||||
stubPreparedMessages.set(`ReferenceError: asdf is not defined`, new ConsoleMessage({
|
stubPreparedMessages.set(`ReferenceError: asdf is not defined`, new ConsoleMessage({
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"allowRepeating": true,
|
"allowRepeating": true,
|
||||||
|
|
|
@ -12,9 +12,9 @@ const TEST_MESSAGE = "testmessage";
|
||||||
const { Tools } = require("devtools/client/definitions");
|
const { Tools } = require("devtools/client/definitions");
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
let currWindow, hud, mainWindow;
|
let currWindow, hud;
|
||||||
|
|
||||||
mainWindow = Services.wm.getMostRecentWindow(null);
|
const mainWindow = Services.wm.getMostRecentWindow(null);
|
||||||
|
|
||||||
await HUDService.openBrowserConsoleOrFocus();
|
await HUDService.openBrowserConsoleOrFocus();
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,8 @@ async function testSelfXss(jsterm) {
|
||||||
const oldVal = jsterm.getInputValue();
|
const oldVal = jsterm.getInputValue();
|
||||||
goDoCommand("cmd_paste");
|
goDoCommand("cmd_paste");
|
||||||
|
|
||||||
const notificationbox = jsterm.hud.document.getElementById("webconsole-notificationbox");
|
const notificationbox =
|
||||||
|
jsterm.hud.document.getElementById("webconsole-notificationbox");
|
||||||
const notification = notificationbox.querySelector(".notification");
|
const notification = notificationbox.querySelector(".notification");
|
||||||
is(notification.getAttribute("data-key"), "selfxss-notification",
|
is(notification.getAttribute("data-key"), "selfxss-notification",
|
||||||
"Self-xss notification shown");
|
"Self-xss notification shown");
|
||||||
|
|
|
@ -35,7 +35,8 @@ add_task(async function() {
|
||||||
// output to the console: Timer "bTimer" doesn't exist
|
// output to the console: Timer "bTimer" doesn't exist
|
||||||
const hud2 = await openNewTabAndConsole(TEST_URI2);
|
const hud2 = await openNewTabAndConsole(TEST_URI2);
|
||||||
|
|
||||||
const error1 = await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
|
const error1 =
|
||||||
|
await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
|
||||||
ok(error1, "Timers with the same name but in separate tabs do not contain "
|
ok(error1, "Timers with the same name but in separate tabs do not contain "
|
||||||
+ "the same value");
|
+ "the same value");
|
||||||
|
|
||||||
|
@ -62,7 +63,8 @@ add_task(async function() {
|
||||||
// as the timers in different pages are not related
|
// as the timers in different pages are not related
|
||||||
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI4);
|
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI4);
|
||||||
|
|
||||||
const error2 = await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
|
const error2 =
|
||||||
|
await waitFor(() => findMessage(hud2, "bTimer", ".message.timeEnd.warn"));
|
||||||
ok(error2, "Timers with the same name but in separate pages do not contain "
|
ok(error2, "Timers with the same name but in separate pages do not contain "
|
||||||
+ "the same value");
|
+ "the same value");
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,7 +18,8 @@ add_task(async function() {
|
||||||
const hud = await openNewTabAndConsole(TEST_URI);
|
const hud = await openNewTabAndConsole(TEST_URI);
|
||||||
info("console opened");
|
info("console opened");
|
||||||
|
|
||||||
const msg = await waitFor(() => findMessage(hud, "Blocked loading mixed active content"));
|
const msg =
|
||||||
|
await waitFor(() => findMessage(hud, "Blocked loading mixed active content"));
|
||||||
ok(msg, "error message");
|
ok(msg, "error message");
|
||||||
const locationNode = msg.querySelector(".message-location .frame-link-filename");
|
const locationNode = msg.querySelector(".message-location .frame-link-filename");
|
||||||
ok(locationNode, "location node");
|
ok(locationNode, "location node");
|
||||||
|
|
|
@ -575,7 +575,8 @@ async function openMessageInNetmonitor(toolbox, hud, url, urlInConsole) {
|
||||||
});
|
});
|
||||||
|
|
||||||
const menuPopup = await openContextMenu(hud, message);
|
const menuPopup = await openContextMenu(hud, message);
|
||||||
const openInNetMenuItem = menuPopup.querySelector("#console-menu-open-in-network-panel");
|
const openInNetMenuItem =
|
||||||
|
menuPopup.querySelector("#console-menu-open-in-network-panel");
|
||||||
ok(openInNetMenuItem, "open in network panel item is enabled");
|
ok(openInNetMenuItem, "open in network panel item is enabled");
|
||||||
openInNetMenuItem.click();
|
openInNetMenuItem.click();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,8 @@ const l10n = {
|
||||||
*/
|
*/
|
||||||
timestampString: function(milliseconds) {
|
timestampString: function(milliseconds) {
|
||||||
const d = new Date(milliseconds ? milliseconds : null);
|
const d = new Date(milliseconds ? milliseconds : null);
|
||||||
let hours = d.getHours(), minutes = d.getMinutes();
|
const hours = d.getHours();
|
||||||
|
const minutes = d.getMinutes();
|
||||||
const seconds = d.getSeconds();
|
const seconds = d.getSeconds();
|
||||||
milliseconds = d.getMilliseconds();
|
milliseconds = d.getMilliseconds();
|
||||||
const parameters = [hours, minutes, seconds, milliseconds];
|
const parameters = [hours, minutes, seconds, milliseconds];
|
||||||
|
|
|
@ -267,13 +267,10 @@ ProjectList.prototype = {
|
||||||
|
|
||||||
updateCommands: function() {
|
updateCommands: function() {
|
||||||
const doc = this._doc;
|
const doc = this._doc;
|
||||||
let newAppCmd;
|
|
||||||
let packagedAppCmd;
|
|
||||||
let hostedAppCmd;
|
|
||||||
|
|
||||||
newAppCmd = doc.querySelector("#new-app");
|
const newAppCmd = doc.querySelector("#new-app");
|
||||||
packagedAppCmd = doc.querySelector("#packaged-app");
|
const packagedAppCmd = doc.querySelector("#packaged-app");
|
||||||
hostedAppCmd = doc.querySelector("#hosted-app");
|
const hostedAppCmd = doc.querySelector("#hosted-app");
|
||||||
|
|
||||||
if (!newAppCmd || !packagedAppCmd || !hostedAppCmd) {
|
if (!newAppCmd || !packagedAppCmd || !hostedAppCmd) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -184,12 +184,9 @@ function getProjectWindow(win) {
|
||||||
function connectToLocalRuntime(win) {
|
function connectToLocalRuntime(win) {
|
||||||
info("Loading local runtime.");
|
info("Loading local runtime.");
|
||||||
|
|
||||||
let panelNode;
|
const runtimePanel = getRuntimeDocument(win);
|
||||||
let runtimePanel;
|
|
||||||
|
|
||||||
runtimePanel = getRuntimeDocument(win);
|
const panelNode = runtimePanel.querySelector("#runtime-panel");
|
||||||
|
|
||||||
panelNode = runtimePanel.querySelector("#runtime-panel");
|
|
||||||
const items = panelNode.querySelectorAll(".runtime-panel-item-other");
|
const items = panelNode.querySelectorAll(".runtime-panel-item-other");
|
||||||
is(items.length, 2, "Found 2 custom runtime buttons");
|
is(items.length, 2, "Found 2 custom runtime buttons");
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,8 @@ ArrayBufferActor.prototype = {
|
||||||
|
|
||||||
onSlice({start, count}) {
|
onSlice({start, count}) {
|
||||||
const slice = new Uint8Array(this.buffer, start, count);
|
const slice = new Uint8Array(this.buffer, start, count);
|
||||||
let parts = [], offset = 0;
|
const parts = [];
|
||||||
|
let offset = 0;
|
||||||
const PortionSize = 0x6000; // keep it divisible by 3 for btoa() and join()
|
const PortionSize = 0x6000; // keep it divisible by 3 for btoa() and join()
|
||||||
while (offset + PortionSize < count) {
|
while (offset + PortionSize < count) {
|
||||||
parts.push(btoa(
|
parts.push(btoa(
|
||||||
|
|
|
@ -432,7 +432,8 @@ exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
|
||||||
if (self._recording) {
|
if (self._recording) {
|
||||||
const type = CallWatcherFront.GETTER_FUNCTION;
|
const type = CallWatcherFront.GETTER_FUNCTION;
|
||||||
const stack = getStack(name);
|
const stack = getStack(name);
|
||||||
const timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
|
const timestamp =
|
||||||
|
self.tabActor.window.performance.now() - self._timestampEpoch;
|
||||||
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
|
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
|
||||||
args, result);
|
args, result);
|
||||||
}
|
}
|
||||||
|
@ -447,7 +448,8 @@ exports.CallWatcherActor = protocol.ActorClassWithSpec(callWatcherSpec, {
|
||||||
if (self._recording) {
|
if (self._recording) {
|
||||||
const type = CallWatcherFront.SETTER_FUNCTION;
|
const type = CallWatcherFront.SETTER_FUNCTION;
|
||||||
const stack = getStack(name);
|
const stack = getStack(name);
|
||||||
const timestamp = self.tabActor.window.performance.now() - self._timestampEpoch;
|
const timestamp =
|
||||||
|
self.tabActor.window.performance.now() - self._timestampEpoch;
|
||||||
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
|
subcallback(unwrappedWindow, global, this, type, name, stack, timestamp,
|
||||||
args, undefined);
|
args, undefined);
|
||||||
}
|
}
|
||||||
|
|
|
@ -236,7 +236,8 @@ class AccessibleHighlighter extends AutoRefreshHighlighter {
|
||||||
|
|
||||||
const boundsEl = this.getElement("bounds");
|
const boundsEl = this.getElement("bounds");
|
||||||
const { left, right, top, bottom } = bounds;
|
const { left, right, top, bottom } = bounds;
|
||||||
const path = `M${left},${top} L${right},${top} L${right},${bottom} L${left},${bottom}`;
|
const path =
|
||||||
|
`M${left},${top} L${right},${top} L${right},${bottom} L${left},${bottom}`;
|
||||||
boundsEl.setAttribute("d", path);
|
boundsEl.setAttribute("d", path);
|
||||||
|
|
||||||
// Un-zoom the root wrapper if the page was zoomed.
|
// Un-zoom the root wrapper if the page was zoomed.
|
||||||
|
|
|
@ -1133,14 +1133,15 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
||||||
const newCx = `${round(valueX + deltaX, unitX)}${unitX}`;
|
const newCx = `${round(valueX + deltaX, unitX)}${unitX}`;
|
||||||
const newCy = `${round(valueY + deltaY, unitY)}${unitY}`;
|
const newCy = `${round(valueY + deltaY, unitY)}${unitY}`;
|
||||||
// if not defined by the user, geometryBox will be an empty string; trim() cleans up
|
// if not defined by the user, geometryBox will be an empty string; trim() cleans up
|
||||||
const circleDef = `circle(${radius} at ${newCx} ${newCy}) ${this.geometryBox}`.trim();
|
const circleDef =
|
||||||
|
`circle(${radius} at ${newCx} ${newCy}) ${this.geometryBox}`.trim();
|
||||||
|
|
||||||
this.emit("highlighter-event", { type: "shape-change", value: circleDef });
|
this.emit("highlighter-event", { type: "shape-change", value: circleDef });
|
||||||
} else if (point === "radius") {
|
} else if (point === "radius") {
|
||||||
const { value, unit, origRadius, ratio } = this[_dragging];
|
const { value, unit, origRadius, ratio } = this[_dragging];
|
||||||
// convert center point to px, then get distance between center and mouse.
|
// convert center point to px, then get distance between center and mouse.
|
||||||
const { x: pageCx, y: pageCy } = this.convertPercentToPageCoords(this.coordinates.cx,
|
const { x: pageCx, y: pageCy } =
|
||||||
this.coordinates.cy);
|
this.convertPercentToPageCoords(this.coordinates.cx, this.coordinates.cy);
|
||||||
const newRadiusPx = getDistance(pageCx, pageCy, pageX, pageY);
|
const newRadiusPx = getDistance(pageCx, pageCy, pageX, pageY);
|
||||||
|
|
||||||
const delta = (newRadiusPx - origRadius) * ratio;
|
const delta = (newRadiusPx - origRadius) * ratio;
|
||||||
|
@ -1531,7 +1532,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
||||||
* to the shape.
|
* to the shape.
|
||||||
*/
|
*/
|
||||||
getTransformPointAt(pageX, pageY) {
|
getTransformPointAt(pageX, pageY) {
|
||||||
const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } = this.transformedBoundingBox;
|
const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } =
|
||||||
|
this.transformedBoundingBox;
|
||||||
const { width, height } = this.currentDimensions;
|
const { width, height } = this.currentDimensions;
|
||||||
const zoom = getCurrentZoom(this.win);
|
const zoom = getCurrentZoom(this.win);
|
||||||
const clickRadiusX = BASE_MARKER_SIZE / zoom * 100 / width;
|
const clickRadiusX = BASE_MARKER_SIZE / zoom * 100 / width;
|
||||||
|
@ -1609,7 +1611,9 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
||||||
|
|
||||||
for (let i = 0; i < coordinates.length; i++) {
|
for (let i = 0; i < coordinates.length; i++) {
|
||||||
const [x1, y1] = coordinates[i];
|
const [x1, y1] = coordinates[i];
|
||||||
const [x2, y2] = (i === coordinates.length - 1) ? coordinates[0] : coordinates[i + 1];
|
const [x2, y2] = (i === coordinates.length - 1)
|
||||||
|
? coordinates[0]
|
||||||
|
: coordinates[i + 1];
|
||||||
// Get the distance between clicked point and line drawn between points 1 and 2
|
// Get the distance between clicked point and line drawn between points 1 and 2
|
||||||
// to check if the click was on the line between those two points.
|
// to check if the click was on the line between those two points.
|
||||||
const distance = distanceToLine(x1, y1, x2, y2, pageX, pageY);
|
const distance = distanceToLine(x1, y1, x2, y2, pageX, pageY);
|
||||||
|
@ -2291,7 +2295,8 @@ class ShapesHighlighter extends AutoRefreshHighlighter {
|
||||||
* @param {Number} zoom the zoom level of the window
|
* @param {Number} zoom the zoom level of the window
|
||||||
*/
|
*/
|
||||||
_updateTransformMode(width, height, zoom) {
|
_updateTransformMode(width, height, zoom) {
|
||||||
const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } = this.transformedBoundingBox;
|
const { nw, ne, sw, se, n, w, s, e, rotatePoint, center } =
|
||||||
|
this.transformedBoundingBox;
|
||||||
const boundingBox = this.getElement("bounding-box");
|
const boundingBox = this.getElement("bounding-box");
|
||||||
const path = `M${nw.join(" ")} L${ne.join(" ")} L${se.join(" ")} L${sw.join(" ")} Z`;
|
const path = `M${nw.join(" ")} L${ne.join(" ")} L${se.join(" ")} L${sw.join(" ")} Z`;
|
||||||
boundingBox.setAttribute("d", path);
|
boundingBox.setAttribute("d", path);
|
||||||
|
|
|
@ -294,7 +294,8 @@ function getCurrentMatrix(element, window) {
|
||||||
const borderBottom = parseFloat(computedStyle.borderBottomWidth);
|
const borderBottom = parseFloat(computedStyle.borderBottomWidth);
|
||||||
const borderLeft = parseFloat(computedStyle.borderLeftWidth);
|
const borderLeft = parseFloat(computedStyle.borderLeftWidth);
|
||||||
|
|
||||||
const nodeMatrix = getNodeTransformationMatrix(element, window.document.documentElement);
|
const nodeMatrix =
|
||||||
|
getNodeTransformationMatrix(element, window.document.documentElement);
|
||||||
|
|
||||||
let currentMatrix = identity();
|
let currentMatrix = identity();
|
||||||
let hasNodeTransformations = false;
|
let hasNodeTransformations = false;
|
||||||
|
|
|
@ -427,8 +427,9 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
|
||||||
try {
|
try {
|
||||||
// If the node is the child of a shadow host, we can not use an anonymous walker to
|
// If the node is the child of a shadow host, we can not use an anonymous walker to
|
||||||
// get the shadow host parent.
|
// get the shadow host parent.
|
||||||
const walker = node.isDirectShadowHostChild ? this.getNonAnonymousWalker(node.rawNode)
|
const walker = node.isDirectShadowHostChild
|
||||||
: this.getDocumentWalker(node.rawNode);
|
? this.getNonAnonymousWalker(node.rawNode)
|
||||||
|
: this.getDocumentWalker(node.rawNode);
|
||||||
parent = walker.parentNode();
|
parent = walker.parentNode();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// When getting the parent node for a child of a non-slotted shadow host child,
|
// When getting the parent node for a child of a non-slotted shadow host child,
|
||||||
|
|
|
@ -774,7 +774,8 @@ var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
|
||||||
// StyleSheetApplicableStateChanged events. See Document.webidl.
|
// StyleSheetApplicableStateChanged events. See Document.webidl.
|
||||||
doc.styleSheetChangeEventsEnabled = true;
|
doc.styleSheetChangeEventsEnabled = true;
|
||||||
|
|
||||||
const isChrome = Services.scriptSecurityManager.isSystemPrincipal(doc.nodePrincipal);
|
const isChrome =
|
||||||
|
Services.scriptSecurityManager.isSystemPrincipal(doc.nodePrincipal);
|
||||||
const styleSheets =
|
const styleSheets =
|
||||||
isChrome ? InspectorUtils.getAllStyleSheets(doc) : doc.styleSheets;
|
isChrome ? InspectorUtils.getAllStyleSheets(doc) : doc.styleSheets;
|
||||||
let actors = [];
|
let actors = [];
|
||||||
|
|
|
@ -750,12 +750,13 @@ var DebuggerServer = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const onMessageManagerClose = DevToolsUtils.makeInfallible((subject, topic, data) => {
|
const onMessageManagerClose =
|
||||||
if (subject == mm) {
|
DevToolsUtils.makeInfallible((subject, topic, data) => {
|
||||||
onClose();
|
if (subject == mm) {
|
||||||
connection.send({ from: actor.actor, type: "tabDetached" });
|
onClose();
|
||||||
}
|
connection.send({ from: actor.actor, type: "tabDetached" });
|
||||||
});
|
}
|
||||||
|
});
|
||||||
Services.obs.addObserver(onMessageManagerClose,
|
Services.obs.addObserver(onMessageManagerClose,
|
||||||
"message-manager-close");
|
"message-manager-close");
|
||||||
|
|
||||||
|
|
|
@ -211,7 +211,7 @@ const ProfilerManager = (function() {
|
||||||
* @return {object}
|
* @return {object}
|
||||||
*/
|
*/
|
||||||
getBufferInfo: function() {
|
getBufferInfo: function() {
|
||||||
let position = {}, totalSize = {}, generation = {};
|
const position = {}, totalSize = {}, generation = {};
|
||||||
Services.profiler.GetBufferInfo(position, totalSize, generation);
|
Services.profiler.GetBufferInfo(position, totalSize, generation);
|
||||||
return {
|
return {
|
||||||
position: position.value,
|
position: position.value,
|
||||||
|
|
|
@ -306,9 +306,9 @@ PerformanceRecorder.prototype = {
|
||||||
* A promise that is resolved once recording has started.
|
* A promise that is resolved once recording has started.
|
||||||
*/
|
*/
|
||||||
async startRecording(options) {
|
async startRecording(options) {
|
||||||
let profilerStart, timelineStart, memoryStart;
|
let timelineStart, memoryStart;
|
||||||
|
|
||||||
profilerStart = (async function() {
|
const profilerStart = (async function() {
|
||||||
const data = await this._profiler.isActive();
|
const data = await this._profiler.isActive();
|
||||||
if (data.isActive) {
|
if (data.isActive) {
|
||||||
return data;
|
return data;
|
||||||
|
|
|
@ -9,18 +9,17 @@
|
||||||
* Test that clients can catch errors in old style actors.
|
* Test that clients can catch errors in old style actors.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const ACTORS_URL = "chrome://mochitests/content/browser/devtools/server/tests/browser/error-actor.js";
|
const ACTORS_URL =
|
||||||
|
"chrome://mochitests/content/browser/devtools/server/tests/browser/error-actor.js";
|
||||||
|
|
||||||
async function test() {
|
async function test() {
|
||||||
let gClient;
|
|
||||||
|
|
||||||
DebuggerServer.init();
|
DebuggerServer.init();
|
||||||
DebuggerServer.registerAllActors();
|
DebuggerServer.registerAllActors();
|
||||||
|
|
||||||
DebuggerServer.addActors(ACTORS_URL);
|
DebuggerServer.addActors(ACTORS_URL);
|
||||||
|
|
||||||
const transport = DebuggerServer.connectPipe();
|
const transport = DebuggerServer.connectPipe();
|
||||||
gClient = new DebuggerClient(transport);
|
const gClient = new DebuggerClient(transport);
|
||||||
await gClient.connect();
|
await gClient.connect();
|
||||||
|
|
||||||
const { errorActor } = await gClient.listTabs();
|
const { errorActor } = await gClient.listTabs();
|
||||||
|
|
|
@ -108,7 +108,8 @@ const GRID_FRAGMENT_DATA = {
|
||||||
};
|
};
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const { client, walker, layout } = await initLayoutFrontForUrl(MAIN_DOMAIN + "grid.html");
|
const { client, walker, layout } =
|
||||||
|
await initLayoutFrontForUrl(MAIN_DOMAIN + "grid.html");
|
||||||
const grids = await layout.getGrids(walker.rootNode);
|
const grids = await layout.getGrids(walker.rootNode);
|
||||||
const grid = grids[0];
|
const grid = grids[0];
|
||||||
const { gridFragments } = grid;
|
const { gridFragments } = grid;
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
window.onload = () => {
|
window.onload = () => {
|
||||||
let canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
|
const canvas = document.querySelector("canvas"), ctx = canvas.getContext("2d");
|
||||||
canvas.width = 1000;
|
canvas.width = 1000;
|
||||||
canvas.height = 2000;
|
canvas.height = 2000;
|
||||||
ctx.fillStyle = "red";
|
ctx.fillStyle = "red";
|
||||||
|
|
|
@ -41,8 +41,6 @@ function test_nesting() {
|
||||||
let currentStep = 0;
|
let currentStep = 0;
|
||||||
|
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
let eventLoop;
|
|
||||||
|
|
||||||
executeSoon(function() {
|
executeSoon(function() {
|
||||||
// Should be at step 2
|
// Should be at step 2
|
||||||
Assert.equal(++currentStep, 2);
|
Assert.equal(++currentStep, 2);
|
||||||
|
@ -71,7 +69,7 @@ function test_nesting() {
|
||||||
Assert.equal(++currentStep, 1);
|
Assert.equal(++currentStep, 1);
|
||||||
// Should have only the unsafeSynchronize event loop
|
// Should have only the unsafeSynchronize event loop
|
||||||
Assert.equal(thread._nestedEventLoops.size, 1);
|
Assert.equal(thread._nestedEventLoops.size, 1);
|
||||||
eventLoop = thread._nestedEventLoops.push();
|
const eventLoop = thread._nestedEventLoops.push();
|
||||||
eventLoop.enter();
|
eventLoop.enter();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,8 @@ function test() {
|
||||||
// The prototype chain was not iterated if the object was inaccessible, so now check
|
// The prototype chain was not iterated if the object was inaccessible, so now check
|
||||||
// another object which inherits from the proxy, but was created in the debuggee.
|
// another object which inherits from the proxy, but was created in the debuggee.
|
||||||
const inheritsProxy2Client = gThreadClient.pauseGrip(inheritsProxy2Grip);
|
const inheritsProxy2Client = gThreadClient.pauseGrip(inheritsProxy2Grip);
|
||||||
const inheritsProxy2Response = await inheritsProxy2Client.getPrototypeAndProperties();
|
const inheritsProxy2Response =
|
||||||
|
await inheritsProxy2Client.getPrototypeAndProperties();
|
||||||
check_properties(inheritsProxy2Response.ownProperties, false, true);
|
check_properties(inheritsProxy2Response.ownProperties, false, true);
|
||||||
check_prototype(inheritsProxy2Response.prototype, false, true);
|
check_prototype(inheritsProxy2Response.prototype, false, true);
|
||||||
|
|
||||||
|
|
|
@ -604,17 +604,16 @@ function _hslValue(m1, m2, h) {
|
||||||
// Translated from nsColor.cpp. All three values are expected to be
|
// Translated from nsColor.cpp. All three values are expected to be
|
||||||
// in the range 0-1.
|
// in the range 0-1.
|
||||||
function hslToRGB([h, s, l]) {
|
function hslToRGB([h, s, l]) {
|
||||||
let r, g, b;
|
let m2;
|
||||||
let m1, m2;
|
|
||||||
if (l <= 0.5) {
|
if (l <= 0.5) {
|
||||||
m2 = l * (s + 1);
|
m2 = l * (s + 1);
|
||||||
} else {
|
} else {
|
||||||
m2 = l + s - l * s;
|
m2 = l + s - l * s;
|
||||||
}
|
}
|
||||||
m1 = l * 2 - m2;
|
const m1 = l * 2 - m2;
|
||||||
r = Math.round(255 * _hslValue(m1, m2, h + 1.0 / 3.0));
|
const r = Math.round(255 * _hslValue(m1, m2, h + 1.0 / 3.0));
|
||||||
g = Math.round(255 * _hslValue(m1, m2, h));
|
const g = Math.round(255 * _hslValue(m1, m2, h));
|
||||||
b = Math.round(255 * _hslValue(m1, m2, h - 1.0 / 3.0));
|
const b = Math.round(255 * _hslValue(m1, m2, h - 1.0 / 3.0));
|
||||||
return [r, g, b];
|
return [r, g, b];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1127,8 +1127,6 @@ Scanner.prototype = {
|
||||||
* least one character unless called when already at EOF.
|
* least one character unless called when already at EOF.
|
||||||
*/
|
*/
|
||||||
Next: function(aToken, aSkip) {
|
Next: function(aToken, aSkip) {
|
||||||
let ch;
|
|
||||||
|
|
||||||
// do this here so we don't have to do it in dozens of other places
|
// do this here so we don't have to do it in dozens of other places
|
||||||
aToken.mIdent = [];
|
aToken.mIdent = [];
|
||||||
aToken.mType = eCSSToken_Symbol;
|
aToken.mType = eCSSToken_Symbol;
|
||||||
|
@ -1137,7 +1135,7 @@ Scanner.prototype = {
|
||||||
this.mTokenLineOffset = this.mLineOffset;
|
this.mTokenLineOffset = this.mLineOffset;
|
||||||
this.mTokenLineNumber = this.mLineNumber;
|
this.mTokenLineNumber = this.mLineNumber;
|
||||||
|
|
||||||
ch = this.Peek();
|
const ch = this.Peek();
|
||||||
if (IsWhitespace(ch)) {
|
if (IsWhitespace(ch)) {
|
||||||
this.SkipWhitespace();
|
this.SkipWhitespace();
|
||||||
aToken.mType = eCSSToken_Whitespace;
|
aToken.mType = eCSSToken_Whitespace;
|
||||||
|
|
|
@ -15,7 +15,7 @@ function run_test() {
|
||||||
noStack: countBreakdown,
|
noStack: countBreakdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
let stack1, stack2, stack3, stack4, stack5;
|
let stack1, stack2, stack3, stack4;
|
||||||
|
|
||||||
(function a() {
|
(function a() {
|
||||||
(function b() {
|
(function b() {
|
||||||
|
@ -30,7 +30,7 @@ function run_test() {
|
||||||
}());
|
}());
|
||||||
}());
|
}());
|
||||||
|
|
||||||
stack5 = saveStack(1);
|
const stack5 = saveStack(1);
|
||||||
|
|
||||||
const REPORT = new Map([
|
const REPORT = new Map([
|
||||||
[stack1, { bytes: 10, count: 1 }],
|
[stack1, { bytes: 10, count: 1 }],
|
||||||
|
|
|
@ -13,7 +13,7 @@ function run_test() {
|
||||||
noStack: countBreakdown,
|
noStack: countBreakdown,
|
||||||
};
|
};
|
||||||
|
|
||||||
let stack1, stack2, stack3, stack4, stack5;
|
let stack1, stack2, stack3, stack4;
|
||||||
|
|
||||||
(function foo() {
|
(function foo() {
|
||||||
(function bar() {
|
(function bar() {
|
||||||
|
@ -28,7 +28,7 @@ function run_test() {
|
||||||
stack4 = saveStack(2);
|
stack4 = saveStack(2);
|
||||||
}());
|
}());
|
||||||
|
|
||||||
stack5 = saveStack(1);
|
const stack5 = saveStack(1);
|
||||||
|
|
||||||
const REPORT = new Map([
|
const REPORT = new Map([
|
||||||
[stack1, { bytes: 10, count: 1 }],
|
[stack1, { bytes: 10, count: 1 }],
|
||||||
|
|
|
@ -120,9 +120,11 @@ Server.defaultAllowConnection = ({ client, server }) => {
|
||||||
const title = L10N.getStr("remoteIncomingPromptTitle");
|
const title = L10N.getStr("remoteIncomingPromptTitle");
|
||||||
const header = L10N.getStr("remoteIncomingPromptHeader");
|
const header = L10N.getStr("remoteIncomingPromptHeader");
|
||||||
const clientEndpoint = `${client.host}:${client.port}`;
|
const clientEndpoint = `${client.host}:${client.port}`;
|
||||||
const clientMsg = L10N.getFormatStr("remoteIncomingPromptClientEndpoint", clientEndpoint);
|
const clientMsg =
|
||||||
|
L10N.getFormatStr("remoteIncomingPromptClientEndpoint", clientEndpoint);
|
||||||
const serverEndpoint = `${server.host}:${server.port}`;
|
const serverEndpoint = `${server.host}:${server.port}`;
|
||||||
const serverMsg = L10N.getFormatStr("remoteIncomingPromptServerEndpoint", serverEndpoint);
|
const serverMsg =
|
||||||
|
L10N.getFormatStr("remoteIncomingPromptServerEndpoint", serverEndpoint);
|
||||||
const footer = L10N.getStr("remoteIncomingPromptFooter");
|
const footer = L10N.getStr("remoteIncomingPromptFooter");
|
||||||
const msg = `${header}\n\n${clientMsg}\n${serverMsg}\n\n${footer}`;
|
const msg = `${header}\n\n${clientMsg}\n${serverMsg}\n\n${footer}`;
|
||||||
const disableButton = L10N.getStr("remoteIncomingPromptDisable");
|
const disableButton = L10N.getStr("remoteIncomingPromptDisable");
|
||||||
|
|
|
@ -54,7 +54,6 @@ async function getSystemInfo() {
|
||||||
height,
|
height,
|
||||||
physicalWidth,
|
physicalWidth,
|
||||||
physicalHeight,
|
physicalHeight,
|
||||||
os,
|
|
||||||
brandName;
|
brandName;
|
||||||
const appid = appInfo.ID;
|
const appid = appInfo.ID;
|
||||||
const apptype = APP_MAP[appid];
|
const apptype = APP_MAP[appid];
|
||||||
|
@ -62,7 +61,7 @@ async function getSystemInfo() {
|
||||||
const hardware = "unknown";
|
const hardware = "unknown";
|
||||||
let version = "unknown";
|
let version = "unknown";
|
||||||
|
|
||||||
os = appInfo.OS;
|
const os = appInfo.OS;
|
||||||
version = appInfo.version;
|
version = appInfo.version;
|
||||||
|
|
||||||
const bundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
const bundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
|
||||||
|
|
|
@ -9,8 +9,10 @@ const { localizeMarkup, LocalizationHelper } = require("devtools/shared/l10n");
|
||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
info("Check that the strings used for this test are still valid");
|
info("Check that the strings used for this test are still valid");
|
||||||
const STARTUP_L10N = new LocalizationHelper("devtools/client/locales/startup.properties");
|
const STARTUP_L10N =
|
||||||
const TOOLBOX_L10N = new LocalizationHelper("devtools/client/locales/toolbox.properties");
|
new LocalizationHelper("devtools/client/locales/startup.properties");
|
||||||
|
const TOOLBOX_L10N =
|
||||||
|
new LocalizationHelper("devtools/client/locales/toolbox.properties");
|
||||||
const str1 = STARTUP_L10N.getStr("inspector.label");
|
const str1 = STARTUP_L10N.getStr("inspector.label");
|
||||||
const str2 = STARTUP_L10N.getStr("inspector.accesskey");
|
const str2 = STARTUP_L10N.getStr("inspector.accesskey");
|
||||||
const str3 = TOOLBOX_L10N.getStr("toolbox.defaultTitle");
|
const str3 = TOOLBOX_L10N.getStr("toolbox.defaultTitle");
|
||||||
|
|
|
@ -61,7 +61,7 @@ const TESTS = {
|
||||||
},
|
},
|
||||||
|
|
||||||
testAllArgumentsArePassed() {
|
testAllArgumentsArePassed() {
|
||||||
let foo = { name: "foo" }, bar = "bar";
|
const foo = { name: "foo" }, bar = "bar";
|
||||||
const target = { name: "target" };
|
const target = { name: "target" };
|
||||||
|
|
||||||
on(target, "message", (a, b) => {
|
on(target, "message", (a, b) => {
|
||||||
|
@ -163,8 +163,8 @@ const TESTS = {
|
||||||
},
|
},
|
||||||
|
|
||||||
testFalsyArgumentsAreFine() {
|
testFalsyArgumentsAreFine() {
|
||||||
let type, listener, actual = [];
|
let type, listener;
|
||||||
const target = { name: "target" };
|
const target = { name: "target" }, actual = [];
|
||||||
on(target, "bar", () => actual.push(0));
|
on(target, "bar", () => actual.push(0));
|
||||||
|
|
||||||
off(target, "bar", listener);
|
off(target, "bar", listener);
|
||||||
|
|
|
@ -15,7 +15,8 @@ add_task(async function() {
|
||||||
const closeButton = doc.getElementById("close");
|
const closeButton = doc.getElementById("close");
|
||||||
ok(closeButton, "close button is displayed");
|
ok(closeButton, "close button is displayed");
|
||||||
|
|
||||||
const onWindowUnload = new Promise(r => win.addEventListener("unload", r, {once: true}));
|
const onWindowUnload =
|
||||||
|
new Promise(r => win.addEventListener("unload", r, {once: true}));
|
||||||
info("Click on the install button to enable DevTools.");
|
info("Click on the install button to enable DevTools.");
|
||||||
EventUtils.synthesizeMouseAtCenter(closeButton, {}, win);
|
EventUtils.synthesizeMouseAtCenter(closeButton, {}, win);
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче