Bug 1331213: Implement the bulk of media query evaluation. r=heycam
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sun, 15 Jan 2017 21:18:35 +0100
changeset 357718 74790f4d30de03105799064332f44d045e40723e
parent 357717 08dcea8c000187bf0ac06c96dcdad526af09808c
child 357719 721b8d0c2401e20cb48a82e7eb7ccc8e96e98e35
push id10621
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 16:02:43 +0000
treeherdermozilla-aurora@dca7b42e6c67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
Bug 1331213: Implement the bulk of media query evaluation. r=heycam Two main notes: * The nsStringBuffer bit goes untested, since it's only used on windows and there's no way I can test it, please review with care. * I haven't implemented yet the "enumerated" media queries. I'd want to do it as a follow-up, because I'm running out of time, and it requires some investigation. MozReview-Commit-ID: 1pBbzyIViPk Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
--- a/layout/style/nsMediaFeatures.h
+++ b/layout/style/nsMediaFeatures.h
@@ -26,17 +26,17 @@ struct nsMediaFeature
   nsIAtom **mName; // extra indirection to point to nsGkAtoms members
   enum RangeType { eMinMaxAllowed, eMinMaxNotAllowed };
   RangeType mRangeType;
   enum ValueType {
     // All value types allow eCSSUnit_Null to indicate that no value
     // was given (in addition to the types listed below).
-    eLength,     // values are such that nsCSSValue::IsLengthUnit() is true
+    eLength,     // values are eCSSUnit_Pixel
     eInteger,    // values are eCSSUnit_Integer
     eFloat,      // values are eCSSUnit_Number
     eBoolInteger,// values are eCSSUnit_Integer (0, -0, or 1 only)
     eIntRatio,   // values are eCSSUnit_Array of two eCSSUnit_Integer
     eResolution, // values are in eCSSUnit_Inch (for dpi),
                  //   eCSSUnit_Pixel (for dppx), or
                  //   eCSSUnit_Centimeter (for dpcm)
     eEnumerated, // values are eCSSUnit_Enumerated (uses keyword table)