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 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 { | 611 { |
| 612 std::sort(tracks.begin(), tracks.end(), sortByGridTrackGrowthPotential); | 612 std::sort(tracks.begin(), tracks.end(), sortByGridTrackGrowthPotential); |
| 613 | 613 |
| 614 size_t tracksSize = tracks.size(); | 614 size_t tracksSize = tracks.size(); |
| 615 sizingData.distributeTrackVector.resize(tracksSize); | 615 sizingData.distributeTrackVector.resize(tracksSize); |
| 616 | 616 |
| 617 for (size_t i = 0; i < tracksSize; ++i) { | 617 for (size_t i = 0; i < tracksSize; ++i) { |
| 618 GridTrack& track = *tracks[i]; | 618 GridTrack& track = *tracks[i]; |
| 619 LayoutUnit availableLogicalSpaceShare = availableLogicalSpace / (tracksS ize - i); | 619 LayoutUnit availableLogicalSpaceShare = availableLogicalSpace / (tracksS ize - i); |
| 620 LayoutUnit trackBreadth = (tracks[i]->*trackGetter)(); | 620 LayoutUnit trackBreadth = (tracks[i]->*trackGetter)(); |
| 621 LayoutUnit growthShare = std::max(LayoutUnit(), std::min(availableLogica lSpaceShare, track.m_maxBreadth - trackBreadth)); | 621 LayoutUnit growthShare = std::min(availableLogicalSpaceShare, track.m_ma xBreadth - trackBreadth); |
| 622 // We should never shrink any grid track or else we can't guarantee we a bide by our min-sizing function. | 622 sizingData.distributeTrackVector[i] = trackBreadth; |
| 623 sizingData.distributeTrackVector[i] = trackBreadth + growthShare; | 623 // We should never shrink any grid track or else we can't guarantee we abide by our min-sizing function. |
|
Julien - ping for review
2013/11/05 16:16:43
Unneeded space
| |
| 624 availableLogicalSpace -= growthShare; | 624 if (growthShare > 0) { |
| 625 sizingData.distributeTrackVector[i] += growthShare; | |
| 626 availableLogicalSpace -= growthShare; | |
| 627 } | |
| 625 } | 628 } |
| 626 | 629 |
| 627 if (availableLogicalSpace > 0 && tracksForGrowthAboveMaxBreadth) { | 630 if (availableLogicalSpace > 0 && tracksForGrowthAboveMaxBreadth) { |
| 628 tracksSize = tracksForGrowthAboveMaxBreadth->size(); | 631 tracksSize = tracksForGrowthAboveMaxBreadth->size(); |
| 629 for (size_t i = 0; i < tracksSize; ++i) { | 632 for (size_t i = 0; i < tracksSize; ++i) { |
| 630 LayoutUnit growthShare = availableLogicalSpace / (tracksSize - i); | 633 LayoutUnit growthShare = availableLogicalSpace / (tracksSize - i); |
| 631 sizingData.distributeTrackVector[i] += growthShare; | 634 sizingData.distributeTrackVector[i] += growthShare; |
| 632 availableLogicalSpace -= growthShare; | 635 availableLogicalSpace -= growthShare; |
| 633 } | 636 } |
| 634 } | 637 } |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1195 if (isOutOfFlowPositioned()) | 1198 if (isOutOfFlowPositioned()) |
| 1196 return "RenderGrid (positioned)"; | 1199 return "RenderGrid (positioned)"; |
| 1197 if (isAnonymous()) | 1200 if (isAnonymous()) |
| 1198 return "RenderGrid (generated)"; | 1201 return "RenderGrid (generated)"; |
| 1199 if (isRelPositioned()) | 1202 if (isRelPositioned()) |
| 1200 return "RenderGrid (relative positioned)"; | 1203 return "RenderGrid (relative positioned)"; |
| 1201 return "RenderGrid"; | 1204 return "RenderGrid"; |
| 1202 } | 1205 } |
| 1203 | 1206 |
| 1204 } // namespace WebCore | 1207 } // namespace WebCore |
| OLD | NEW |