Backed out changeset 68be1552a5ee (bug 1275546) for widespread failures in browser_css_angle.js
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Fri, 08 Jul 2016 11:25:08 +0200
changeset 304255 806cd7a7b68de8777caf419239e2f4e671aaa80b
parent 304254 9329897c803de9e5a7b77d7ff4020b9158d41d5f
child 304256 00b612e67c091e3e5899fe5e8a60870ed1a910f2
push id79280
push userkwierso@gmail.com
push dateFri, 08 Jul 2016 22:04:28 +0000
treeherdermozilla-inbound@14b16ac38991 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1275546
milestone50.0a1
backs out68be1552a5ee372558e2b263741b4ce95c9e6205
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 68be1552a5ee (bug 1275546) for widespread failures in browser_css_angle.js
devtools/client/shared/css-angle.js
devtools/client/shared/output-parser.js
devtools/client/shared/test/browser_css_angle.js
--- a/devtools/client/shared/css-angle.js
+++ b/devtools/client/shared/css-angle.js
@@ -5,18 +5,16 @@
 "use strict";
 
 const SPECIALVALUES = new Set([
   "initial",
   "inherit",
   "unset"
 ]);
 
-const {getCSSLexer} = require("devtools/shared/css-lexer");
-
 /**
  * This module is used to convert between various angle units.
  *
  * Usage:
  *   let {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
  *   let {angleUtils} = require("devtools/client/shared/css-angle");
  *   let angle = new angleUtils.CssAngle("180deg");
  *
@@ -63,21 +61,17 @@ CssAngle.prototype = {
     return this._angleUnit;
   },
 
   set angleUnit(unit) {
     this._angleUnit = unit;
   },
 
   get valid() {
-    let token = getCSSLexer(this.authored).nextToken();
-    if (!token) {
-      return false;
-    }
-    return (token.tokenType === "dimension" && token.text in CssAngle.ANGLEUNIT);
+    return /^-?\d+\.?\d*(deg|rad|grad|turn)$/gi.test(this.authored);
   },
 
   get specialValue() {
     return SPECIALVALUES.has(this.lowerCased) ? this.authored : null;
   },
 
   get deg() {
     let invalidOrSpecialValue = this._getInvalidOrSpecialValue();
--- a/devtools/client/shared/output-parser.js
+++ b/devtools/client/shared/output-parser.js
@@ -151,17 +151,17 @@ OutputParser.prototype = {
 
     let colorOK = function () {
       return options.supportsColor ||
         (options.expectFilter && parenDepth === 1 &&
          outerMostFunctionTakesColor);
     };
 
     let angleOK = function (angle) {
-      return (new angleUtils.CssAngle(angle)).valid;
+      return /^-?\d+\.?\d*(deg|rad|grad|turn)$/gi.test(angle);
     };
 
     while (true) {
       let token = tokenStream.nextToken();
       if (!token) {
         break;
       }
       if (token.tokenType === "comment") {
--- a/devtools/client/shared/test/browser_css_angle.js
+++ b/devtools/client/shared/test/browser_css_angle.js
@@ -8,17 +8,16 @@ const TEST_URI = "data:text/html;charset
 var {angleUtils} = require("devtools/client/shared/css-angle");
 
 add_task(function* () {
   yield addTab("about:blank");
   let [host] = yield createHost("bottom", TEST_URI);
 
   info("Starting the test");
   testAngleUtils();
-  testAngleValidity();
 
   host.destroy();
   gBrowser.removeCurrentTab();
 });
 
 function testAngleUtils() {
   let data = getTestData();
 
@@ -31,77 +30,30 @@ function testAngleUtils() {
     is(angle.rad, rad, "color.rad === rad");
     is(angle.grad, grad, "color.grad === grad");
     is(angle.turn, turn, "color.turn === turn");
 
     testToString(angle, deg, rad, grad, turn);
   }
 }
 
-function testAngleValidity() {
-  let data = getAngleValidityData();
-
-  for (let {angle, result} of data) {
-    let testAngle = new angleUtils.CssAngle(angle);
-
-    is(testAngle.valid, result, `Testing that "${angle}" is ${testAngle.valid ? " a valid" : "an invalid" } angle`);
-  }
-}
-
 function testToString(angle, deg, rad, grad, turn) {
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.deg;
   is(angle.toString(), deg, "toString() with deg type");
 
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.rad;
   is(angle.toString(), rad, "toString() with rad type");
 
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.grad;
   is(angle.toString(), grad, "toString() with grad type");
 
   angle.angleUnit = angleUtils.CssAngle.ANGLEUNIT.turn;
   is(angle.toString(), turn, "toString() with turn type");
 }
 
-function getAngleValidityData() {
-  return [{
-    angle: "0.2turn",
-    result: true
-  }, {
-    angle: "-0.2turn",
-    result: true
-  }, {
-    angle: "-.2turn",
-    result: true
-  }, {
-    angle: "1e02turn",
-    result: true
-  }, {
-    angle: "-2e2turn",
-    result: true
-  }, {
-    angle: ".2turn",
-    result: true
-  }, {
-    angle: "0.2aaturn",
-    result: false
-  }, {
-    angle: "2dega",
-    result: false
-  }, {
-    angle: "0.deg",
-    result: false
-  }, {
-    angle: ".deg",
-    result: false
-  }, {
-    angle: "..2turn",
-    result: false
-  }];
-}
-
 function getTestData() {
   return [{
     authored: "0deg",
     deg: "0deg",
     rad: "0rad",
     grad: "0grad",
     turn: "0turn"
   }, {