Chromium Code Reviews| 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 558 // the grid (so the gap becomes 0) or there is a non empty track before that . | 558 // the grid (so the gap becomes 0) or there is a non empty track before that . |
| 559 | 559 |
| 560 LayoutUnit gapAccumulator; | 560 LayoutUnit gapAccumulator; |
| 561 size_t endLine = startLine + span; | 561 size_t endLine = startLine + span; |
| 562 | 562 |
| 563 for (size_t line = startLine; line < endLine - 1; ++line) { | 563 for (size_t line = startLine; line < endLine - 1; ++line) { |
| 564 if (!isEmptyAutoRepeatTrack(direction, line)) | 564 if (!isEmptyAutoRepeatTrack(direction, line)) |
| 565 gapAccumulator += gap; | 565 gapAccumulator += gap; |
| 566 } | 566 } |
| 567 | 567 |
| 568 // The above loop adds one extra gap for trailing collapsed tracks. | |
| 569 if (gapAccumulator && isEmptyAutoRepeatTrack(direction, endLine - 1)) | |
| 570 gapAccumulator -= gap; | |
|
eae
2016/09/12 19:24:32
Do we want to add a DCHECK here to ensure that it
Manuel Rego
2016/09/12 19:50:17
Right now "gapAccumulator > 0" implies that "gapAc
svillar
2016/09/13 07:36:27
So gapAccumulator is only increased in "gap" chunk
| |
| 571 | |
| 568 // If the startLine is the start line of a collapsed track we need to go bac kwards till we reach | 572 // If the startLine is the start line of a collapsed track we need to go bac kwards till we reach |
| 569 // a non collapsed track. If we find a non collapsed track we need to add th at gap. | 573 // a non collapsed track. If we find a non collapsed track we need to add th at gap. |
| 570 if (startLine && isEmptyAutoRepeatTrack(direction, startLine)) { | 574 if (startLine && isEmptyAutoRepeatTrack(direction, startLine)) { |
| 571 size_t nonEmptyTracksBeforeStartLine = startLine; | 575 size_t nonEmptyTracksBeforeStartLine = startLine; |
| 572 auto begin = isRowAxis ? m_autoRepeatEmptyColumns->begin() : m_autoRepea tEmptyRows->begin(); | 576 auto begin = isRowAxis ? m_autoRepeatEmptyColumns->begin() : m_autoRepea tEmptyRows->begin(); |
| 573 for (auto it = begin; *it != startLine; ++it) { | 577 for (auto it = begin; *it != startLine; ++it) { |
| 574 DCHECK(nonEmptyTracksBeforeStartLine); | 578 DCHECK(nonEmptyTracksBeforeStartLine); |
| 575 --nonEmptyTracksBeforeStartLine; | 579 --nonEmptyTracksBeforeStartLine; |
| 576 } | 580 } |
| 577 if (nonEmptyTracksBeforeStartLine) | 581 if (nonEmptyTracksBeforeStartLine) |
| (...skipping 2084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2662 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; | 2666 return isOrthogonalChild(child) ? childLocation.transposedPoint() : childLoc ation; |
| 2663 } | 2667 } |
| 2664 | 2668 |
| 2665 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const | 2669 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const |
| 2666 { | 2670 { |
| 2667 if (!m_gridItemArea.isEmpty()) | 2671 if (!m_gridItemArea.isEmpty()) |
| 2668 GridPainter(*this).paintChildren(paintInfo, paintOffset); | 2672 GridPainter(*this).paintChildren(paintInfo, paintOffset); |
| 2669 } | 2673 } |
| 2670 | 2674 |
| 2671 } // namespace blink | 2675 } // namespace blink |
| OLD | NEW |