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

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

Issue 712553003: [New Multicolumn] Actual support for layout of column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 28 matching lines...) Expand all
39 #include "core/html/HTMLFrameOwnerElement.h" 39 #include "core/html/HTMLFrameOwnerElement.h"
40 #include "core/page/AutoscrollController.h" 40 #include "core/page/AutoscrollController.h"
41 #include "core/page/EventHandler.h" 41 #include "core/page/EventHandler.h"
42 #include "core/page/Page.h" 42 #include "core/page/Page.h"
43 #include "core/paint/BackgroundImageGeometry.h" 43 #include "core/paint/BackgroundImageGeometry.h"
44 #include "core/paint/BoxPainter.h" 44 #include "core/paint/BoxPainter.h"
45 #include "core/rendering/HitTestResult.h" 45 #include "core/rendering/HitTestResult.h"
46 #include "core/rendering/PaintInfo.h" 46 #include "core/rendering/PaintInfo.h"
47 #include "core/rendering/RenderDeprecatedFlexibleBox.h" 47 #include "core/rendering/RenderDeprecatedFlexibleBox.h"
48 #include "core/rendering/RenderFlexibleBox.h" 48 #include "core/rendering/RenderFlexibleBox.h"
49 #include "core/rendering/RenderFlowThread.h"
49 #include "core/rendering/RenderGeometryMap.h" 50 #include "core/rendering/RenderGeometryMap.h"
50 #include "core/rendering/RenderGrid.h" 51 #include "core/rendering/RenderGrid.h"
51 #include "core/rendering/RenderInline.h" 52 #include "core/rendering/RenderInline.h"
52 #include "core/rendering/RenderLayer.h" 53 #include "core/rendering/RenderLayer.h"
53 #include "core/rendering/RenderListBox.h" 54 #include "core/rendering/RenderListBox.h"
54 #include "core/rendering/RenderListMarker.h" 55 #include "core/rendering/RenderListMarker.h"
55 #include "core/rendering/RenderTableCell.h" 56 #include "core/rendering/RenderTableCell.h"
56 #include "core/rendering/RenderView.h" 57 #include "core/rendering/RenderView.h"
57 #include "core/rendering/compositing/RenderLayerCompositor.h" 58 #include "core/rendering/compositing/RenderLayerCompositor.h"
58 #include "platform/LengthFunctions.h" 59 #include "platform/LengthFunctions.h"
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC ontent, startOffsetForLine); 1420 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC ontent, startOffsetForLine);
1420 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte nt, endOffsetForLine); 1421 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte nt, endOffsetForLine);
1421 return width; 1422 return width;
1422 } 1423 }
1423 1424
1424 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const 1425 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
1425 { 1426 {
1426 if (hasOverrideContainingBlockLogicalWidth()) 1427 if (hasOverrideContainingBlockLogicalWidth())
1427 return overrideContainingBlockContentLogicalWidth(); 1428 return overrideContainingBlockContentLogicalWidth();
1428 1429
1429 RenderBlock* cb = containingBlock(); 1430 RenderBlock* cb;
1431 if (isColumnSpanAll())
1432 cb = flowThreadContainingBlock()->containingBlock();
1433 else
1434 cb = containingBlock();
1430 return cb->availableLogicalWidth(); 1435 return cb->availableLogicalWidth();
1431 } 1436 }
1432 1437
1433 LayoutUnit RenderBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const 1438 LayoutUnit RenderBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const
1434 { 1439 {
1435 if (hasOverrideContainingBlockLogicalHeight()) 1440 if (hasOverrideContainingBlockLogicalHeight())
1436 return overrideContainingBlockContentLogicalHeight(); 1441 return overrideContainingBlockContentLogicalHeight();
1437 1442
1438 RenderBlock* cb = containingBlock(); 1443 RenderBlock* cb;
1444 if (isColumnSpanAll())
1445 cb = flowThreadContainingBlock()->containingBlock();
1446 else
1447 cb = containingBlock();
1439 return cb->availableLogicalHeight(heightType); 1448 return cb->availableLogicalHeight(heightType);
1440 } 1449 }
1441 1450
1442 LayoutUnit RenderBox::containingBlockAvailableLineWidth() const 1451 LayoutUnit RenderBox::containingBlockAvailableLineWidth() const
1443 { 1452 {
1444 RenderBlock* cb = containingBlock(); 1453 RenderBlock* cb = containingBlock();
1445 if (cb->isRenderBlockFlow()) 1454 if (cb->isRenderBlockFlow())
1446 return toRenderBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(), false, availableLogicalHeight(IncludeMarginBorderPadding)); 1455 return toRenderBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(), false, availableLogicalHeight(IncludeMarginBorderPadding));
1447 return 0; 1456 return 0;
1448 } 1457 }
(...skipping 2664 matching lines...) Expand 10 before | Expand all | Expand 10 after
4113 // Note this is just a heuristic, and it's still possible to have overflow u nder these 4122 // Note this is just a heuristic, and it's still possible to have overflow u nder these
4114 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow 4123 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow
4115 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway. 4124 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway.
4116 return !style()->logicalHeight().isIntrinsicOrAuto() 4125 return !style()->logicalHeight().isIntrinsicOrAuto()
4117 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().isPercent() || per centageLogicalHeightIsResolvable(this))) 4126 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().isPercent() || per centageLogicalHeightIsResolvable(this)))
4118 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this))); 4127 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this)));
4119 } 4128 }
4120 4129
4121 bool RenderBox::isUnsplittableForPagination() const 4130 bool RenderBox::isUnsplittableForPagination() const
4122 { 4131 {
4123 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot()); 4132 // FIXME: column spanners are only unsplittable (or rather: they do not part icipate in
4133 // fragmentation) in their nearest ancestor multicol container. If there are additional
4134 // fragmentation contexts further up in the tree, spanners still need to tak e those into
4135 // account.
4136 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot()) || isColumnSpanAll();
4124 } 4137 }
4125 4138
4126 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction , LinePositionMode /*linePositionMode*/) const 4139 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction , LinePositionMode /*linePositionMode*/) const
4127 { 4140 {
4128 if (isReplaced()) 4141 if (isReplaced())
4129 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left(); 4142 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left();
4130 return 0; 4143 return 0;
4131 } 4144 }
4132 4145
4133 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L ineDirectionMode direction, LinePositionMode linePositionMode) const 4146 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L ineDirectionMode direction, LinePositionMode linePositionMode) const
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
4438 4451
4439 setLogicalTop(oldLogicalTop); 4452 setLogicalTop(oldLogicalTop);
4440 setLogicalWidth(oldLogicalWidth); 4453 setLogicalWidth(oldLogicalWidth);
4441 setMarginLeft(oldMarginLeft); 4454 setMarginLeft(oldMarginLeft);
4442 setMarginRight(oldMarginRight); 4455 setMarginRight(oldMarginRight);
4443 4456
4444 return borderBox; 4457 return borderBox;
4445 } 4458 }
4446 4459
4447 } // namespace blink 4460 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698