Bug 1499049 - (Part 6) Support !important in changed CSS property values; r=pbro

Depends on D8722

Include the "!importat" priority flag when tracking changes to CSS declarations.

Differential Revision: https://phabricator.services.mozilla.com/D8967
This commit is contained in:
Razvan Caliman
2018-10-25 11:06:56 +00:00
parent 0c0e1a765b
commit b8dbbe9451
2 changed files with 14 additions and 5 deletions

View File

@@ -875,6 +875,7 @@ RuleRewriter.prototype = {
setPropertyEnabled: function(index, name, isEnabled) {
this.completeInitialization(index);
const decl = this.decl;
const priority = decl.priority;
let copyOffset = decl.offsets[1];
if (isEnabled) {
// Enable it. First see if the comment start can be deleted.
@@ -918,9 +919,9 @@ RuleRewriter.prototype = {
this.completeCopying(copyOffset);
if (isEnabled) {
this.modifications.push({ type: "set", index, name, value: decl.value });
this.modifications.push({ type: "set", index, name, value: decl.value, priority });
} else {
this.modifications.push({ type: "remove", index, name });
this.modifications.push({ type: "remove", index, name, priority });
}
},