OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 } | 1656 } |
1657 } | 1657 } |
1658 | 1658 |
1659 ItemPosition LayoutFlexibleBox::alignmentForChild( | 1659 ItemPosition LayoutFlexibleBox::alignmentForChild( |
1660 const LayoutBox& child) const { | 1660 const LayoutBox& child) const { |
1661 ItemPosition align = | 1661 ItemPosition align = |
1662 child.styleRef() | 1662 child.styleRef() |
1663 .resolvedAlignSelf(selfAlignmentNormalBehavior(), | 1663 .resolvedAlignSelf(selfAlignmentNormalBehavior(), |
1664 child.isAnonymous() ? style() : nullptr) | 1664 child.isAnonymous() ? style() : nullptr) |
1665 .position(); | 1665 .position(); |
1666 DCHECK(align != ItemPositionAuto && align != ItemPositionNormal); | 1666 DCHECK_NE(align, ItemPositionAuto); |
| 1667 DCHECK_NE(align, ItemPositionNormal); |
1667 | 1668 |
1668 if (align == ItemPositionBaseline && hasOrthogonalFlow(child)) | 1669 if (align == ItemPositionBaseline && hasOrthogonalFlow(child)) |
1669 align = ItemPositionFlexStart; | 1670 align = ItemPositionFlexStart; |
1670 | 1671 |
1671 if (style()->flexWrap() == FlexWrapReverse) { | 1672 if (style()->flexWrap() == FlexWrapReverse) { |
1672 if (align == ItemPositionFlexStart) | 1673 if (align == ItemPositionFlexStart) |
1673 align = ItemPositionFlexEnd; | 1674 align = ItemPositionFlexEnd; |
1674 else if (align == ItemPositionFlexEnd) | 1675 else if (align == ItemPositionFlexEnd) |
1675 align = ItemPositionFlexStart; | 1676 align = ItemPositionFlexStart; |
1676 } | 1677 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2166 LayoutUnit originalOffset = | 2167 LayoutUnit originalOffset = |
2167 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; | 2168 lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; |
2168 LayoutUnit newOffset = | 2169 LayoutUnit newOffset = |
2169 contentExtent - originalOffset - lineCrossAxisExtent; | 2170 contentExtent - originalOffset - lineCrossAxisExtent; |
2170 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); | 2171 adjustAlignmentForChild(*flexItem.box, newOffset - originalOffset); |
2171 } | 2172 } |
2172 } | 2173 } |
2173 } | 2174 } |
2174 | 2175 |
2175 } // namespace blink | 2176 } // namespace blink |
OLD | NEW |