Bug 1269046 part 3: Make a grid-specific comment more general, in CSSAlignUtils::AlignJustifySelf. r=mats
☠☠ backed out by 7c24f4455420 ☠ ☠
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 27 Oct 2016 18:58:26 -0700
changeset 319891 eea6479452f0be2d7ee98f6d537106f6fe8a0d50
parent 319890 eb4b52bf06ec8c1f5b33cfba7255a0d4bb64c168
child 319892 8088e5a9e6e322731d4a3008642b54a1fc0774b1
push id20749
push userryanvm@gmail.com
push dateSat, 29 Oct 2016 13:21:21 +0000
treeherderfx-team@1b170b39ed6b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1269046
milestone52.0a1
Bug 1269046 part 3: Make a grid-specific comment more general, in CSSAlignUtils::AlignJustifySelf. r=mats MozReview-Commit-ID: GZ35iZ2E1Iz
layout/generic/CSSAlignUtils.cpp
--- a/layout/generic/CSSAlignUtils.cpp
+++ b/layout/generic/CSSAlignUtils.cpp
@@ -36,20 +36,23 @@ CSSAlignUtils::AlignJustifySelf(uint8_t 
     case NS_STYLE_ALIGN_SELF_START: // align/justify-self: self-start
       aAlignment = MOZ_LIKELY(aSameSide) ? NS_STYLE_ALIGN_START
                                          : NS_STYLE_ALIGN_END;
       break;
     case NS_STYLE_ALIGN_SELF_END: // align/justify-self: self-end
       aAlignment = MOZ_LIKELY(aSameSide) ? NS_STYLE_ALIGN_END
                                          : NS_STYLE_ALIGN_START;
       break;
-    case NS_STYLE_ALIGN_FLEX_START: // same as 'start' for Grid
+    // flex-start/flex-end are the same as start/end, in most contexts.
+    // (They have special behavior in flex containers, so flex containers
+    // should map them to some other value before calling this method.)
+    case NS_STYLE_ALIGN_FLEX_START:
       aAlignment = NS_STYLE_ALIGN_START;
       break;
-    case NS_STYLE_ALIGN_FLEX_END: // same as 'end' for Grid
+    case NS_STYLE_ALIGN_FLEX_END:
       aAlignment = NS_STYLE_ALIGN_END;
       break;
   }
 
   // XXX try to condense this code a bit by adding the necessary convenience
   // methods? (bug 1209710)
 
   // Get the item's margin corresponding to the container's start/end side.