Bug 1391994 Part 2: Use the new Element::setAttributeSystem and ::setAttributeSystemNS methods for rule changes made in the inspector.
MozReview-Commit-ID: 2AvyxB3Jziy
--- a/devtools/server/actors/inspector.js
+++ b/devtools/server/actors/inspector.js
@@ -743,20 +743,20 @@ var NodeActor = exports.NodeActor = prot
if (change.newValue == null) {
if (change.attributeNamespace) {
rawNode.removeAttributeNS(change.attributeNamespace,
change.attributeName);
} else {
rawNode.removeAttribute(change.attributeName);
}
} else if (change.attributeNamespace) {
- rawNode.setAttributeNS(change.attributeNamespace, change.attributeName,
+ rawNode.setAttributeSystemNS(change.attributeNamespace, change.attributeName,
change.newValue);
} else {
- rawNode.setAttribute(change.attributeName, change.newValue);
+ rawNode.setAttributeSystem(change.attributeName, change.newValue);
}
}
},
/**
* Given the font and fill style, get the image data of a canvas with the
* preview text and font.
* Returns an imageData object with the actual data being a LongStringActor
--- a/devtools/server/actors/styles.js
+++ b/devtools/server/actors/styles.js
@@ -1266,17 +1266,17 @@ var StyleRuleActor = protocol.ActorClass
*/
setRuleText: Task.async(function* (newText) {
if (!this.canSetRuleText) {
throw new Error("invalid call to setRuleText");
}
if (this.type === ELEMENT_STYLE) {
// For element style rules, set the node's style attribute.
- this.rawNode.setAttribute("style", newText);
+ this.rawNode.setAttributeSystem("style", newText);
} else {
// For stylesheet rules, set the text in the stylesheet.
let parentStyleSheet = this.pageStyle._sheetRef(this._parentSheet);
let {str: cssText} = yield parentStyleSheet.getText();
let {offset, text} = getRuleText(cssText, this.line, this.column);
cssText = cssText.substring(0, offset) + newText +
cssText.substring(offset + text.length);