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 13:31:51 -0700
changeset 427820 c69b36710b6206a1daa0c225a5a99e7dd3210bbb
parent 427819 20528c2e93933641e96e71103f45ba2941fe4347
child 534561 c83f0eb113b7a87e861d2121c93ae35e813cf709
push id33124
push userdholbert@mozilla.com
push dateThu, 20 Oct 2016 22:20:41 +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.