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

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

Issue 16959008: [CSS Grid Layout] Rename grid-{rows|columns} to grid-definition-{rows|columns} (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 7 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
« no previous file with comments | « Source/core/page/UseCounter.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 accumulatedFractions += track.m_flex; 414 accumulatedFractions += track.m_flex;
415 // This item was processed so we re-add its used breadth to the availabl e space to accurately count the remaining space. 415 // This item was processed so we re-add its used breadth to the availabl e space to accurately count the remaining space.
416 availableLogicalSpaceIgnoringFractionTracks += track.m_track->m_usedBrea dth; 416 availableLogicalSpaceIgnoringFractionTracks += track.m_track->m_usedBrea dth;
417 } 417 }
418 418
419 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions; 419 return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions;
420 } 420 }
421 421
422 const GridTrackSize& RenderGrid::gridTrackSize(TrackSizingDirection direction, s ize_t i) const 422 const GridTrackSize& RenderGrid::gridTrackSize(TrackSizingDirection direction, s ize_t i) const
423 { 423 {
424 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style ()->gridColumns() : style()->gridRows(); 424 const Vector<GridTrackSize>& trackStyles = (direction == ForColumns) ? style ()->gridDefinitionColumns() : style()->gridDefinitionRows();
425 if (i >= trackStyles.size()) 425 if (i >= trackStyles.size())
426 return (direction == ForColumns) ? style()->gridAutoColumns() : style()- >gridAutoRows(); 426 return (direction == ForColumns) ? style()->gridAutoColumns() : style()- >gridAutoRows();
427 427
428 return trackStyles[i]; 428 return trackStyles[i];
429 } 429 }
430 430
431 size_t RenderGrid::explicitGridColumnCount() const 431 size_t RenderGrid::explicitGridColumnCount() const
432 { 432 {
433 return style()->gridColumns().size(); 433 return style()->gridDefinitionColumns().size();
434 } 434 }
435 435
436 size_t RenderGrid::explicitGridRowCount() const 436 size_t RenderGrid::explicitGridRowCount() const
437 { 437 {
438 return style()->gridRows().size(); 438 return style()->gridDefinitionRows().size();
439 } 439 }
440 440
441 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const 441 size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const
442 { 442 {
443 return (side == StartSide || side == EndSide) ? explicitGridColumnCount() : explicitGridRowCount(); 443 return (side == StartSide || side == EndSide) ? explicitGridColumnCount() : explicitGridRowCount();
444 } 444 }
445 445
446 size_t RenderGrid::maximumIndexInDirection(TrackSizingDirection direction) const 446 size_t RenderGrid::maximumIndexInDirection(TrackSizingDirection direction) const
447 { 447 {
448 size_t maximumIndex = std::max<size_t>(1, (direction == ForColumns) ? explic itGridColumnCount() : explicitGridRowCount()); 448 size_t maximumIndex = std::max<size_t>(1, (direction == ForColumns) ? explic itGridColumnCount() : explicitGridRowCount());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 GridSpan* majorAxisPositions = (autoPlacementMajorAxisDirection() == ForColumns) ? columnPositions.get() : rowPositions.get(); 659 GridSpan* majorAxisPositions = (autoPlacementMajorAxisDirection() == ForColumns) ? columnPositions.get() : rowPositions.get();
660 if (!majorAxisPositions) 660 if (!majorAxisPositions)
661 autoMajorAxisAutoGridItems.append(child); 661 autoMajorAxisAutoGridItems.append(child);
662 else 662 else
663 specifiedMajorAxisAutoGridItems.append(child); 663 specifiedMajorAxisAutoGridItems.append(child);
664 continue; 664 continue;
665 } 665 }
666 insertItemIntoGrid(child, GridCoordinate(*rowPositions, *columnPositions )); 666 insertItemIntoGrid(child, GridCoordinate(*rowPositions, *columnPositions ));
667 } 667 }
668 668
669 ASSERT(gridRowCount() >= style()->gridRows().size()); 669 ASSERT(gridRowCount() >= style()->gridDefinitionRows().size());
670 ASSERT(gridColumnCount() >= style()->gridColumns().size()); 670 ASSERT(gridColumnCount() >= style()->gridDefinitionColumns().size());
671 671
672 if (autoFlow == AutoFlowNone) { 672 if (autoFlow == AutoFlowNone) {
673 // If we did collect some grid items, they won't be placed thus never la id out. 673 // If we did collect some grid items, they won't be placed thus never la id out.
674 ASSERT(!autoMajorAxisAutoGridItems.size()); 674 ASSERT(!autoMajorAxisAutoGridItems.size());
675 ASSERT(!specifiedMajorAxisAutoGridItems.size()); 675 ASSERT(!specifiedMajorAxisAutoGridItems.size());
676 return; 676 return;
677 } 677 }
678 678
679 placeSpecifiedMajorAxisItemsOnGrid(specifiedMajorAxisAutoGridItems); 679 placeSpecifiedMajorAxisItemsOnGrid(specifiedMajorAxisAutoGridItems);
680 placeAutoMajorAxisItemsOnGrid(autoMajorAxisAutoGridItems); 680 placeAutoMajorAxisItemsOnGrid(autoMajorAxisAutoGridItems);
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 if (isOutOfFlowPositioned()) 979 if (isOutOfFlowPositioned())
980 return "RenderGrid (positioned)"; 980 return "RenderGrid (positioned)";
981 if (isAnonymous()) 981 if (isAnonymous())
982 return "RenderGrid (generated)"; 982 return "RenderGrid (generated)";
983 if (isRelPositioned()) 983 if (isRelPositioned())
984 return "RenderGrid (relative positioned)"; 984 return "RenderGrid (relative positioned)";
985 return "RenderGrid"; 985 return "RenderGrid";
986 } 986 }
987 987
988 } // namespace WebCore 988 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/page/UseCounter.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698