Closed
Description
From https://bugzilla.mozilla.org/show_bug.cgi?id=1503656
Actually there is no way to get TokenSerializationType
directly from Token
type. If it is TokenSerializationTypeVariants::Nothing
, it has nothing()
function to get it.
Even parsing CSS that is hardcoded value such as 0px
, to get type, we have to create Token object like the following.
let token =
Token::Dimension {
has_sign: false, value: 0.0, int_value: Some(0), unit: CowRcStr::from("px")
};
let token_type = token.serialization_type();
I am happy if cssparser has a function to get TokenSerializationType
without creating object like TokenSerializationType::nothing()
.
Metadata
Metadata
Assignees
Labels
No labels