зеркало из https://github.com/mozilla/gecko-dev.git
Bug 966242 - Get rid of flicker when rule view is refreshed;r=pbrosset
This commit is contained in:
Родитель
1f23d32af8
Коммит
a9161a7362
|
@ -1469,24 +1469,26 @@ CssRuleView.prototype = {
|
|||
/**
|
||||
* Update the rules for the currently highlighted element.
|
||||
*/
|
||||
nodeChanged: function() {
|
||||
refreshPanel: function() {
|
||||
// Ignore refreshes during editing or when no element is selected.
|
||||
if (this.isEditing || !this._elementStyle) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._clearRules();
|
||||
|
||||
// Repopulate the element style.
|
||||
this._populate();
|
||||
this._populate(true);
|
||||
},
|
||||
|
||||
_populate: function() {
|
||||
_populate: function(clearRules = false) {
|
||||
let elementStyle = this._elementStyle;
|
||||
return this._elementStyle.populate().then(() => {
|
||||
if (this._elementStyle != elementStyle) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (clearRules) {
|
||||
this._clearRules();
|
||||
}
|
||||
this._createEditors();
|
||||
|
||||
// Notify anyone that cares that we refreshed.
|
||||
|
|
|
@ -109,7 +109,7 @@ RuleViewTool.prototype = {
|
|||
},
|
||||
|
||||
refresh: function RVT_refresh() {
|
||||
this.view.nodeChanged();
|
||||
this.view.refreshPanel();
|
||||
},
|
||||
|
||||
destroy: function RVT_destroy() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче