Bug 1329088 - Add LengthParsingMode enum to Gecko side. r=emilio
Add a Gecko side LengthParsingMode enum that matches the Servo version. This
will be used in a few Stylo glue APIs on the FFI boundary.
MozReview-Commit-ID: EuDlWc6ZiQ8
--- a/layout/style/ServoTypes.h
+++ b/layout/style/ServoTypes.h
@@ -66,13 +66,25 @@ enum class TraversalRestyleBehavior {
// Represents which tasks are performed in a SequentialTask of UpdateAnimations.
enum class UpdateAnimationsTasks : uint8_t {
CSSAnimations = 1 << 0,
CSSTransitions = 1 << 1,
EffectProperties = 1 << 2,
CascadeResults = 1 << 3,
};
+// The mode to use when parsing lengths.
+enum class LengthParsingMode {
+ // 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,
+ // 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
+ SVG,
+};
+
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(UpdateAnimationsTasks)
} // namespace mozilla
#endif // mozilla_ServoTypes_h