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
parent 95e70c18bb
commit 02deacb80d
3 changed files with 3 additions and 26 deletions

View File

@ -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, {

View File

@ -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,

View File

@ -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,16 +266,11 @@ 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);
}
} else {
response = await this._modifySelector(value);
}
if (response.ruleProps) {
response.ruleProps = response.ruleProps.entries[0];