Bug 1067318 - update markup.js for live HTML edit
MozReview-Commit-ID: L4Mk7EYD5tQ
--- a/devtools/client/inspector/markup/markup.js
+++ b/devtools/client/inspector/markup/markup.js
@@ -538,24 +538,29 @@ MarkupView.prototype = {
* - if it's "test" (this is a special case for mochitest. In tests, we often
* need to select elements but don't necessarily want the highlighter to come
* and go after a delay as this might break test scenarios)
* We also do not want to start a brief highlight timeout if the node is
* already being hovered over, since in that case it will already be
* highlighted.
*/
_shouldNewSelectionBeHighlighted: function () {
+ if (this.editedNode) {
+ return false;
+ }
+
let reason = this.inspector.selection.reason;
let unwantedReasons = [
"inspector-open",
"navigateaway",
"nodeselected",
"test"
];
let isHighlight = this._hoveredNode === this.inspector.selection.nodeFront;
+
return !isHighlight && reason && unwantedReasons.indexOf(reason) === -1;
},
/**
* React to new-node-front selection events.
* Highlights the node if needed, and make sure it is shown and selected in
* the view.
*/
@@ -1436,16 +1441,17 @@ MarkupView.prototype = {
this.updateNodeOuterHTML(editedNode, value, oldValue);
};
this.htmlEditor.show(container.tagLine, oldValue);
this.htmlEditor.on("change", onHtmlEditorChange);
this.htmlEditor.once("popuphidden", (e, commit, value) => {
this.htmlEditor.off("change", onHtmlEditorChange);
+ this.editedNode = null;
// Need to focus the <html> element instead of the frame / window
// in order to give keyboard focus back to doc (from editor).
this.doc.documentElement.focus();
if (commit) {
this.updateNodeOuterHTML(node, value, oldValue);
}