diff --git a/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js b/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js index 050c132f68c6..2c88ef02a92c 100644 --- a/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js +++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js @@ -20,7 +20,6 @@ const TEST_URI = ` background: none; transition: initial; z-index: 0; - opacity: 1; }
@@ -40,7 +39,6 @@ add_task(function* () { yield testShorthandIncrements(view); yield testOddCases(view); yield testZeroValueIncrements(view); - yield testOpacityIncrements(view); }); function* testMarginIncrements(view) { @@ -229,27 +227,6 @@ function* testZeroValueIncrements(view) { }); } -function* testOpacityIncrements(view) { - info("Testing keyboard increments on the opacity property"); - - let idRuleEditor = getRuleViewRuleEditor(view, 1); - let opacityPropEditor = idRuleEditor.rule.textProps[7].editor; - - yield runIncrementTest(opacityPropEditor, view, { - 1: {alt: true, start: "0.5", end: "0.51", selectAll: true}, - 2: {start: "0", end: "0.1", selectAll: true}, - 3: {shift: true, start: "0", end: "1", selectAll: true}, - 4: {down: true, alt: true, start: "0.1", end: "0.09", selectAll: true}, - 5: {down: true, start: "0", end: "-0.1", selectAll: true}, - 6: {down: true, shift: true, start: "0", end: "-1", selectAll: true}, - 7: {pageUp: true, shift: true, start: "0", end: "10", selectAll: true}, - 8: {pageDown: true, shift: true, start: "0", end: "-10", - selectAll: true}, - 9: {start: "0.7", end: "0.8", selectAll: true}, - 10: {down: true, start: "0", end: "-0.1", selectAll: true}, - }); -} - function* runIncrementTest(propertyEditor, view, tests) { let editor = yield focusEditableField(view, propertyEditor.valueSpan); diff --git a/devtools/client/inspector/rules/views/text-property-editor.js b/devtools/client/inspector/rules/views/text-property-editor.js index 008f50721cfa..219e67bac68d 100644 --- a/devtools/client/inspector/rules/views/text-property-editor.js +++ b/devtools/client/inspector/rules/views/text-property-editor.js @@ -295,7 +295,6 @@ TextPropertyEditor.prototype = { advanceChars: advanceValidate, contentType: InplaceEditor.CONTENT_TYPES.CSS_VALUE, property: this.prop, - defaultIncrement: this.prop.name === "opacity" ? 0.1 : 1, popup: this.popup, multiline: true, maxWidth: () => this.container.getBoundingClientRect().width, diff --git a/devtools/client/shared/inplace-editor.js b/devtools/client/shared/inplace-editor.js index 4ea354ae9a21..aaa175252d0d 100644 --- a/devtools/client/shared/inplace-editor.js +++ b/devtools/client/shared/inplace-editor.js @@ -122,8 +122,6 @@ function isKeyIn(key, ...keys) { * from `element` to the new input. * defaults to false * {Object} cssProperties: An instance of CSSProperties. - * {Number} defaultIncrement: The value by which the input is incremented - * or decremented by default (0.1 for properties like opacity and 1 by default) */ function editableField(options) { return editableItem(options, function (element, event) { @@ -227,7 +225,6 @@ function InplaceEditor(options, event) { this.change = options.change; this.done = options.done; this.contextMenu = options.contextMenu; - this.defaultIncrement = options.defaultIncrement || 1; this.destroy = options.destroy; this.initial = options.initial ? options.initial : this.elt.textContent; this.multiline = options.multiline || false; @@ -1212,9 +1209,9 @@ InplaceEditor.prototype = { let key = event.keyCode; if (isKeyIn(key, "UP", "PAGE_UP")) { - increment = 1 * this.defaultIncrement; + increment = 1; } else if (isKeyIn(key, "DOWN", "PAGE_DOWN")) { - increment = -1 * this.defaultIncrement; + increment = -1; } if (event.shiftKey && !event.altKey) {