Backed out changeset ef7e530aff4f (bug 1168092) for failing modified devtools test devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js on Windows 7 pgo with e10s and on Windows 7 debug without e10s. r=backout
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 09 Oct 2017 22:53:47 +0200
changeset 427866 134fc4fd4727638689539644498d1ddba5442b1e
parent 427865 4bf0f40c6755b92ab878a4c0a523499b2180a2e4
child 427867 7e960acfd90c6a709e1cb157a5f9bf63b1a1349f
push id97
push userfmarier@mozilla.com
push dateSat, 14 Oct 2017 01:12:59 +0000
reviewersbackout
bugs1168092
milestone58.0a1
backs outef7e530aff4f01ef077ea97580c7d8bcafee6830
Backed out changeset ef7e530aff4f (bug 1168092) for failing modified devtools test devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js on Windows 7 pgo with e10s and on Windows 7 debug without e10s. r=backout
devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js
devtools/client/inspector/rules/views/text-property-editor.js
devtools/client/shared/inplace-editor.js
--- a/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js
+++ b/devtools/client/inspector/rules/test/browser_rules_edit-property-increments.js
@@ -15,17 +15,16 @@ const TEST_URI = `
     #test {
       margin-top: 0px;
       padding-top: 0px;
       color: #000000;
       background-color: #000000;
       background: none;
       transition: initial;
       z-index: 0;
-      opacity: 1;
     }
   </style>
   <div id="test"></div>
 `;
 
 add_task(function* () {
   yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
 
@@ -35,17 +34,16 @@ add_task(function* () {
   yield testMarginIncrements(view);
   yield testVariousUnitIncrements(view);
   yield testHexIncrements(view);
   yield testAlphaHexIncrements(view);
   yield testRgbIncrements(view);
   yield testShorthandIncrements(view);
   yield testOddCases(view);
   yield testZeroValueIncrements(view);
-  yield testOpacityIncrements(view);
 });
 
 function* testMarginIncrements(view) {
   info("Testing keyboard increments on the margin property");
 
   let idRuleEditor = getRuleViewRuleEditor(view, 1);
   let marginPropEditor = idRuleEditor.rule.textProps[0].editor;
 
@@ -224,37 +222,16 @@ function* testZeroValueIncrements(view) 
   });
 
   let zIndexPropEditor = idRuleEditor.rule.textProps[6].editor;
   yield runIncrementTest(zIndexPropEditor, view, {
     1: {start: "0", end: "1", selection: [1, 1]},
   });
 }
 
-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);
 
   for (let test in tests) {
     yield testIncrement(editor, tests[test], view, propertyEditor);
   }
 
   // Blur the field to put back the UI in its initial state (and avoid pending
--- a/devtools/client/inspector/rules/views/text-property-editor.js
+++ b/devtools/client/inspector/rules/views/text-property-editor.js
@@ -290,17 +290,16 @@ TextPropertyEditor.prototype = {
         start: this._onStartEditing,
         element: this.valueSpan,
         done: this._onValueDone,
         destroy: this.update,
         validate: this._onValidate,
         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,
         cssProperties: this.cssProperties,
       });
 
       this.ruleView.highlighters.on("hover-shape-point", this._onHoverShapePoint);
     }
--- a/devtools/client/shared/inplace-editor.js
+++ b/devtools/client/shared/inplace-editor.js
@@ -117,18 +117,16 @@ function isKeyIn(key, ...keys) {
  *       available if multiline is true. If a function is provided, it will be
  *       called when replacing the element by the inplace input.
  *    {Boolean} trimOutput: Should the returned string be trimmed?
  *      defaults to true
  *    {Boolean} preserveTextStyles: If true, do not copy text-related styles
  *              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) {
     if (!options.element.inplaceEditor) {
       new InplaceEditor(options, event);
     }
   });
 }
@@ -222,17 +220,16 @@ function InplaceEditor(options, event) {
   this.elt = options.element;
   let doc = this.elt.ownerDocument;
   this.doc = doc;
   this.elt.inplaceEditor = this;
   this.cssProperties = options.cssProperties;
   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;
   this.maxWidth = options.maxWidth;
   if (typeof this.maxWidth == "function") {
     this.maxWidth = this.maxWidth();
   }
 
@@ -1207,19 +1204,19 @@ InplaceEditor.prototype = {
     const largeIncrement = 100;
     const mediumIncrement = 10;
     const smallIncrement = 0.1;
 
     let increment = 0;
     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) {
       if (isKeyIn(key, "PAGE_UP", "PAGE_DOWN")) {
         increment *= largeIncrement;
       } else {
         increment *= mediumIncrement;
       }