mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-23 10:15:41 +00:00
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:
parent
95e70c18bb
commit
02deacb80d
@ -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,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];
|
||||
|
Loading…
Reference in New Issue
Block a user