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

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

Issue 1490093003: [css-grid] Fix items' height computation in indefinite grids with fr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 else 370 else
371 computeTrackSizesForDirection(ForRows, sizingData, availableLogicalH eight(ExcludeMarginBorderPadding)); 371 computeTrackSizesForDirection(ForRows, sizingData, availableLogicalH eight(ExcludeMarginBorderPadding));
372 setLogicalHeight(computeTrackBasedLogicalHeight(sizingData) + borderAndP addingLogicalHeight()); 372 setLogicalHeight(computeTrackBasedLogicalHeight(sizingData) + borderAndP addingLogicalHeight());
373 373
374 LayoutUnit oldClientAfterEdge = clientLogicalBottom(); 374 LayoutUnit oldClientAfterEdge = clientLogicalBottom();
375 updateLogicalHeight(); 375 updateLogicalHeight();
376 376
377 // The above call might have changed the grid's logical height depending on min|max height restrictions. 377 // The above call might have changed the grid's logical height depending on min|max height restrictions.
378 // Update the sizes of the rows whose size depends on the logical height (also on definite|indefinite sizes). 378 // Update the sizes of the rows whose size depends on the logical height (also on definite|indefinite sizes).
379 if (logicalHeightWasIndefinite) 379 if (logicalHeightWasIndefinite)
380 computeTrackSizesForDirection(ForRows, sizingData, logicalHeight()); 380 computeTrackSizesForDirection(ForRows, sizingData, contentLogicalHei ght());
381 381
382 // Grid container should have the minimum height of a line if it's edita ble. That doesn't affect track sizing though. 382 // Grid container should have the minimum height of a line if it's edita ble. That doesn't affect track sizing though.
383 if (hasLineIfEmpty()) 383 if (hasLineIfEmpty())
384 setLogicalHeight(std::max(logicalHeight(), minimumLogicalHeightForEm ptyLine())); 384 setLogicalHeight(std::max(logicalHeight(), minimumLogicalHeightForEm ptyLine()));
385 385
386 applyStretchAlignmentToTracksIfNeeded(ForColumns, sizingData); 386 applyStretchAlignmentToTracksIfNeeded(ForColumns, sizingData);
387 applyStretchAlignmentToTracksIfNeeded(ForRows, sizingData); 387 applyStretchAlignmentToTracksIfNeeded(ForRows, sizingData);
388 388
389 layoutGridItems(sizingData); 389 layoutGridItems(sizingData);
390 390
(...skipping 1666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2057 2057
2058 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child)); 2058 return LayoutPoint(rowAxisOffset, columnAxisOffsetForChild(child));
2059 } 2059 }
2060 2060
2061 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const 2061 void LayoutGrid::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& pa intOffset) const
2062 { 2062 {
2063 GridPainter(*this).paintChildren(paintInfo, paintOffset); 2063 GridPainter(*this).paintChildren(paintInfo, paintOffset);
2064 } 2064 }
2065 2065
2066 } // namespace blink 2066 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-item-with-border-in-fr.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698