summaryrefslogtreecommitdiffstats
path: root/devtools/client/shared/widgets/LinearEasingFunctionWidget.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /devtools/client/shared/widgets/LinearEasingFunctionWidget.js
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-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]