Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutGrid.cpp

Issue 1826733002: Remove ASSERT_WITH_MESSAGE family. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 1051
1052 if (availableLogicalSpace > 0) { 1052 if (availableLogicalSpace > 0) {
1053 std::sort(tracks.begin(), tracks.end(), sortByGridTrackGrowthPotential); 1053 std::sort(tracks.begin(), tracks.end(), sortByGridTrackGrowthPotential);
1054 1054
1055 size_t tracksSize = tracks.size(); 1055 size_t tracksSize = tracks.size();
1056 for (size_t i = 0; i < tracksSize; ++i) { 1056 for (size_t i = 0; i < tracksSize; ++i) {
1057 GridTrack& track = *tracks[i]; 1057 GridTrack& track = *tracks[i];
1058 LayoutUnit availableLogicalSpaceShare = availableLogicalSpace / (tra cksSize - i); 1058 LayoutUnit availableLogicalSpaceShare = availableLogicalSpace / (tra cksSize - i);
1059 const LayoutUnit& trackBreadth = trackSizeForTrackSizeComputationPha se(phase, track, ForbidInfinity); 1059 const LayoutUnit& trackBreadth = trackSizeForTrackSizeComputationPha se(phase, track, ForbidInfinity);
1060 LayoutUnit growthShare = track.infiniteGrowthPotential() ? available LogicalSpaceShare : std::min(availableLogicalSpaceShare, track.growthLimit() - t rackBreadth); 1060 LayoutUnit growthShare = track.infiniteGrowthPotential() ? available LogicalSpaceShare : std::min(availableLogicalSpaceShare, track.growthLimit() - t rackBreadth);
1061 ASSERT_WITH_MESSAGE(growthShare >= 0, "We must never shrink any grid track or else we can't guarantee we abide by our min-sizing function."); 1061 DCHECK_GE(growthShare, 0) << "We must never shrink any grid track or else we can't guarantee we abide by our min-sizing function.";
1062 track.growSizeDuringDistribution(growthShare); 1062 track.growSizeDuringDistribution(growthShare);
1063 availableLogicalSpace -= growthShare; 1063 availableLogicalSpace -= growthShare;
1064 } 1064 }
1065 } 1065 }
1066 1066
1067 if (availableLogicalSpace > 0 && growBeyondGrowthLimitsTracks) { 1067 if (availableLogicalSpace > 0 && growBeyondGrowthLimitsTracks) {
1068 size_t tracksGrowingAboveMaxBreadthSize = growBeyondGrowthLimitsTracks-> size(); 1068 size_t tracksGrowingAboveMaxBreadthSize = growBeyondGrowthLimitsTracks-> size();
1069 for (size_t i = 0; i < tracksGrowingAboveMaxBreadthSize; ++i) { 1069 for (size_t i = 0; i < tracksGrowingAboveMaxBreadthSize; ++i) {
1070 GridTrack* track = growBeyondGrowthLimitsTracks->at(i); 1070 GridTrack* track = growBeyondGrowthLimitsTracks->at(i);
1071 LayoutUnit growthShare = availableLogicalSpace / (tracksGrowingAbove MaxBreadthSize - i); 1071 LayoutUnit growthShare = availableLogicalSpace / (tracksGrowingAbove MaxBreadthSize - i);
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
2037 2037
2038 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData )); 2038 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child, sizingData ));
2039 } 2039 }
2040 2040
2041 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2041 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2042 { 2042 {
2043 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2043 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2044 } 2044 }
2045 2045
2046 } // namespace blink 2046 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698