summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/widgets/LinearEasingFunctionWidget.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/shared/widgets/LinearEasingFunctionWidget.js')
-rw-r--r--devtools/client/shared/widgets/LinearEasingFunctionWidget.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/devtools/client/shared/widgets/LinearEasingFunctionWidget.js b/devtools/client/shared/widgets/LinearEasingFunctionWidget.js
index e6d2e604df..5ea3b33d15 100644
--- a/devtools/client/shared/widgets/LinearEasingFunctionWidget.js
+++ b/devtools/client/shared/widgets/LinearEasingFunctionWidget.js
@@ -9,7 +9,7 @@
*/
const EventEmitter = require("devtools/shared/event-emitter");
-const { getCSSLexer } = require("devtools/shared/css/lexer");
+const { InspectorCSSParserWrapper } = require("devtools/shared/css/lexer");
const { throttle } = require("devtools/shared/throttle");
const XHTML_NS = "http://www.w3.org/1999/xhtml";
const SVG_NS = "http://www.w3.org/2000/svg";
@@ -578,13 +578,13 @@ class TimingFunctionPreviewWidget {
*/
function parseTimingFunction(value) {
value = value.trim();
- const tokenStream = getCSSLexer(value);
+ const tokenStream = new InspectorCSSParserWrapper(value);
const getNextToken = () => {
while (true) {
const token = tokenStream.nextToken();
if (
!token ||
- (token.tokenType !== "whitespace" && token.tokenType !== "comment")
+ (token.tokenType !== "WhiteSpace" && token.tokenType !== "Comment")
) {
return token;
}
@@ -592,7 +592,7 @@ function parseTimingFunction(value) {
};
let token = getNextToken();
- if (!token || token.tokenType !== "function" || token.text !== "linear") {
+ if (!token || token.tokenType !== "Function" || token.value !== "linear") {
return undefined;
}
@@ -601,11 +601,11 @@ function parseTimingFunction(value) {
let largestInput = -Infinity;
while ((token = getNextToken())) {
- if (token.text === ")") {
+ if (token.tokenType === "CloseParenthesis") {
break;
}
- if (token.tokenType === "number") {
+ if (token.tokenType === "Number") {
// [parsing step 4.1]
const point = { input: null, output: token.number };
// [parsing step 4.2]
@@ -614,7 +614,7 @@ function parseTimingFunction(value) {
// get nextToken to see if there's a linear stop length
token = getNextToken();
// [parsing step 4.3]
- if (token && token.tokenType === "percentage") {
+ if (token && token.tokenType === "Percentage") {
// [parsing step 4.3.1]
point.input = Math.max(token.number, largestInput);
// [parsing step 4.3.2]
@@ -624,7 +624,7 @@ function parseTimingFunction(value) {
token = getNextToken();
// [parsing step 4.3.3]
- if (token && token.tokenType === "percentage") {
+ if (token && token.tokenType === "Percentage") {
// [parsing step 4.3.3.1]
const extraPoint = { input: null, output: point.output };
// [parsing step 4.3.3.2]