mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 04:41:11 +00:00
Bug 1842197 - [devtools] Limit reads of devtools.inspector.ruleview.inline-compatibility-warning.enabled. r=devtools-reviewers,ochameau, a=pascalc
We already have a pref observer for the pref, so we can store the pref value on the RuleView instance and check this property instead of using Services.prefs. Differential Revision: https://phabricator.services.mozilla.com/D183001
This commit is contained in:
parent
8add6a89b0
commit
b34f339376
@ -243,6 +243,8 @@ function CssRuleView(inspector, document, store) {
|
||||
this._handleDefaultColorUnitPrefChange
|
||||
);
|
||||
this._prefObserver.on(PREF_DRAGGABLE, this._handleDraggablePrefChange);
|
||||
// Initialize value of this.draggablePropertiesEnabled
|
||||
this._handleDraggablePrefChange();
|
||||
|
||||
this.pseudoClassCheckboxes = this._createPseudoClassCheckboxes();
|
||||
this.showUserAgentStyles = Services.prefs.getBoolPref(PREF_UA_STYLES);
|
||||
@ -725,6 +727,10 @@ CssRuleView.prototype = {
|
||||
},
|
||||
|
||||
_handleDraggablePrefChange() {
|
||||
this.draggablePropertiesEnabled = Services.prefs.getBoolPref(
|
||||
PREF_DRAGGABLE,
|
||||
false
|
||||
);
|
||||
// This event is consumed by text-property-editor instances in order to
|
||||
// update their draggable behavior. Preferences observer are costly, so
|
||||
// we are forwarding the preference update via the EventEmitter.
|
||||
|
@ -1387,12 +1387,7 @@ TextPropertyEditor.prototype = {
|
||||
*/
|
||||
_isDraggableProperty(textProperty) {
|
||||
// Check if the feature is explicitly disabled.
|
||||
if (
|
||||
!Services.prefs.getBoolPref(
|
||||
"devtools.inspector.draggable_properties",
|
||||
false
|
||||
)
|
||||
) {
|
||||
if (!this.ruleView.draggablePropertiesEnabled) {
|
||||
return false;
|
||||
}
|
||||
// temporary way of fixing the bug when editing inline styles
|
||||
|
Loading…
Reference in New Issue
Block a user