Bug 1460456 part 1 - Change the semantics of 'auto' color value. r=heycam
authorXidorn Quan <me@upsuper.org>
Thu, 10 May 2018 09:05:08 +1000
changeset 419273 caf50de5e89b25ff2082f18a90f85dcf5ce20894
parent 419272 614c51908ddbb87fbf7a0baf0baa1bcfdce15e00
child 419274 97bd8f520796b9582e53c7ef9a8c94a8dcb5ebfd
push id34034
push userncsoregi@mozilla.com
push dateTue, 22 May 2018 22:00:26 +0000
treeherdermozilla-central@96a6ea5ea346 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersheycam
bugs1460456
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460456 part 1 - Change the semantics of 'auto' color value. r=heycam MozReview-Commit-ID: CRkhO35MoB8
layout/style/StyleComplexColor.h
--- a/layout/style/StyleComplexColor.h
+++ b/layout/style/StyleComplexColor.h
@@ -18,25 +18,29 @@ namespace mozilla {
 class ComputedStyle;
 
 /**
  * This struct represents a combined color from a numeric color and
  * the current foreground color (currentcolor keyword).
  * Conceptually, the formula is "color * (1 - p) + currentcolor * p"
  * where p is mForegroundRatio. See mozilla::LinearBlendColors for
  * the actual algorithm.
+ *
+ * It can also represent an "auto" value, which is valid for some
+ * properties. See comment of mIsAuto.
  */
 struct StyleComplexColor
 {
   nscolor mColor;
   uint8_t mForegroundRatio;
   // Whether the complex color represents a computed-value time auto
-  // value. This is only a flag indicating that this value should not
-  // be interpolatable with other colors, while other fields still
-  // represents the actual used color of this value.
+  // value. This is a flag indicating that this value should not be
+  // interpolatable with other colors. When this flag is set, other
+  // fields represent a currentcolor. Properties can decide whether
+  // that should be used.
   bool mIsAuto;
 
   static StyleComplexColor FromColor(nscolor aColor) {
     return {aColor, 0, false};
   }
   static StyleComplexColor CurrentColor() {
     return {NS_RGBA(0, 0, 0, 0), 255, false};
   }