Bug 1357295 - Add PARSING_MODE_ALLOW_ALL_NUMERIC_VALUES to force to parse negative values. r?emilio draft
authorHiroyuki Ikezoe <hikezoe@mozilla.com>
Sat, 13 May 2017 19:47:38 +0900
changeset 577333 1743bfffa62e1b50437ebf0eb5ccd2df520c6c13
parent 577332 44ba59b0df9ee2561d2ae41ce837f3b736e0aec5
child 577334 5e77e9394fd8811e011381ca4b8a84ab62e29890
push id58661
push userhikezoe@mozilla.com
push dateSat, 13 May 2017 10:57:21 +0000
reviewersemilio
bugs1357295
milestone55.0a1
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
layout/style/ServoTypes.h
--- 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.