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

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

Issue 855413002: [New Multicolumn] Support for block direction margins on spanners. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: code review - add descriptions to tests. Created 5 years, 11 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) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 continue; 1060 continue;
1061 } 1061 }
1062 if (child->isFloating()) { 1062 if (child->isFloating()) {
1063 insertFloatingObject(*child); 1063 insertFloatingObject(*child);
1064 adjustFloatingBlock(marginInfo); 1064 adjustFloatingBlock(marginInfo);
1065 continue; 1065 continue;
1066 } 1066 }
1067 if (child->isColumnSpanAll()) { 1067 if (child->isColumnSpanAll()) {
1068 // This is not the containing block of the spanner. The spanner's pl aceholder will lay 1068 // This is not the containing block of the spanner. The spanner's pl aceholder will lay
1069 // it out in due course. For now we just need to consult our flow th read, so that the 1069 // it out in due course. For now we just need to consult our flow th read, so that the
1070 // columns (if any) preceding and following the spanner are laid out correctly. 1070 // columns (if any) preceding and following the spanner are laid out correctly. But
1071 // first we apply the pending margin, so that it's taken into consid eration and doesn't
1072 // end up on the other side of the spanner.
1073 setLogicalHeight(logicalHeight() + marginInfo.margin());
1074 marginInfo.clearMargin();
1075
1071 LayoutUnit adjustment = flowThreadContainingBlock()->skipColumnSpann er(child, offsetFromLogicalTopOfFirstPage() + logicalHeight()); 1076 LayoutUnit adjustment = flowThreadContainingBlock()->skipColumnSpann er(child, offsetFromLogicalTopOfFirstPage() + logicalHeight());
1072 setLogicalHeight(logicalHeight() + adjustment); 1077 setLogicalHeight(logicalHeight() + adjustment);
1073 continue; 1078 continue;
1074 } 1079 }
1075 1080
1076 // Lay out the child. 1081 // Lay out the child.
1077 layoutBlockChild(*child, marginInfo, previousFloatLogicalBottom); 1082 layoutBlockChild(*child, marginInfo, previousFloatLogicalBottom);
1078 lastNormalFlowChild = child; 1083 lastNormalFlowChild = child;
1079 } 1084 }
1080 1085
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 RenderBlockFlow* childBlockFlow = toRenderBlockFlow(&child); 1475 RenderBlockFlow* childBlockFlow = toRenderBlockFlow(&child);
1471 if (childBlockFlow->childrenInline() || childBlockFlow->isWritingModeRoot()) 1476 if (childBlockFlow->childrenInline() || childBlockFlow->isWritingModeRoot())
1472 return; 1477 return;
1473 1478
1474 MarginInfo childMarginInfo(childBlockFlow, childBlockFlow->borderBefore() + childBlockFlow->paddingBefore(), childBlockFlow->borderAfter() + childBlockFlow- >paddingAfter()); 1479 MarginInfo childMarginInfo(childBlockFlow, childBlockFlow->borderBefore() + childBlockFlow->paddingBefore(), childBlockFlow->borderAfter() + childBlockFlow- >paddingAfter());
1475 if (!childMarginInfo.canCollapseMarginBeforeWithChildren()) 1480 if (!childMarginInfo.canCollapseMarginBeforeWithChildren())
1476 return; 1481 return;
1477 1482
1478 RenderBox* grandchildBox = childBlockFlow->firstChildBox(); 1483 RenderBox* grandchildBox = childBlockFlow->firstChildBox();
1479 for ( ; grandchildBox; grandchildBox = grandchildBox->nextSiblingBox()) { 1484 for ( ; grandchildBox; grandchildBox = grandchildBox->nextSiblingBox()) {
1480 if (!grandchildBox->isFloatingOrOutOfFlowPositioned()) 1485 if (!grandchildBox->isFloatingOrOutOfFlowPositioned() && !grandchildBox- >isColumnSpanAll())
1481 break; 1486 break;
1482 } 1487 }
1483 1488
1484 if (!grandchildBox) 1489 if (!grandchildBox)
1485 return; 1490 return;
1486 1491
1487 // Make sure to update the block margins now for the grandchild box so that we're looking at current values. 1492 // Make sure to update the block margins now for the grandchild box so that we're looking at current values.
1488 if (grandchildBox->needsLayout()) { 1493 if (grandchildBox->needsLayout()) {
1489 grandchildBox->computeAndSetBlockDirectionMargins(this); 1494 grandchildBox->computeAndSetBlockDirectionMargins(this);
1490 if (grandchildBox->isRenderBlock()) { 1495 if (grandchildBox->isRenderBlock()) {
(...skipping 1654 matching lines...) Expand 10 before | Expand all | Expand 10 after
3145 FrameView* frameView = document().view(); 3150 FrameView* frameView = document().view();
3146 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3151 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3147 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3152 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3148 if (size().height() < visibleHeight) 3153 if (size().height() < visibleHeight)
3149 top += (visibleHeight - size().height()) / 2; 3154 top += (visibleHeight - size().height()) / 2;
3150 setY(top); 3155 setY(top);
3151 dialog->setCentered(top); 3156 dialog->setCentered(top);
3152 } 3157 }
3153 3158
3154 } // namespace blink 3159 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/span/trailing-margin-before-spanner-expected.html ('k') | Source/core/rendering/RenderBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698