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

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

Issue 22215002: Allow grid positions to be named grid areas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 978 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 989
990 size_t resolvedPosition = abs(position.integerPosition()) - 1; 990 size_t resolvedPosition = abs(position.integerPosition()) - 1;
991 const size_t endOfTrack = explicitGridSizeForSide(side); 991 const size_t endOfTrack = explicitGridSizeForSide(side);
992 992
993 // Per http://lists.w3.org/Archives/Public/www-style/2013Mar/0589.html, we clamp negative value to the first line. 993 // Per http://lists.w3.org/Archives/Public/www-style/2013Mar/0589.html, we clamp negative value to the first line.
994 if (endOfTrack < resolvedPosition) 994 if (endOfTrack < resolvedPosition)
995 return 0; 995 return 0;
996 996
997 return adjustGridPositionForSide(endOfTrack - resolvedPosition, side); 997 return adjustGridPositionForSide(endOfTrack - resolvedPosition, side);
998 } 998 }
999 case NamedGridAreaPosition:
1000 // FIXME: Support resolving named grid area (crbug.com/258092).
1001 return 0;
999 case AutoPosition: 1002 case AutoPosition:
1000 // 'auto' depends on the opposite position for resolution (e.g. grid-row : auto / 1).
1001 ASSERT_NOT_REACHED();
1002 return 0;
1003 case SpanPosition: 1003 case SpanPosition:
1004 // FIXME: Handle span positions (crbug.com/229713). 1004 // 'auto' and span depend on the opposite position for resolution (e.g. grid-row: auto / 1 or grid-column: span 3 / "myHeader").
1005 ASSERT_NOT_REACHED(); 1005 ASSERT_NOT_REACHED();
1006 return 0; 1006 return 0;
1007 } 1007 }
1008 ASSERT_NOT_REACHED(); 1008 ASSERT_NOT_REACHED();
1009 return 0; 1009 return 0;
1010 } 1010 }
1011 1011
1012 PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size _t resolvedOppositePosition, const GridPosition& position, GridPositionSide side ) const 1012 PassOwnPtr<GridSpan> RenderGrid::resolveGridPositionAgainstOppositePosition(size _t resolvedOppositePosition, const GridPosition& position, GridPositionSide side ) const
1013 { 1013 {
1014 if (position.isAuto()) 1014 if (position.isAuto())
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
1121 if (isOutOfFlowPositioned()) 1121 if (isOutOfFlowPositioned())
1122 return "RenderGrid (positioned)"; 1122 return "RenderGrid (positioned)";
1123 if (isAnonymous()) 1123 if (isAnonymous())
1124 return "RenderGrid (generated)"; 1124 return "RenderGrid (generated)";
1125 if (isRelPositioned()) 1125 if (isRelPositioned())
1126 return "RenderGrid (relative positioned)"; 1126 return "RenderGrid (relative positioned)";
1127 return "RenderGrid"; 1127 return "RenderGrid";
1128 } 1128 }
1129 1129
1130 } // namespace WebCore 1130 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleBuilderCustom.cpp ('k') | Source/core/rendering/style/GridPosition.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698