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

Side by Side Diff: Source/core/rendering/RenderGrid.cpp

Issue 397733004: Allow assertions to be enabled in Blink Release builds. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed config.gni. Minor cleanups. Created 6 years, 5 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 | Annotate | Revision Log
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 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 } 738 }
739 } 739 }
740 740
741 for (size_t i = 0; i < tracksSize; ++i) { 741 for (size_t i = 0; i < tracksSize; ++i) {
742 LayoutUnit growth = sizingData.distributeTrackVector[i] - (tracks[i]->*t rackGetter)(); 742 LayoutUnit growth = sizingData.distributeTrackVector[i] - (tracks[i]->*t rackGetter)();
743 if (growth >= 0) 743 if (growth >= 0)
744 (tracks[i]->*trackGrowthFunction)(growth); 744 (tracks[i]->*trackGrowthFunction)(growth);
745 } 745 }
746 } 746 }
747 747
748 #ifndef NDEBUG 748 #if ENABLE(ASSERT)
749 bool RenderGrid::tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection dire ction, const Vector<GridTrack>& tracks) 749 bool RenderGrid::tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection dire ction, const Vector<GridTrack>& tracks)
750 { 750 {
751 for (size_t i = 0; i < tracks.size(); ++i) { 751 for (size_t i = 0; i < tracks.size(); ++i) {
752 const GridTrackSize& trackSize = gridTrackSize(direction, i); 752 const GridTrackSize& trackSize = gridTrackSize(direction, i);
753 const GridLength& minTrackBreadth = trackSize.minTrackBreadth(); 753 const GridLength& minTrackBreadth = trackSize.minTrackBreadth();
754 if (computeUsedBreadthOfMinLength(direction, minTrackBreadth) > tracks[i ].m_usedBreadth) 754 if (computeUsedBreadthOfMinLength(direction, minTrackBreadth) > tracks[i ].m_usedBreadth)
755 return false; 755 return false;
756 } 756 }
757 return true; 757 return true;
758 } 758 }
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 layoutScope.setNeedsLayout(child); 987 layoutScope.setNeedsLayout(child);
988 988
989 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingB lockContentLogicalWidth); 989 child->setOverrideContainingBlockContentLogicalWidth(overrideContainingB lockContentLogicalWidth);
990 child->setOverrideContainingBlockContentLogicalHeight(overrideContaining BlockContentLogicalHeight); 990 child->setOverrideContainingBlockContentLogicalHeight(overrideContaining BlockContentLogicalHeight);
991 991
992 // FIXME: Grid items should stretch to fill their cells. Once we 992 // FIXME: Grid items should stretch to fill their cells. Once we
993 // implement grid-{column,row}-align, we can also shrink to fit. For 993 // implement grid-{column,row}-align, we can also shrink to fit. For
994 // now, just size as if we were a regular child. 994 // now, just size as if we were a regular child.
995 child->layoutIfNeeded(); 995 child->layoutIfNeeded();
996 996
997 #ifndef NDEBUG 997 #if ENABLE(ASSERT)
998 const GridCoordinate& coordinate = cachedGridCoordinate(child); 998 const GridCoordinate& coordinate = cachedGridCoordinate(child);
999 ASSERT(coordinate.columns.resolvedInitialPosition.toInt() < sizingData.c olumnTracks.size()); 999 ASSERT(coordinate.columns.resolvedInitialPosition.toInt() < sizingData.c olumnTracks.size());
1000 ASSERT(coordinate.rows.resolvedInitialPosition.toInt() < sizingData.rowT racks.size()); 1000 ASSERT(coordinate.rows.resolvedInitialPosition.toInt() < sizingData.rowT racks.size());
1001 #endif 1001 #endif
1002 child->setLogicalLocation(findChildLogicalPosition(child)); 1002 child->setLogicalLocation(findChildLogicalPosition(child));
1003 1003
1004 // Keep track of children overflowing their grid area as we might need t o paint them even if the grid-area is 1004 // Keep track of children overflowing their grid area as we might need t o paint them even if the grid-area is
1005 // not visible 1005 // not visible
1006 if (child->logicalHeight() > overrideContainingBlockContentLogicalHeight 1006 if (child->logicalHeight() > overrideContainingBlockContentLogicalHeight
1007 || child->logicalWidth() > overrideContainingBlockContentLogicalWidt h) 1007 || child->logicalWidth() > overrideContainingBlockContentLogicalWidt h)
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1352 if (isOutOfFlowPositioned()) 1352 if (isOutOfFlowPositioned())
1353 return "RenderGrid (positioned)"; 1353 return "RenderGrid (positioned)";
1354 if (isAnonymous()) 1354 if (isAnonymous())
1355 return "RenderGrid (generated)"; 1355 return "RenderGrid (generated)";
1356 if (isRelPositioned()) 1356 if (isRelPositioned())
1357 return "RenderGrid (relative positioned)"; 1357 return "RenderGrid (relative positioned)";
1358 return "RenderGrid"; 1358 return "RenderGrid";
1359 } 1359 }
1360 1360
1361 } // namespace WebCore 1361 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698