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

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

Issue 697653004: [CSS Grid Layout] Grid items must set a new formatting context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Applied additional suggested changes. Created 6 years, 1 month 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
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 // (b) are a table, 1253 // (b) are a table,
1254 // (c) have border/padding, 1254 // (c) have border/padding,
1255 // (d) have a min-height 1255 // (d) have a min-height
1256 // (e) have specified that one of our margins can't collapse using a CSS ext ension 1256 // (e) have specified that one of our margins can't collapse using a CSS ext ension
1257 // (f) establish a new block formatting context. 1257 // (f) establish a new block formatting context.
1258 1258
1259 // The early exit must be done before we check for clean layout. 1259 // The early exit must be done before we check for clean layout.
1260 // We should be able to give a quick answer if the box is a relayout boundar y. 1260 // We should be able to give a quick answer if the box is a relayout boundar y.
1261 // Being a relayout boundary implies a block formatting context, and also 1261 // Being a relayout boundary implies a block formatting context, and also
1262 // our internal layout shouldn't affect our container in any way. 1262 // our internal layout shouldn't affect our container in any way.
1263 if (createsBlockFormattingContext()) 1263 if (createsNewFormattingContext())
1264 return false; 1264 return false;
1265 1265
1266 // Placeholder elements are not laid out until the dimensions of their paren t text control are known, so they 1266 // Placeholder elements are not laid out until the dimensions of their paren t text control are known, so they
1267 // don't get layout until their parent has had layout - this is unique in th e layout tree and means 1267 // don't get layout until their parent has had layout - this is unique in th e layout tree and means
1268 // when we call isSelfCollapsingBlock on them we find that they still need l ayout. 1268 // when we call isSelfCollapsingBlock on them we find that they still need l ayout.
1269 ASSERT(!needsLayout() || (node() && node()->isElementNode() && toElement(nod e())->shadowPseudoId() == "-webkit-input-placeholder")); 1269 ASSERT(!needsLayout() || (node() && node()->isElementNode() && toElement(nod e())->shadowPseudoId() == "-webkit-input-placeholder"));
1270 1270
1271 if (logicalHeight() > 0 1271 if (logicalHeight() > 0
1272 || isTable() || borderAndPaddingLogicalHeight() 1272 || isTable() || borderAndPaddingLogicalHeight()
1273 || style()->logicalMinHeight().isPositive() 1273 || style()->logicalMinHeight().isPositive()
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 void RenderBlock::addVisualOverflowFromTheme() 1511 void RenderBlock::addVisualOverflowFromTheme()
1512 { 1512 {
1513 if (!style()->hasAppearance()) 1513 if (!style()->hasAppearance())
1514 return; 1514 return;
1515 1515
1516 IntRect inflatedRect = pixelSnappedBorderBoxRect(); 1516 IntRect inflatedRect = pixelSnappedBorderBoxRect();
1517 RenderTheme::theme().adjustPaintInvalidationRect(this, inflatedRect); 1517 RenderTheme::theme().adjustPaintInvalidationRect(this, inflatedRect);
1518 addVisualOverflow(inflatedRect); 1518 addVisualOverflow(inflatedRect);
1519 } 1519 }
1520 1520
1521 bool RenderBlock::createsBlockFormattingContext() const 1521 bool RenderBlock::createsNewFormattingContext() const
1522 { 1522 {
1523 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated() 1523 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasOverflowClip() || isFlexItemIncludingDeprecated()
1524 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElement( ) || style()->columnSpan(); 1524 || style()->specifiesColumns() || isRenderFlowThread() || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot()
1525 || isDocumentElement() || style()->columnSpan() || isGridItem();
1525 } 1526 }
1526 1527
1527 void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, R enderBox* child) 1528 void RenderBlock::updateBlockChildDirtyBitsBeforeLayout(bool relayoutChildren, R enderBox* child)
1528 { 1529 {
1529 // FIXME: Technically percentage height objects only need a relayout if thei r percentage isn't going to be turned into 1530 // FIXME: Technically percentage height objects only need a relayout if thei r percentage isn't going to be turned into
1530 // an auto value. Add a method to determine this, so that we can avoid the r elayout. 1531 // an auto value. Add a method to determine this, so that we can avoid the r elayout.
1531 if (relayoutChildren || (child->hasRelativeLogicalHeight() && !isRenderView( ))) 1532 if (relayoutChildren || (child->hasRelativeLogicalHeight() && !isRenderView( )))
1532 child->setChildNeedsLayout(MarkOnlyThis); 1533 child->setChildNeedsLayout(MarkOnlyThis);
1533 1534
1534 // If relayoutChildren is set and the child has percentage padding or an emb edded content box, we also need to invalidate the childs pref widths. 1535 // If relayoutChildren is set and the child has percentage padding or an emb edded content box, we also need to invalidate the childs pref widths.
(...skipping 2847 matching lines...) Expand 10 before | Expand all | Expand 10 after
4382 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const 4383 void RenderBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Render Object* obj) const
4383 { 4384 {
4384 showRenderObject(); 4385 showRenderObject();
4385 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box()) 4386 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot Box())
4386 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1); 4387 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa bel2, obj, 1);
4387 } 4388 }
4388 4389
4389 #endif 4390 #endif
4390 4391
4391 } // namespace blink 4392 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlock.h ('k') | Source/core/rendering/RenderBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698