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

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

Issue 551263005: *** DO NOT LAND *** Implement column-span:all without reparenting renderers. Work in progress. (Closed) Base URL: git:blink.git@new-multicol-no-renderer-reparenting
Patch Set: Copy margin properties from a spanner to its spanner set, to simplify code. Created 6 years, 3 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 parentToInvalidate->invalidateBackgroundObscurationStatus(); 218 parentToInvalidate->invalidateBackgroundObscurationStatus();
219 parentToInvalidate = parentToInvalidate->parent(); 219 parentToInvalidate = parentToInvalidate->parent();
220 } 220 }
221 } 221 }
222 222
223 if (isDocumentElement() || isBody()) 223 if (isDocumentElement() || isBody())
224 document().view()->recalculateScrollbarOverlayStyle(); 224 document().view()->recalculateScrollbarOverlayStyle();
225 225
226 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle); 226 updateShapeOutsideInfoAfterStyleChange(*style(), oldStyle);
227 updateGridPositionAfterStyleChange(oldStyle); 227 updateGridPositionAfterStyleChange(oldStyle);
228
229 if (RenderFlowThread* flowThread = flowThreadContainingBlock()) {
230 if (flowThread != this)
231 flowThread->flowThreadDescendantStyleDidChange(this);
232 }
228 } 233 }
229 234
230 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style, const RenderStyle* oldStyle) 235 void RenderBox::updateShapeOutsideInfoAfterStyleChange(const RenderStyle& style, const RenderStyle* oldStyle)
231 { 236 {
232 const ShapeValue* shapeOutside = style.shapeOutside(); 237 const ShapeValue* shapeOutside = style.shapeOutside();
233 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Re nderStyle::initialShapeOutside(); 238 const ShapeValue* oldShapeOutside = oldStyle ? oldStyle->shapeOutside() : Re nderStyle::initialShapeOutside();
234 239
235 Length shapeMargin = style.shapeMargin(); 240 Length shapeMargin = style.shapeMargin();
236 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin(); 241 Length oldShapeMargin = oldStyle ? oldStyle->shapeMargin() : RenderStyle::in itialShapeMargin();
237 242
(...skipping 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2338 2343
2339 bool RenderBox::autoWidthShouldFitContent() const 2344 bool RenderBox::autoWidthShouldFitContent() const
2340 { 2345 {
2341 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node()) 2346 return node() && (isHTMLInputElement(*node()) || isHTMLSelectElement(*node() ) || isHTMLButtonElement(*node())
2342 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition())); 2347 || isHTMLTextAreaElement(*node()) || (isHTMLLegendElement(*node()) && !s tyle()->hasOutOfFlowPosition()));
2343 } 2348 }
2344 2349
2345 void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const 2350 void RenderBox::computeMarginsForDirection(MarginDirection flowDirection, const RenderBlock* containingBlock, LayoutUnit containerWidth, LayoutUnit childWidth, LayoutUnit& marginStart, LayoutUnit& marginEnd, Length marginStartLength, Length marginEndLength) const
2346 { 2351 {
2347 if (flowDirection == BlockDirection || isFloating() || isInline()) { 2352 if (flowDirection == BlockDirection || isFloating() || isInline()) {
2348 if (isTableCell() && flowDirection == BlockDirection) { 2353 if ((isColumnSpanAll() || isTableCell()) && flowDirection == BlockDirect ion) {
2349 // FIXME: Not right if we allow cells to have different directionali ty than the table. If we do allow this, though, 2354 // FIXME: Not right if we allow cells to have different directionali ty than the table. If we do allow this, though,
2350 // we may just do it with an extra anonymous block inside the cell. 2355 // we may just do it with an extra anonymous block inside the cell.
2351 marginStart = 0; 2356 marginStart = 0;
2352 marginEnd = 0; 2357 marginEnd = 0;
2353 return; 2358 return;
2354 } 2359 }
2355 2360
2356 // Margins are calculated with respect to the logical width of 2361 // Margins are calculated with respect to the logical width of
2357 // the containing block (8.3) 2362 // the containing block (8.3)
2358 // Inline blocks/tables and floats don't have their margins increased. 2363 // Inline blocks/tables and floats don't have their margins increased.
(...skipping 2104 matching lines...) Expand 10 before | Expand all | Expand 10 after
4463 return rect.transposedRect(); 4468 return rect.transposedRect();
4464 return rect; 4469 return rect;
4465 } 4470 }
4466 4471
4467 LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const 4472 LayoutRect RenderBox::layoutOverflowRectForPropagation(RenderStyle* parentStyle) const
4468 { 4473 {
4469 // Only propagate interior layout overflow if we don't clip it. 4474 // Only propagate interior layout overflow if we don't clip it.
4470 LayoutRect rect = borderBoxRect(); 4475 LayoutRect rect = borderBoxRect();
4471 // We want to include the margin, but only when it adds height. Quirky margi ns don't contribute height 4476 // We want to include the margin, but only when it adds height. Quirky margi ns don't contribute height
4472 // nor do the margins of self-collapsing blocks. 4477 // nor do the margins of self-collapsing blocks.
4473 if (!style()->hasMarginAfterQuirk() && !isSelfCollapsingBlock()) { 4478 if (!style()->hasMarginAfterQuirk() && !isSelfCollapsingBlock())
4474 LayoutState* layoutState = view()->layoutState(); 4479 rect.expand(isHorizontalWritingMode() ? LayoutSize(LayoutUnit(), marginA fter()) : LayoutSize(marginAfter(), LayoutUnit()));
4475 // FIXME: if the margin has collapsed with a page/column boundary, the p art that got
4476 // collapsed away must not be propagated here. All other margins should be propagated,
4477 // though, but for now, we just ignore them in paginated mode.
4478 if (!layoutState || !layoutState->isPaginated())
4479 rect.expand(isHorizontalWritingMode() ? LayoutSize(LayoutUnit(), mar ginAfter()) : LayoutSize(marginAfter(), LayoutUnit()));
4480 }
4481 4480
4482 if (!hasOverflowClip()) 4481 if (!hasOverflowClip())
4483 rect.unite(layoutOverflowRect()); 4482 rect.unite(layoutOverflowRect());
4484 4483
4485 bool hasTransform = hasLayer() && layer()->transform(); 4484 bool hasTransform = hasLayer() && layer()->transform();
4486 if (isRelPositioned() || hasTransform) { 4485 if (isRelPositioned() || hasTransform) {
4487 // If we are relatively positioned or if we have a transform, then we ha ve to convert 4486 // If we are relatively positioned or if we have a transform, then we ha ve to convert
4488 // this rectangle into physical coordinates, apply relative positioning and transforms 4487 // this rectangle into physical coordinates, apply relative positioning and transforms
4489 // to it, and then convert it back. 4488 // to it, and then convert it back.
4490 flipForWritingMode(rect); 4489 flipForWritingMode(rect);
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
4765 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style) 4764 RenderBox::BoxDecorationData::BoxDecorationData(const RenderStyle& style)
4766 { 4765 {
4767 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor); 4766 backgroundColor = style.visitedDependentColor(CSSPropertyBackgroundColor);
4768 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage(); 4767 hasBackground = backgroundColor.alpha() || style.hasBackgroundImage();
4769 ASSERT(hasBackground == style.hasBackground()); 4768 ASSERT(hasBackground == style.hasBackground());
4770 hasBorder = style.hasBorder(); 4769 hasBorder = style.hasBorder();
4771 hasAppearance = style.hasAppearance(); 4770 hasAppearance = style.hasAppearance();
4772 } 4771 }
4773 4772
4774 } // namespace blink 4773 } // 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