OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1587 } | 1587 } |
1588 | 1588 |
1589 static LayoutUnit computeOverflowAlignmentOffset(OverflowAlignment overflow, Lay
outUnit trackBreadth, LayoutUnit childBreadth) | 1589 static LayoutUnit computeOverflowAlignmentOffset(OverflowAlignment overflow, Lay
outUnit trackBreadth, LayoutUnit childBreadth) |
1590 { | 1590 { |
1591 LayoutUnit offset = trackBreadth - childBreadth; | 1591 LayoutUnit offset = trackBreadth - childBreadth; |
1592 switch (overflow) { | 1592 switch (overflow) { |
1593 case OverflowAlignmentSafe: | 1593 case OverflowAlignmentSafe: |
1594 // If overflow is 'safe', we have to make sure we don't overflow the 'st
art' | 1594 // If overflow is 'safe', we have to make sure we don't overflow the 'st
art' |
1595 // edge (potentially cause some data loss as the overflow is unreachable
). | 1595 // edge (potentially cause some data loss as the overflow is unreachable
). |
1596 return std::max<LayoutUnit>(0, offset); | 1596 return std::max<LayoutUnit>(0, offset); |
1597 case OverflowAlignmentTrue: | 1597 case OverflowAlignmentUnsafe: |
1598 case OverflowAlignmentDefault: | 1598 case OverflowAlignmentDefault: |
1599 // If we overflow our alignment container and overflow is 'true' (defaul
t), we | 1599 // If we overflow our alignment container and overflow is 'true' (defaul
t), we |
1600 // ignore the overflow and just return the value regardless (which may c
ause data | 1600 // ignore the overflow and just return the value regardless (which may c
ause data |
1601 // loss as we overflow the 'start' edge). | 1601 // loss as we overflow the 'start' edge). |
1602 return offset; | 1602 return offset; |
1603 } | 1603 } |
1604 | 1604 |
1605 ASSERT_NOT_REACHED(); | 1605 ASSERT_NOT_REACHED(); |
1606 return 0; | 1606 return 0; |
1607 } | 1607 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2044 | 2044 |
2045 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); | 2045 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); |
2046 } | 2046 } |
2047 | 2047 |
2048 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const | 2048 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa
intOffset) const |
2049 { | 2049 { |
2050 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2050 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
2051 } | 2051 } |
2052 | 2052 |
2053 } // namespace blink | 2053 } // namespace blink |
OLD | NEW |