Bug 1357295 - Add PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES to force to parse negative values. r?emilio
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
MozReview-Commit-ID: FH80zN3jyKh
--- a/layout/style/ServoTypes.h
+++ b/layout/style/ServoTypes.h
@@ -78,16 +78,19 @@ enum class ParsingMode : uint8_t {
// In CSS, lengths must have units, except for zero values, where the unit can
// be omitted.
// https://www.w3.org/TR/css3-values/#lengths
Default = 0,
// In SVG, a coordinate or length value without a unit identifier (e.g., "25")
// is assumed to be in user units (px).
// https://www.w3.org/TR/SVG/coords.html#Units
AllowUnitlessLength = 1 << 0,
+ // In SVG, out-of-range values are not treated as an error in parsing.
+ // https://www.w3.org/TR/SVG/implnote.html#RangeClamping
+ AllowAllNumericValues = 1 << 1,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(ParsingMode)
// The kind of style we're generating when requesting Servo to give us an
// inherited style.
enum class InheritTarget {
// We're requesting a text style.