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

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

Issue 14493016: Fix handling of 'inherit' and 'initial' for grid lines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Take 2: Forgot the code Created 7 years, 8 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
« no previous file with comments | « Source/core/css/StyleResolver.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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 712
713 RenderGrid::GridSpan RenderGrid::resolveGridPositionsFromAutoPlacementPosition(c onst RenderBox*, TrackSizingDirection, size_t initialPosition) const 713 RenderGrid::GridSpan RenderGrid::resolveGridPositionsFromAutoPlacementPosition(c onst RenderBox*, TrackSizingDirection, size_t initialPosition) const
714 { 714 {
715 // FIXME: We don't support spanning with auto positions yet. Once we do, thi s is wrong. Also we should make 715 // FIXME: We don't support spanning with auto positions yet. Once we do, thi s is wrong. Also we should make
716 // sure the grid can accomodate the new item as we only grow 1 position in a given direction. 716 // sure the grid can accomodate the new item as we only grow 1 position in a given direction.
717 return GridSpan(initialPosition, initialPosition); 717 return GridSpan(initialPosition, initialPosition);
718 } 718 }
719 719
720 PassOwnPtr<RenderGrid::GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, TrackSizingDirection direction) const 720 PassOwnPtr<RenderGrid::GridSpan> RenderGrid::resolveGridPositionsFromStyle(const RenderBox* gridItem, TrackSizingDirection direction) const
721 { 721 {
722 const GridPosition& initialPosition = (direction == ForColumns) ? gridItem-> style()->gridItemStart() : gridItem->style()->gridItemBefore(); 722 const GridPosition& initialPosition = (direction == ForColumns) ? gridItem-> style()->gridStart() : gridItem->style()->gridBefore();
723 const GridPositionSide initialPositionSide = (direction == ForColumns) ? Sta rtSide : BeforeSide; 723 const GridPositionSide initialPositionSide = (direction == ForColumns) ? Sta rtSide : BeforeSide;
724 const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->st yle()->gridItemEnd() : gridItem->style()->gridItemAfter(); 724 const GridPosition& finalPosition = (direction == ForColumns) ? gridItem->st yle()->gridEnd() : gridItem->style()->gridAfter();
725 const GridPositionSide finalPositionSide = (direction == ForColumns) ? EndSi de : AfterSide; 725 const GridPositionSide finalPositionSide = (direction == ForColumns) ? EndSi de : AfterSide;
726 726
727 if (initialPosition.isAuto() && finalPosition.isAuto()) { 727 if (initialPosition.isAuto() && finalPosition.isAuto()) {
728 if (style()->gridAutoFlow() == AutoFlowNone) 728 if (style()->gridAutoFlow() == AutoFlowNone)
729 return adoptPtr(new GridSpan(0, 0)); 729 return adoptPtr(new GridSpan(0, 0));
730 730
731 // We can't get our grid positions without running the auto placement al gorithm. 731 // We can't get our grid positions without running the auto placement al gorithm.
732 return nullptr; 732 return nullptr;
733 } 733 }
734 734
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 if (isOutOfFlowPositioned()) 823 if (isOutOfFlowPositioned())
824 return "RenderGrid (positioned)"; 824 return "RenderGrid (positioned)";
825 if (isAnonymous()) 825 if (isAnonymous())
826 return "RenderGrid (generated)"; 826 return "RenderGrid (generated)";
827 if (isRelPositioned()) 827 if (isRelPositioned())
828 return "RenderGrid (relative positioned)"; 828 return "RenderGrid (relative positioned)";
829 return "RenderGrid"; 829 return "RenderGrid";
830 } 830 }
831 831
832 } // namespace WebCore 832 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/StyleResolver.cpp ('k') | Source/core/rendering/style/RenderStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698