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() { get valid() {
const token = getCSSLexer(this.authored).nextToken(); const token = getCSSLexer(this.authored, true).nextToken();
if (!token) { if (!token) {
return false; return false;
} }
return ( return (
token.tokenType === "dimension" && token.tokenType === "Dimension" &&
token.text.toLowerCase() in this.ANGLEUNIT token.unit.toLowerCase() in this.ANGLEUNIT
); );
}, },