Bug 1329088 - Add LengthParsingMode enum to Gecko side. r=emilio draft
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 14 Apr 2017 11:18:35 +0800
changeset 562699 2cfe16b46b535154842c1f396d0656137c31afbe
parent 562653 f77f3057b8ee04f1a7546e9cd69066d201e9a221
child 562700 ad890082013a7a9390fc064df637b03c7f8bdcc0
push id54098
push userbmo:jryans@gmail.com
push dateFri, 14 Apr 2017 08:16:58 +0000
reviewersemilio
bugs1329088
milestone55.0a1
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
layout/style/ServoTypes.h
--- 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