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

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

Issue 792803002: [New Multicolumn] Layout support for column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@347325-placeholder
Patch Set: Code review. If there are no sets, return early. 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
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('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) 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 // invalidate our paint (and the child) anyway. 676 // invalidate our paint (and the child) anyway.
677 if (!selfNeedsLayout() && (childOffset.width() || childOffset.height())) 677 if (!selfNeedsLayout() && (childOffset.width() || childOffset.height()))
678 child.invalidatePaintForOverhangingFloats(true); 678 child.invalidatePaintForOverhangingFloats(true);
679 679
680 if (paginated) { 680 if (paginated) {
681 // Check for an after page/column break. 681 // Check for an after page/column break.
682 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf o); 682 LayoutUnit newHeight = applyAfterBreak(child, logicalHeight(), marginInf o);
683 if (newHeight != size().height()) 683 if (newHeight != size().height())
684 setLogicalHeight(newHeight); 684 setLogicalHeight(newHeight);
685 } 685 }
686
687 if (child.isRenderMultiColumnSpannerPlaceholder()) {
688 // The actual column-span:all element is positioned by this placeholder child.
689 positionSpannerDescendant(toRenderMultiColumnSpannerPlaceholder(child));
690 }
686 } 691 }
687 692
688 LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA fterClear, LayoutUnit estimateWithoutPagination, RenderBox& child, bool atBefore SideOfBlock) 693 LayoutUnit RenderBlockFlow::adjustBlockChildForPagination(LayoutUnit logicalTopA fterClear, LayoutUnit estimateWithoutPagination, RenderBox& child, bool atBefore SideOfBlock)
689 { 694 {
690 RenderBlockFlow* childBlockFlow = child.isRenderBlockFlow() ? toRenderBlockF low(&child) : 0; 695 RenderBlockFlow* childBlockFlow = child.isRenderBlockFlow() ? toRenderBlockF low(&child) : 0;
691 696
692 if (estimateWithoutPagination != logicalTopAfterClear) { 697 if (estimateWithoutPagination != logicalTopAfterClear) {
693 // Our guess prior to pagination movement was wrong. Before we attempt t o paginate, let's try again at the new 698 // Our guess prior to pagination movement was wrong. Before we attempt t o paginate, let's try again at the new
694 // position. 699 // position.
695 setLogicalHeight(logicalTopAfterClear); 700 setLogicalHeight(logicalTopAfterClear);
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 adjustPositionedBlock(*child, marginInfo); 1058 adjustPositionedBlock(*child, marginInfo);
1054 continue; 1059 continue;
1055 } 1060 }
1056 if (child->isFloating()) { 1061 if (child->isFloating()) {
1057 insertFloatingObject(*child); 1062 insertFloatingObject(*child);
1058 adjustFloatingBlock(marginInfo); 1063 adjustFloatingBlock(marginInfo);
1059 continue; 1064 continue;
1060 } 1065 }
1061 if (child->isColumnSpanAll()) { 1066 if (child->isColumnSpanAll()) {
1062 // This is not the containing block of the spanner. The spanner's pl aceholder will lay 1067 // This is not the containing block of the spanner. The spanner's pl aceholder will lay
1063 // it out in due course. 1068 // it out in due course. For now we just need to consult our flow th read, so that the
1069 // columns (if any) preceding and following the spanner are laid out correctly.
1070 LayoutUnit adjustment = flowThreadContainingBlock()->skipColumnSpann er(child, offsetFromLogicalTopOfFirstPage() + logicalHeight());
1071 setLogicalHeight(logicalHeight() + adjustment);
1064 continue; 1072 continue;
1065 } 1073 }
1066 1074
1067 // Lay out the child. 1075 // Lay out the child.
1068 layoutBlockChild(*child, marginInfo, previousFloatLogicalBottom); 1076 layoutBlockChild(*child, marginInfo, previousFloatLogicalBottom);
1069 lastNormalFlowChild = child; 1077 lastNormalFlowChild = child;
1070 } 1078 }
1071 1079
1072 // Now do the handling of the bottom of the block, adding in our bottom bord er/padding and 1080 // Now do the handling of the bottom of the block, adding in our bottom bord er/padding and
1073 // determining the correct collapsed bottom margin information. 1081 // determining the correct collapsed bottom margin information.
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
2965 void RenderBlockFlow::setPaginationStrut(LayoutUnit strut) 2973 void RenderBlockFlow::setPaginationStrut(LayoutUnit strut)
2966 { 2974 {
2967 if (!m_rareData) { 2975 if (!m_rareData) {
2968 if (!strut) 2976 if (!strut)
2969 return; 2977 return;
2970 m_rareData = adoptPtrWillBeNoop(new RenderBlockFlowRareData(this)); 2978 m_rareData = adoptPtrWillBeNoop(new RenderBlockFlowRareData(this));
2971 } 2979 }
2972 m_rareData->m_paginationStrut = strut; 2980 m_rareData->m_paginationStrut = strut;
2973 } 2981 }
2974 2982
2983 void RenderBlockFlow::positionSpannerDescendant(RenderMultiColumnSpannerPlacehol der& child)
2984 {
2985 RenderBox& spanner = *child.rendererInFlowThread();
2986 // FIXME: |spanner| is a descendant, but never a direct child, so the names here are bad, if
2987 // nothing else.
2988 setLogicalTopForChild(spanner, child.logicalTop());
2989 determineLogicalLeftPositionForChild(spanner);
2990 }
2991
2975 bool RenderBlockFlow::avoidsFloats() const 2992 bool RenderBlockFlow::avoidsFloats() const
2976 { 2993 {
2977 // Floats can't intrude into our box if we have a non-auto column count or w idth. 2994 // Floats can't intrude into our box if we have a non-auto column count or w idth.
2978 // Note: we need to use RenderBox::avoidsFloats here since RenderBlock::avoi dsFloats is always true. 2995 // Note: we need to use RenderBox::avoidsFloats here since RenderBlock::avoi dsFloats is always true.
2979 return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style ()->hasAutoColumnWidth(); 2996 return RenderBox::avoidsFloats() || !style()->hasAutoColumnCount() || !style ()->hasAutoColumnWidth();
2980 } 2997 }
2981 2998
2982 void RenderBlockFlow::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, Ren derObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool f ullRemoveInsert) 2999 void RenderBlockFlow::moveChildrenTo(RenderBoxModelObject* toBoxModelObject, Ren derObject* startChild, RenderObject* endChild, RenderObject* beforeChild, bool f ullRemoveInsert)
2983 { 3000 {
2984 if (childrenInline()) 3001 if (childrenInline())
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
3113 FrameView* frameView = document().view(); 3130 FrameView* frameView = document().view();
3114 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height(); 3131 LayoutUnit top = (style()->position() == FixedPosition) ? 0 : frameView->scr ollOffset().height();
3115 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( ); 3132 int visibleHeight = frameView->visibleContentRect(IncludeScrollbars).height( );
3116 if (size().height() < visibleHeight) 3133 if (size().height() < visibleHeight)
3117 top += (visibleHeight - size().height()) / 2; 3134 top += (visibleHeight - size().height()) / 2;
3118 setY(top); 3135 setY(top);
3119 dialog->setCentered(top); 3136 dialog->setCentered(top);
3120 } 3137 }
3121 3138
3122 } // namespace blink 3139 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBlockFlow.h ('k') | Source/core/rendering/RenderFlowThread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698