Bug 1434217 - Remove unused inspector actor traits;r=bgrins

Inspector actor traits were used for backward compatibility, with
versions of Firefox older than 45. Our policy is to support servers
up to the last ESR version, which is 52 at the moment so these
should be safe to remove.

MozReview-Commit-ID: 6MwUp8vbW29

--HG--
extra : rebase_source : b36799130e66e4abdaee628d48ad1b056bc1afcd
This commit is contained in:
Julian Descottes 2018-01-30 10:49:24 +01:00
Родитель 235145b016
Коммит 6683646ba1
4 изменённых файлов: 3 добавлений и 65 удалений

Просмотреть файл

@ -2579,18 +2579,6 @@ Toolbox.prototype = {
// in the initialization process can throw errors.
yield this._initInspector;
// Releasing the walker (if it has been created)
// This can fail, but in any case, we want to continue destroying the
// inspector/highlighter/selection
// FF42+: Inspector actor starts managing Walker actor and auto destroy it.
if (this._walker && !this.walker.traits.autoReleased) {
try {
yield this._walker.release();
} catch (e) {
// Do nothing;
}
}
yield this.highlighterUtils.stopPicker();
yield this._inspector.destroy();
if (this._highlighter) {

Просмотреть файл

@ -189,18 +189,7 @@ var WalkerActor = protocol.ActorClassWithSpec(walkerSpec, {
return {
actor: this.actorID,
root: this.rootNode.form(),
traits: {
// FF42+ Inspector starts managing the Walker, while the inspector also
// starts cleaning itself up automatically on client disconnection.
// So that there is no need to manually release the walker anymore.
autoReleased: true,
// XXX: It seems silly that we need to tell the front which capabilities
// its actor has in this way when the target can use actorHasMethod. If
// this was ported to the protocol (Bug 1157048) we could call that
// inside of custom front methods and not need to do traits for this.
multiFrameQuerySelectorAll: true,
textSearch: true,
}
traits: {}
};
},

Просмотреть файл

@ -168,38 +168,6 @@ window.onload = function () {
runNextTest();
});
addAsyncTest(function* testBackwardsCompat() {
info("Simulating a server that doesn't have the new search functionality.");
walkerFront.traits.textSearch = false;
let front = yield walkerFront.querySelector(walkerFront.rootNode, "h1");
let results = yield walkerFront.search("h1");
isDeeply(results, {
node: front,
type: "selector",
resultsIndex: 0,
resultsLength: 1
}, "Only querySelectorAll results being returned");
// Clear search data to remove result state on the front
yield walkerFront.search("");
// Reset the normal textSearch behavior
walkerFront.traits.textSearch = true;
results = yield walkerFront.search("h1");
isDeeply(results, {
node: front,
type: "search",
resultsIndex: 0,
resultsLength: 3
}, "Other results being included");
// Clear search data to remove result state on the front
yield walkerFront.search("");
runNextTest();
});
runNextTest();
};
</script>

Просмотреть файл

@ -213,16 +213,9 @@ const WalkerFront = FrontClassWithSpec(walkerSpec, {
let searchData = this.searchData = this.searchData || { };
let selectorOnly = !!options.selectorOnly;
// Backwards compat. Use selector only search if the new
// search functionality isn't implemented, or if the caller (tests)
// want it.
if (selectorOnly || !this.traits.textSearch) {
if (selectorOnly) {
searchType = "selector";
if (this.traits.multiFrameQuerySelectorAll) {
nodeList = yield this.multiFrameQuerySelectorAll(query);
} else {
nodeList = yield this.querySelectorAll(this.rootNode, query);
}
nodeList = yield this.multiFrameQuerySelectorAll(query);
} else {
searchType = "search";
let result = yield this._search(query, options);