mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Add PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES to force to parse negative values.
As per SVG spec [1], we should also parse negative color components values for SMIL, but currently Gecko does not support it either. [1] https://www.w3.org/TR/SVG/implnote.html#RangeClamping
This commit is contained in:
parent
b6b3187efa
commit
59dd93f849
3 changed files with 43 additions and 6 deletions
|
@ -632,12 +632,20 @@ impl Number {
|
|||
|
||||
#[allow(missing_docs)]
|
||||
pub fn parse_non_negative(context: &ParserContext, input: &mut Parser) -> Result<Number, ()> {
|
||||
parse_number_with_clamping_mode(context, input, AllowedNumericType::NonNegative)
|
||||
if context.parsing_mode.allows_all_numeric_values() {
|
||||
parse_number(context, input)
|
||||
} else {
|
||||
parse_number_with_clamping_mode(context, input, AllowedNumericType::NonNegative)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(missing_docs)]
|
||||
pub fn parse_at_least_one(context: &ParserContext, input: &mut Parser) -> Result<Number, ()> {
|
||||
parse_number_with_clamping_mode(context, input, AllowedNumericType::AtLeastOne)
|
||||
if context.parsing_mode.allows_all_numeric_values() {
|
||||
parse_number(context, input)
|
||||
} else {
|
||||
parse_number_with_clamping_mode(context, input, AllowedNumericType::AtLeastOne)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue