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

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

Issue 584033002: [New Multicolumn] Add support for column-span:all (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix ref in test. Tables don't do subpixel, and that made a difference on Windows and Mac. 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
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFlowThread.h » ('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) 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 parentToInvalidate->invalidateBackgroundObscurationStatus(); 210 parentToInvalidate->invalidateBackgroundObscurationStatus();
210 parentToInvalidate = parentToInvalidate->parent(); 211 parentToInvalidate = parentToInvalidate->parent();
211 } 212 }
212 } 213 }
213 214
214 if (isDocumentElement() || isBody()) 215 if (isDocumentElement() || isBody())
215 document().view()->recalculateScrollbarOverlayStyle(); 216 document().view()->recalculateScrollbarOverlayStyle();
216 217
217 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); 218 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
218 updateGridPositionAfterStyleChange(oldStyle); 219 updateGridPositionAfterStyleChange(oldStyle);
220
221 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) {
222 if (flowThread != this)
223 flowThread->flowThreadDescendantStyleDidChange(this);
224 }
219 } 225 }
220 226
221 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style, const RenderStyle* oldStyle) 227 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style, const RenderStyle* oldStyle)
222 { 228 {
223 const ShapeValue* shapeOutside = style.shapeOutside(); 229 const ShapeValue* shapeOutside = style.shapeOutside();
224 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Re nderStyle::initialShapeOutside(); 230 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Re nderStyle::initialShapeOutside();
225 231
226 Length shapeMargin = style.shapeMargin(); 232 Length shapeMargin = style.shapeMargin();
227 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin(); 233 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin();
228 234
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after
1475 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC ontent, startOffsetForLine); 1481 width += portionOfMarginNotConsumedByFloat(childMarginStart, startOffsetForC ontent, startOffsetForLine);
1476 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte nt, endOffsetForLine); 1482 width += portionOfMarginNotConsumedByFloat(childMarginEnd, endOffsetForConte nt, endOffsetForLine);
1477 return width; 1483 return width;
1478 } 1484 }
1479 1485
1480 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const 1486 LayoutUnit RenderBox::containingBlockLogicalWidthForContent() const
1481 { 1487 {
1482 if (hasOverrideContainingBlockLogicalWidth()) 1488 if (hasOverrideContainingBlockLogicalWidth())
1483 return overrideContainingBlockContentLogicalWidth(); 1489 return overrideContainingBlockContentLogicalWidth();
1484 1490
1485 RenderBlock* cb = containingBlock(); 1491 RenderBlock* cb;
1492 if (isColumnSpanAll())
1493 cb = flowThreadContainingBlock()->containingBlock();
1494 else
1495 cb = containingBlock();
1486 return cb->availableLogicalWidth(); 1496 return cb->availableLogicalWidth();
1487 } 1497 }
1488 1498
1489 LayoutUnit RenderBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const 1499 LayoutUnit RenderBox::containingBlockLogicalHeightForContent(AvailableLogicalHei ghtType heightType) const
1490 { 1500 {
1491 if (hasOverrideContainingBlockLogicalHeight()) 1501 if (hasOverrideContainingBlockLogicalHeight())
1492 return overrideContainingBlockContentLogicalHeight(); 1502 return overrideContainingBlockContentLogicalHeight();
1493 1503
1494 RenderBlock* cb = containingBlock(); 1504 RenderBlock* cb;
1505 if (isColumnSpanAll())
1506 cb = flowThreadContainingBlock()->containingBlock();
1507 else
1508 cb = containingBlock();
1495 return cb->availableLogicalHeight(heightType); 1509 return cb->availableLogicalHeight(heightType);
1496 } 1510 }
1497 1511
1498 LayoutUnit RenderBox::containingBlockAvailableLineWidth() const 1512 LayoutUnit RenderBox::containingBlockAvailableLineWidth() const
1499 { 1513 {
1500 RenderBlock* cb = containingBlock(); 1514 RenderBlock* cb = containingBlock();
1501 if (cb->isRenderBlockFlow()) 1515 if (cb->isRenderBlockFlow())
1502 return toRenderBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(), false, availableLogicalHeight(IncludeMarginBorderPadding)); 1516 return toRenderBlockFlow(cb)->availableLogicalWidthForLine(logicalTop(), false, availableLogicalHeight(IncludeMarginBorderPadding));
1503 return 0; 1517 return 0;
1504 } 1518 }
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2106 2120
2107 bool RenderBox::autoWidthShouldFitContent() const 2121 bool RenderBox::autoWidthShouldFitContent() const
2108 { 2122 {
2109 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node()) 2123 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node())
2110 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition())); 2124 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition()));
2111 } 2125 }
2112 2126
2113 void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const 2127 void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const
2114 { 2128 {
2115 if (flowDirection == BlockDirection || isFloating() || isInline()) { 2129 if (flowDirection == BlockDirection || isFloating() || isInline()) {
2116 if (isTableCell() && flowDirection == BlockDirection) { 2130 if ((isColumnSpanAll() || isTableCell()) && flowDirection == BlockDirect ion) {
2117 // FIXME: Not right if we allow cells to have different directionali ty than the table. If we do allow this, though, 2131 // FIXME: Not right if we allow cells to have different directionali ty than the table. If we do allow this, though,
2118 // we may just do it with an extra anonymous block inside the cell. 2132 // we may just do it with an extra anonymous block inside the cell.
2119 marginStart = 0; 2133 marginStart = 0;
2120 marginEnd = 0; 2134 marginEnd = 0;
2121 return; 2135 return;
2122 } 2136 }
2123 2137
2124 // Margins are calculated with respect to the logical width of 2138 // Margins are calculated with respect to the logical width of
2125 // the containing block (8.3) 2139 // the containing block (8.3)
2126 // Inline blocks/tables and floats don't have their margins increased. 2140 // Inline blocks/tables and floats don't have their margins increased.
(...skipping 2047 matching lines...) Expand 10 before | Expand all | Expand 10 after
4174 // Note this is just a heuristic, and it's still possible to have overflow u nder these 4188 // Note this is just a heuristic, and it's still possible to have overflow u nder these
4175 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow 4189 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow
4176 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway. 4190 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway.
4177 return !style()->logicalHeight().isIntrinsicOrAuto() 4191 return !style()->logicalHeight().isIntrinsicOrAuto()
4178 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().isPercent() || per centageLogicalHeightIsResolvable(this))) 4192 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().isPercent() || per centageLogicalHeightIsResolvable(this)))
4179 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this))); 4193 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().isPercent() || percent ageLogicalHeightIsResolvable(this)));
4180 } 4194 }
4181 4195
4182 bool RenderBox::isUnsplittableForPagination() const 4196 bool RenderBox::isUnsplittableForPagination() const
4183 { 4197 {
4184 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot()); 4198 // FIXME: column spanners are only unsplittable (or rather: they do not part icipate in
4199 // fragmentation) in their nearest ancestor multicol container. If there are additional
4200 // fragmentation contexts further up in the tree, spanners still need to tak e those into
4201 // account.
4202 return isReplaced() || hasUnsplittableScrollingOverflow() || (parent() && is WritingModeRoot()) || isColumnSpanAll();
4185 } 4203 }
4186 4204
4187 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction , LinePositionMode /*linePositionMode*/) const 4205 LayoutUnit RenderBox::lineHeight(bool /*firstLine*/, LineDirectionMode direction , LinePositionMode /*linePositionMode*/) const
4188 { 4206 {
4189 if (isReplaced()) 4207 if (isReplaced())
4190 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left(); 4208 return direction == HorizontalLine ? m_marginBox.top() + height() + m_ma rginBox.bottom() : m_marginBox.right() + width() + m_marginBox.left();
4191 return 0; 4209 return 0;
4192 } 4210 }
4193 4211
4194 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L ineDirectionMode direction, LinePositionMode linePositionMode) const 4212 int RenderBox::baselinePosition(FontBaseline baselineType, bool /*firstLine*/, L ineDirectionMode direction, LinePositionMode linePositionMode) const
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
4525 ASSERT(style()->hasBackground() || style()->hasBoxDecorations()); 4543 ASSERT(style()->hasBackground() || style()->hasBoxDecorations());
4526 4544
4527 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1) 4545 if (m_rareData && m_rareData->m_previousBorderBoxSize.width() != -1)
4528 return m_rareData->m_previousBorderBoxSize; 4546 return m_rareData->m_previousBorderBoxSize;
4529 4547
4530 // We didn't save the old border box size because it was the same as the siz e of oldBounds. 4548 // We didn't save the old border box size because it was the same as the siz e of oldBounds.
4531 return previousBoundsSize; 4549 return previousBoundsSize;
4532 } 4550 }
4533 4551
4534 } // namespace blink 4552 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.cpp ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698