From 62bdd4961b5ed99321ba632e65bfb42665033573 Mon Sep 17 00:00:00 2001 From: Sami Jaktholm Date: Sat, 19 Sep 2015 11:47:54 +0300 Subject: [PATCH] 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 --- devtools/client/styleeditor/StyleSheetEditor.jsm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/devtools/client/styleeditor/StyleSheetEditor.jsm b/devtools/client/styleeditor/StyleSheetEditor.jsm index 1d1339447d54..4354b1e1225d 100644 --- a/devtools/client/styleeditor/StyleSheetEditor.jsm +++ b/devtools/client/styleeditor/StyleSheetEditor.jsm @@ -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); },