зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 3ab8cedcdaf0 (bug 1382601) for talos g2 failures on /markup.js
--HG-- extra : rebase_source : debcafd996d5638bde8c3c1bd95305138404f8ef
This commit is contained in:
Родитель
52ebf2b3ea
Коммит
d7db70bc02
|
@ -56,7 +56,7 @@ function isNodeVisible(node) {
|
|||
*/
|
||||
function waitForUpdate(inspector, waitForSelectionUpdate) {
|
||||
return new Promise(resolve => {
|
||||
inspector.on("boxmodel-view-updated", function onUpdate(reasons) {
|
||||
inspector.on("boxmodel-view-updated", function onUpdate(e, reasons) {
|
||||
// Wait for another update event if we are waiting for a selection related event.
|
||||
if (waitForSelectionUpdate && !reasons.includes("new-selection")) {
|
||||
return;
|
||||
|
|
|
@ -15,7 +15,7 @@ const MAX_LABEL_LENGTH = 40;
|
|||
const NS_XHTML = "http://www.w3.org/1999/xhtml";
|
||||
const SCROLL_REPEAT_MS = 100;
|
||||
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
|
||||
|
||||
// Some margin may be required for visible element detection.
|
||||
|
@ -401,12 +401,11 @@ HTMLBreadcrumbs.prototype = {
|
|||
this.breadcrumbsWidgetItemId = 0;
|
||||
|
||||
this.update = this.update.bind(this);
|
||||
this.updateWithMutations = this.updateWithMutations.bind(this);
|
||||
this.updateSelectors = this.updateSelectors.bind(this);
|
||||
this.selection.on("new-node-front", this.update);
|
||||
this.selection.on("pseudoclass", this.updateSelectors);
|
||||
this.selection.on("attribute-changed", this.updateSelectors);
|
||||
this.inspector.on("markupmutation", this.updateWithMutations);
|
||||
this.inspector.on("markupmutation", this.update);
|
||||
this.update();
|
||||
},
|
||||
|
||||
|
@ -613,7 +612,7 @@ HTMLBreadcrumbs.prototype = {
|
|||
this.selection.off("new-node-front", this.update);
|
||||
this.selection.off("pseudoclass", this.updateSelectors);
|
||||
this.selection.off("attribute-changed", this.updateSelectors);
|
||||
this.inspector.off("markupmutation", this.updateWithMutations);
|
||||
this.inspector.off("markupmutation", this.update);
|
||||
|
||||
this.container.removeEventListener("click", this, true);
|
||||
this.container.removeEventListener("mouseover", this, true);
|
||||
|
@ -830,16 +829,6 @@ HTMLBreadcrumbs.prototype = {
|
|||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the breadcrumbs display when a new node is selected and there are
|
||||
* mutations.
|
||||
* @param {Array} mutations An array of mutations in case this was called as
|
||||
* the "markupmutation" event listener.
|
||||
*/
|
||||
updateWithMutations(mutations) {
|
||||
return this.update("markupmutation", mutations);
|
||||
},
|
||||
|
||||
/**
|
||||
* Update the breadcrumbs display when a new node is selected.
|
||||
* @param {String} reason The reason for the update, if any.
|
||||
|
|
|
@ -8,7 +8,7 @@ const promise = require("promise");
|
|||
const {Task} = require("devtools/shared/task");
|
||||
const {KeyCodes} = require("devtools/client/shared/keycodes");
|
||||
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
const AutocompletePopup = require("devtools/client/shared/autocomplete-popup");
|
||||
const Services = require("Services");
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
const Services = require("Services");
|
||||
const promise = require("promise");
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
const {executeSoon} = require("devtools/shared/DevToolsUtils");
|
||||
const {Task} = require("devtools/shared/task");
|
||||
const {PrefObserver} = require("devtools/client/shared/prefs");
|
||||
|
@ -123,7 +123,6 @@ function Inspector(toolbox) {
|
|||
this._onBeforeNavigate = this._onBeforeNavigate.bind(this);
|
||||
this._onMarkupFrameLoad = this._onMarkupFrameLoad.bind(this);
|
||||
this._updateSearchResultsLabel = this._updateSearchResultsLabel.bind(this);
|
||||
this._clearSearchResultsLabel = this._clearSearchResultsLabel.bind(this);
|
||||
|
||||
this.onDetached = this.onDetached.bind(this);
|
||||
this.onMarkupLoaded = this.onMarkupLoaded.bind(this);
|
||||
|
@ -384,7 +383,7 @@ Inspector.prototype = {
|
|||
this.searchResultsLabel = this.panelDoc.getElementById("inspector-searchlabel");
|
||||
|
||||
this.search = new InspectorSearch(this, this.searchBox, this.searchClearButton);
|
||||
this.search.on("search-cleared", this._clearSearchResultsLabel);
|
||||
this.search.on("search-cleared", this._updateSearchResultsLabel);
|
||||
this.search.on("search-result", this._updateSearchResultsLabel);
|
||||
|
||||
let shortcuts = new KeyShortcuts({
|
||||
|
@ -406,13 +405,9 @@ Inspector.prototype = {
|
|||
return this.search.autocompleter;
|
||||
},
|
||||
|
||||
_clearSearchResultsLabel: function(result) {
|
||||
return this._updateSearchResultsLabel(result, true);
|
||||
},
|
||||
|
||||
_updateSearchResultsLabel: function(result, clear = false) {
|
||||
_updateSearchResultsLabel: function(event, result) {
|
||||
let str = "";
|
||||
if (!clear) {
|
||||
if (event !== "search-cleared") {
|
||||
if (result) {
|
||||
str = INSPECTOR_L10N.getFormatStr(
|
||||
"inspector.searchResultsCount2", result.resultsIndex + 1, result.resultsLength);
|
||||
|
@ -564,7 +559,7 @@ Inspector.prototype = {
|
|||
this.toolbox.emit("inspector-sidebar-resized", { width, height });
|
||||
},
|
||||
|
||||
onSidebarSelect: function(toolId) {
|
||||
onSidebarSelect: function(event, toolId) {
|
||||
// Save the currently selected sidebar panel
|
||||
Services.prefs.setCharPref("devtools.inspector.activeSidebar", toolId);
|
||||
|
||||
|
|
|
@ -1283,7 +1283,7 @@ MarkupView.prototype = {
|
|||
let parentContainer = this.getContainer(removedNode.parentNode());
|
||||
let childIndex = parentContainer.getChildContainers().indexOf(oldContainer);
|
||||
|
||||
let onMutations = this._removedNodeObserver = mutations => {
|
||||
let onMutations = this._removedNodeObserver = (e, mutations) => {
|
||||
let isNodeRemovalMutation = false;
|
||||
for (let mutation of mutations) {
|
||||
let containsRemovedNode = mutation.removed &&
|
||||
|
|
|
@ -272,6 +272,6 @@ add_task(function* () {
|
|||
});
|
||||
|
||||
// Record all containers that are created dynamically into elms object.
|
||||
function memorizeContainer(container) {
|
||||
function memorizeContainer(event, container) {
|
||||
elms[`container-${containerID++}`] = container;
|
||||
}
|
||||
|
|
|
@ -319,7 +319,7 @@ add_task(function* () {
|
|||
// event or possibly in multiples.
|
||||
let seenMutations = 0;
|
||||
let promise = new Promise(resolve => {
|
||||
inspector.on("markupmutation", function onmutation(mutations) {
|
||||
inspector.on("markupmutation", function onmutation(e, mutations) {
|
||||
seenMutations += mutations.length;
|
||||
info("Receieved " + seenMutations +
|
||||
" mutations, expecting at least " + numMutations);
|
||||
|
|
|
@ -547,7 +547,7 @@ ElementEditor.prototype = {
|
|||
.filter(el => el.style.display != "none");
|
||||
let attributeIndex = activeAttrs.indexOf(attrNode);
|
||||
|
||||
let onMutations = this._editedAttributeObserver = mutations => {
|
||||
let onMutations = this._editedAttributeObserver = (e, mutations) => {
|
||||
let isDeletedAttribute = false;
|
||||
let isNewAttribute = false;
|
||||
|
||||
|
|
|
@ -478,7 +478,7 @@ function* sendKeysAndWaitForFocus(view, element, keys) {
|
|||
*/
|
||||
function waitForStyleModification(inspector) {
|
||||
return new Promise(function(resolve) {
|
||||
function checkForStyleModification(mutations) {
|
||||
function checkForStyleModification(name, mutations) {
|
||||
for (let mutation of mutations) {
|
||||
if (mutation.type === "attributes" && mutation.attributeName === "style") {
|
||||
inspector.off("markupmutation", checkForStyleModification);
|
||||
|
|
|
@ -169,7 +169,7 @@ ClassListPreviewerModel.prototype = {
|
|||
return mod.apply();
|
||||
},
|
||||
|
||||
onMutations(mutations) {
|
||||
onMutations(e, mutations) {
|
||||
for (let {type, target, attributeName} of mutations) {
|
||||
// Only care if this mutation is for the class attribute.
|
||||
if (type !== "attributes" || attributeName !== "class") {
|
||||
|
|
|
@ -261,7 +261,7 @@ DomNodePreview.prototype = {
|
|||
}
|
||||
},
|
||||
|
||||
onMarkupMutations: function(mutations) {
|
||||
onMarkupMutations: function(e, mutations) {
|
||||
if (!this.nodeFront) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -861,7 +861,7 @@ class HighlightersOverlay {
|
|||
* Handler function for "markupmutation" events. Hides the flexbox/grid/shapes
|
||||
* highlighter if the flexbox/grid/shapes container is no longer in the DOM tree.
|
||||
*/
|
||||
async onMarkupMutation(mutations) {
|
||||
async onMarkupMutation(evt, mutations) {
|
||||
let hasInterestingMutation = mutations.some(mut => mut.type === "childList");
|
||||
if (!hasInterestingMutation) {
|
||||
// Bail out if the mutations did not remove nodes, or if no grid highlighter is
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var EventEmitter = require("devtools/shared/event-emitter");
|
||||
var EventEmitter = require("devtools/shared/old-event-emitter");
|
||||
var Telemetry = require("devtools/client/shared/telemetry");
|
||||
var { Task } = require("devtools/shared/task");
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче