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

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

Issue 14715014: Add parsing for named grid lines (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing (fixed Elliott's comments) Created 7 years, 7 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/resolver/StyleResolver.cpp ('k') | Source/core/rendering/style/GridPosition.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 843 matching lines...) Expand 10 before | Expand all | Expand 10 after
854 if (resolvedFinalPosition < resolvedInitialPosition) 854 if (resolvedFinalPosition < resolvedInitialPosition)
855 resolvedFinalPosition = resolvedInitialPosition; 855 resolvedFinalPosition = resolvedInitialPosition;
856 856
857 return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition) ); 857 return adoptPtr(new GridSpan(resolvedInitialPosition, resolvedFinalPosition) );
858 } 858 }
859 859
860 size_t RenderGrid::resolveGridPositionFromStyle(const GridPosition& position, Gr idPositionSide side) const 860 size_t RenderGrid::resolveGridPositionFromStyle(const GridPosition& position, Gr idPositionSide side) const
861 { 861 {
862 // FIXME: Handle other values for grid-{row,column} like ranges or line name s. 862 // FIXME: Handle other values for grid-{row,column} like ranges or line name s.
863 switch (position.type()) { 863 switch (position.type()) {
864 case IntegerPosition: { 864 case ExplicitPosition: {
865 if (position.isPositive()) { 865 if (position.isPositive()) {
866 if (side == EndSide || side == AfterSide) 866 if (side == EndSide || side == AfterSide)
867 return std::max(0, position.integerPosition() - 2); 867 return std::max(0, position.integerPosition() - 2);
868 868
869 return position.integerPosition() - 1; 869 return position.integerPosition() - 1;
870 } 870 }
871 871
872 size_t resolvedPosition = abs(position.integerPosition()); 872 size_t resolvedPosition = abs(position.integerPosition());
873 // FIXME: This returns one less than the expected result for side == Sta rtSide or BeforeSide as we don't properly convert 873 // FIXME: This returns one less than the expected result for side == Sta rtSide or BeforeSide as we don't properly convert
874 // the grid line to its grid track. However this avoids the issue of gro wing the grid when inserting the item (e.g. -1 / auto). 874 // the grid line to its grid track. However this avoids the issue of gro wing the grid when inserting the item (e.g. -1 / auto).
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 if (isOutOfFlowPositioned()) 945 if (isOutOfFlowPositioned())
946 return "RenderGrid (positioned)"; 946 return "RenderGrid (positioned)";
947 if (isAnonymous()) 947 if (isAnonymous())
948 return "RenderGrid (generated)"; 948 return "RenderGrid (generated)";
949 if (isRelPositioned()) 949 if (isRelPositioned())
950 return "RenderGrid (relative positioned)"; 950 return "RenderGrid (relative positioned)";
951 return "RenderGrid"; 951 return "RenderGrid";
952 } 952 }
953 953
954 } // namespace WebCore 954 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/rendering/style/GridPosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698