Bug 1889875 - [devtools] Use InspectorCSSParser in CssAngle#valid. r=devtools-reviewers,ochameau.

Differential Revision: https://phabricator.services.mozilla.com/D206752
This commit is contained in:
Nicolas Chevobbe 2024-04-17 05:57:11 +00:00
parent edba18f766
commit 9e68da5e87

View File

@ -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
);
},