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

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

Issue 363133003: [CSS Grid Layout] Adapting align-self, align-items and justify-self to the last CSS 3 spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Resolve grid and flex cases during cascade, the rest will wait for layout. Created 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return baseline; 193 return baseline;
194 194
195 int marginAscent = direction == HorizontalLine ? marginTop() : marginRight() ; 195 int marginAscent = direction == HorizontalLine ? marginTop() : marginRight() ;
196 return synthesizedBaselineFromContentBox(this, direction) + marginAscent; 196 return synthesizedBaselineFromContentBox(this, direction) + marginAscent;
197 } 197 }
198 198
199 static ItemPosition resolveAlignment(const RenderStyle* parentStyle, const Rende rStyle* childStyle) 199 static ItemPosition resolveAlignment(const RenderStyle* parentStyle, const Rende rStyle* childStyle)
200 { 200 {
201 ItemPosition align = childStyle->alignSelf(); 201 ItemPosition align = childStyle->alignSelf();
202 if (align == ItemPositionAuto) 202 if (align == ItemPositionAuto)
203 align = parentStyle->alignItems(); 203 align = (parentStyle->alignItems() == ItemPositionAuto) ? ItemPositionSt retch : parentStyle->alignItems();
204 return align; 204 return align;
205 } 205 }
206 206
207 void RenderFlexibleBox::removeChild(RenderObject* child) 207 void RenderFlexibleBox::removeChild(RenderObject* child)
208 { 208 {
209 RenderBlock::removeChild(child); 209 RenderBlock::removeChild(child);
210 m_intrinsicSizeAlongMainAxis.remove(child); 210 m_intrinsicSizeAlongMainAxis.remove(child);
211 } 211 }
212 212
213 void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle) 213 void RenderFlexibleBox::styleDidChange(StyleDifference diff, const RenderStyle* oldStyle)
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 ASSERT(child); 1401 ASSERT(child);
1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1402 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1403 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1404 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1405 adjustAlignmentForChild(child, newOffset - originalOffset); 1405 adjustAlignmentForChild(child, newOffset - originalOffset);
1406 } 1406 }
1407 } 1407 }
1408 } 1408 }
1409 1409
1410 } 1410 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698