Bug 911678 - Inspector - inline style rules do not populate the CSSRuleView immediately. r=miker

This commit is contained in:
Brian Grinstead
2013-10-15 07:09:49 -05:00
parent e6a6bca8e3
commit dbc77152ce
5 changed files with 188 additions and 94 deletions

View File

@@ -387,6 +387,7 @@ MarkupView.prototype = {
* Mutation observer used for included nodes.
*/
_mutationObserver: function(aMutations) {
let requiresLayoutChange = false;
for (let mutation of aMutations) {
let type = mutation.type;
let target = mutation.target;
@@ -409,6 +410,11 @@ MarkupView.prototype = {
}
if (type === "attributes" || type === "characterData") {
container.update();
// Auto refresh style properties on selected node when they change.
if (type === "attributes" && container.selected) {
requiresLayoutChange = true;
}
} else if (type === "childList") {
container.childrenDirty = true;
// Update the children to take care of changes in the DOM
@@ -417,6 +423,10 @@ MarkupView.prototype = {
this._updateChildren(container, {flash: true});
}
}
if (requiresLayoutChange) {
this._inspector.immediateLayoutChange();
}
this._waitForChildren().then(() => {
this._flashMutatedNodes(aMutations);
this._inspector.emit("markupmutation");