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

Side by Side Diff: Source/core/css/resolver/StyleAdjuster.cpp

Issue 614263005: [CSS Grid Layout] overflow-position keyword for align and justify properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied suggested changes. Created 6 years, 2 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) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com)
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com)
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved.
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org>
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org>
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 } 243 }
244 244
245 adjustStyleForAlignment(*style, *parentStyle); 245 adjustStyleForAlignment(*style, *parentStyle);
246 } 246 }
247 247
248 void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl e& parentStyle) 248 void StyleAdjuster::adjustStyleForAlignment(RenderStyle& style, const RenderStyl e& parentStyle)
249 { 249 {
250 bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox(); 250 bool isFlexOrGrid = style.isDisplayFlexibleOrGridBox();
251 bool absolutePositioned = style.position() == AbsolutePosition; 251 bool absolutePositioned = style.position() == AbsolutePosition;
252 252
253 // The default overflow alignment is 'true' for flex or grid items/contaners , 'safe' otherwise.
254 if (style.justifyItemsOverflowAlignment() == OverflowAlignmentDefault)
255 style.setJustifyItemsOverflowAlignment(isFlexOrGrid ? OverflowAlignmentT rue : OverflowAlignmentSafe);
256 if (style.justifySelfOverflowAlignment() == OverflowAlignmentDefault)
257 style.setJustifySelfOverflowAlignment(isFlexOrGrid ? OverflowAlignmentTr ue : OverflowAlignmentSafe);
258
253 // If the inherited value of justify-items includes the legacy keyword, 'aut o' 259 // If the inherited value of justify-items includes the legacy keyword, 'aut o'
254 // computes to the the inherited value. 260 // computes to the the inherited value.
255 // Otherwise, auto computes to: 261 // Otherwise, auto computes to:
256 // - 'stretch' for flex containers and grid containers. 262 // - 'stretch' for flex containers and grid containers.
257 // - 'start' for everything else. 263 // - 'start' for everything else.
258 if (style.justifyItems() == ItemPositionAuto) { 264 if (style.justifyItems() == ItemPositionAuto) {
259 if (parentStyle.justifyItemsPositionType() == LegacyPosition) { 265 if (parentStyle.justifyItemsPositionType() == LegacyPosition) {
260 style.setJustifyItems(parentStyle.justifyItems()); 266 style.setJustifyItems(parentStyle.justifyItems());
261 style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionTy pe()); 267 style.setJustifyItemsPositionType(parentStyle.justifyItemsPositionTy pe());
262 } else if (isFlexOrGrid) { 268 } else if (isFlexOrGrid) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX)) 455 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX))
450 style->setWritingMode(TopToBottomWritingMode); 456 style->setWritingMode(TopToBottomWritingMode);
451 457
452 if (parentStyle->isDisplayFlexibleOrGridBox()) { 458 if (parentStyle->isDisplayFlexibleOrGridBox()) {
453 style->setFloating(NoFloat); 459 style->setFloating(NoFloat);
454 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles)); 460 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles));
455 } 461 }
456 } 462 }
457 463
458 } 464 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698