Bug 1146935 - StyleEditor: Respect the transition preference when a linked CSS file has changed on disk. r=bgrins

This should fix intermittent browser_styleeditor_sourcemap_watching.js
which was disabling transitions to avoid races between the transition
finishing and the 'style-applied' event to be sent from the server.

--HG--
extra : transplant_source : %1B%AB1%F3%23%28%85%0DZLe%9B%9E-%EEH%F54m%99
This commit is contained in:
Sami Jaktholm 2015-09-19 11:47:54 +03:00
Родитель 5443426946
Коммит 62bdd4961b
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -190,6 +190,15 @@ StyleSheetEditor.prototype = {
return this._friendlyName;
},
/**
* Check if transitions are enabled for style changes.
*
* @return Boolean
*/
get transitionsEnabled() {
return Services.prefs.getBoolPref(TRANSITION_PREF);
},
/**
* If this is an original source, get the path of the CSS file it generated.
*/
@ -495,9 +504,7 @@ StyleSheetEditor.prototype = {
this._state.text = this.sourceEditor.getText();
}
let transitionsEnabled = Services.prefs.getBoolPref(TRANSITION_PREF);
this.styleSheet.update(this._state.text, transitionsEnabled)
this.styleSheet.update(this._state.text, this.transitionsEnabled)
.then(null, Cu.reportError);
},
@ -683,7 +690,7 @@ StyleSheetEditor.prototype = {
let text = decoder.decode(array);
let relatedSheet = this.styleSheet.relatedStyleSheet;
relatedSheet.update(text, true);
relatedSheet.update(text, this.transitionsEnabled);
}, this.markLinkedFileBroken);
},