Bug 1269046 part 3: Make a grid-specific comment more general, in CSSAlignUtils::AlignJustifySelf. r=mats draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 20 Oct 2016 19:02:34 -0700
changeset 427975 f6c87e22b76c8d958dc89e6b2562f265eb447b0b
parent 427974 037dffe7e06983282ed384ea608eae435092caa7
child 427976 2660a4385ed7135e684cc24c67cae41e766030c7
child 428189 7ca35ae43d23377b74ec02fc1c4c7a36fd14521e
push id33187
push userdholbert@mozilla.com
push dateFri, 21 Oct 2016 07:58:06 +0000
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.