Bug 1269046 part 3: Make a grid-specific comment more general, in CSSAlignUtils::AlignJustifySelf. r=mats draft
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 30 Oct 2016 12:18:25 -0700
changeset 431583 18d4fb0d5143e94d85504877b59f7244654563f3
parent 431582 a099ee7f46743984541611298940e8e89d480a13
child 431584 0b1deadb8b64e4c2a5384e904253e453250f8fc9
push id34071
push userdholbert@mozilla.com
push dateSun, 30 Oct 2016 20:01:42 +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.