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

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: Applied suggested changes. Created 6 years, 6 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 || style->isFloating() || style->hasOutOfFlowPosition(); 141 || style->isFloating() || style->hasOutOfFlowPosition();
142 } 142 }
143 143
144 // FIXME: This helper is only needed because pseudoStyleForElement passes a null 144 // FIXME: This helper is only needed because pseudoStyleForElement passes a null
145 // element to adjustRenderStyle, so we can't just use element->isInTopLayer(). 145 // element to adjustRenderStyle, so we can't just use element->isInTopLayer().
146 static bool isInTopLayer(const Element* element, const RenderStyle* style) 146 static bool isInTopLayer(const Element* element, const RenderStyle* style)
147 { 147 {
148 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP); 148 return (element && element->isInTopLayer()) || (style && style->styleType() == BACKDROP);
149 } 149 }
150 150
151 static bool isDisplayFlexibleBox(EDisplay display)
152 {
153 return display == FLEX || display == INLINE_FLEX;
154 }
155
156 static bool isDisplayGridBox(EDisplay display)
157 {
158 return display == GRID || display == INLINE_GRID;
159 }
160
161 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle) 151 static bool parentStyleForcesZIndexToCreateStackingContext(const RenderStyle* pa rentStyle)
162 { 152 {
163 return isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(pare ntStyle->display()); 153 return parentStyle->isDisplayFlexibleOrGridBox();
164 } 154 }
165 155
166 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style) 156 static bool hasWillChangeThatCreatesStackingContext(const RenderStyle* style)
167 { 157 {
168 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) { 158 for (size_t i = 0; i < style->willChangeProperties().size(); ++i) {
169 switch (style->willChangeProperties()[i]) { 159 switch (style->willChangeProperties()[i]) {
170 case CSSPropertyOpacity: 160 case CSSPropertyOpacity:
171 case CSSPropertyTransform: 161 case CSSPropertyTransform:
172 case CSSPropertyWebkitTransform: 162 case CSSPropertyWebkitTransform:
173 case CSSPropertyTransformStyle: 163 case CSSPropertyTransformStyle:
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_R OW || style->display() == TABLE_ROW_GROUP 430 || style->display() == TABLE_HEADER_GROUP || style->display() == TABLE_R OW || style->display() == TABLE_ROW_GROUP
441 || style->display() == TABLE_CELL) 431 || style->display() == TABLE_CELL)
442 style->setWritingMode(parentStyle->writingMode()); 432 style->setWritingMode(parentStyle->writingMode());
443 433
444 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting 434 // FIXME: Since we don't support block-flow on flexible boxes yet, disallow setting
445 // of block-flow to anything other than TopToBottomWritingMode. 435 // of block-flow to anything other than TopToBottomWritingMode.
446 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support. 436 // https://bugs.webkit.org/show_bug.cgi?id=46418 - Flexible box support.
447 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX)) 437 if (style->writingMode() != TopToBottomWritingMode && (style->display() == B OX || style->display() == INLINE_BOX))
448 style->setWritingMode(TopToBottomWritingMode); 438 style->setWritingMode(TopToBottomWritingMode);
449 439
450 if (isDisplayFlexibleBox(parentStyle->display()) || isDisplayGridBox(parentS tyle->display())) { 440 if (parentStyle->isDisplayFlexibleOrGridBox()) {
451 style->setFloating(NoFloat); 441 style->setFloating(NoFloat);
452 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles)); 442 style->setDisplay(equivalentBlockDisplay(style->display(), style->isFloa ting(), !m_useQuirksModeStyles));
453 } 443 }
454 } 444 }
455 445
456 } 446 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698