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

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

Issue 333423005: [CSS Grid Layout] Implement 'justify-items' parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch rebased. Created 6 years, 5 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 || style->isFloating() || style->hasOutOfFlowPosition(); 119 || style->isFloating() || style->hasOutOfFlowPosition();
120 } 120 }
121 121
122 // FIXME: This helper is only needed because pseudoStyleForElement passes a null 122 // FIXME: This helper is only needed because pseudoStyleForElement passes a null
123 // element to adjustRenderStyle, so we can't just use element->isInTopLayer(). 123 // element to adjustRenderStyle, so we can't just use element->isInTopLayer().
124 static bool isInTopLayer(const Element* element, const RenderStyle* style) 124 static bool isInTopLayer(const Element* element, const RenderStyle* style)
125 { 125 {
126 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP); 126 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP);
127 } 127 }
128 128
129 static bool isDisplayFlexibleBox(EDisplay display)
130 {
131 return display == FLEX || display == INLINE_FLEX;
132 }
133
134 static bool isDisplayGridBox(EDisplay display)
135 {
136 return display == GRID || display == INLINE_GRID;
137 }
138
139 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle) 129 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle)
140 { 130 {
141 return isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(pare ntStyle->display()); 131 return parentStyle->isDisplayFlexibleOrGridBox();
142 } 132 }
143 133
144 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style) 134 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style)
145 { 135 {
146 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) { 136 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) {
147 switch (style->willChangeProperties()[i]) { 137 switch (style->willChangeProperties()[i]) {
148 case CSSPropertyOpacity: 138 case CSSPropertyOpacity:
149 case CSSPropertyTransform: 139 case CSSPropertyTransform:
150 case CSSPropertyWebkitTransform: 140 case CSSPropertyWebkitTransform:
151 case CSSPropertyTransformStyle: 141 case CSSPropertyTransformStyle:
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_R OW || style->display() == TABLE_ROW_GROUP 391 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_R OW || style->display() == TABLE_ROW_GROUP
402 || style->display() == TABLE_CELL) 392 || style->display() == TABLE_CELL)
403 style->setWritingMode(parentStyle->writingMode()); 393 style->setWritingMode(parentStyle->writingMode());
404 394
405 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 395 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
406 // of block-flow to anything other than TopToBottomWritingMode. 396 // of block-flow to anything other than TopToBottomWritingMode.
407 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 397 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
408 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX)) 398 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX))
409 style->setWritingMode(TopToBottomWritingMode); 399 style->setWritingMode(TopToBottomWritingMode);
410 400
411 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS tyle->display())) { 401 if (parentStyle->isDisplayFlexibleOrGridBox()) {
412 style->setFloating(NoFloat); 402 style->setFloating(NoFloat);
413 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles)); 403 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles));
414 } 404 }
415 } 405 }
416 406
417 } 407 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698