From 9e68da5e876854d2b0e5b245c11d72a2b6bb5373 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Wed, 17 Apr 2024 05:57:11 +0000 Subject: [PATCH] Bug 1889875 - [devtools] Use InspectorCSSParser in CssAngle#valid. r=devtools-reviewers,ochameau. Differential Revision: https://phabricator.services.mozilla.com/D206752 --- devtools/client/shared/css-angle.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/devtools/client/shared/css-angle.js b/devtools/client/shared/css-angle.js index 903b7813ade5..296a87dab1f1 100644 --- a/devtools/client/shared/css-angle.js +++ b/devtools/client/shared/css-angle.js @@ -68,13 +68,14 @@ CssAngle.prototype = { }, get valid() { - const token = getCSSLexer(this.authored).nextToken(); + const token = getCSSLexer(this.authored, true).nextToken(); if (!token) { return false; } + return ( - token.tokenType === "dimension" && - token.text.toLowerCase() in this.ANGLEUNIT + token.tokenType === "Dimension" && + token.unit.toLowerCase() in this.ANGLEUNIT ); },