Bug 1496055 - Part 1: Remove outdated checks for StyleRuleActor.modifySelectorUnmatched; r=gl

Since Firefox 41 it has been possible to add a rule with a selector
which does not match an element. The checks of the existence of this
functionality are outdated and can be safely removed.

No supported old versions of Firefox make use of the previous
functionality anymore.

MozReview-Commit-ID: D5ZP09Ckeqd

Differential Revision: https://phabricator.services.mozilla.com/D7597

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Razvan Caliman 2018-10-03 13:52:16 +00:00
Родитель 95e70c18bb
Коммит 02deacb80d
3 изменённых файлов: 3 добавлений и 26 удалений

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

@ -653,23 +653,12 @@ RuleEditor.prototype = {
const ruleView = this.ruleView;
const elementStyle = ruleView._elementStyle;
const element = elementStyle.element;
const supportsUnmatchedRules =
this.rule.domRule.supportsModifySelectorUnmatched;
this.isEditing = true;
try {
const response = await this.rule.domRule.modifySelector(element, value);
if (!supportsUnmatchedRules) {
this.isEditing = false;
if (response) {
this.ruleView.refreshPanel();
}
return;
}
// We recompute the list of applied styles, because editing a
// selector might cause this rule's position to change.
const applied = await elementStyle.pageStyle.getApplied(element, {

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

@ -1073,9 +1073,6 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
line: this.line || undefined,
column: this.column,
traits: {
// Whether the style rule actor implements the modifySelector2 method
// that allows for unmatched rule to be added
modifySelectorUnmatched: true,
// Whether the style rule actor implements the setRuleText
// method.
canSetRuleText: this.canSetRuleText,

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

@ -218,10 +218,6 @@ const StyleRuleFront = FrontClassWithSpec(styleRuleSpec, {
return sheet ? sheet.nodeHref : "";
},
get supportsModifySelectorUnmatched() {
return this._form.traits && this._form.traits.modifySelectorUnmatched;
},
get canSetRuleText() {
return this._form.traits && this._form.traits.canSetRuleText;
},
@ -270,15 +266,10 @@ const StyleRuleFront = FrontClassWithSpec(styleRuleSpec, {
modifySelector: custom(async function(node, value) {
let response;
if (this.supportsModifySelectorUnmatched) {
// If the debugee supports adding unmatched rules (post FF41)
if (this.canSetRuleText) {
response = await this.modifySelector2(node, value, true);
} else {
response = await this.modifySelector2(node, value);
}
if (this.canSetRuleText) {
response = await this.modifySelector2(node, value, true);
} else {
response = await this._modifySelector(value);
response = await this.modifySelector2(node, value);
}
if (response.ruleProps) {