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

Side by Side Diff: Source/core/layout/LayoutState.cpp

Issue 1108633002: [New Multicolumn] Only the nearest ancestral flow thread may serve as a containing flow thread. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: code review. Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | no next file » | 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) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 ASSERT(!view.layoutState()); 45 ASSERT(!view.layoutState());
46 view.pushLayoutState(*this); 46 view.pushLayoutState(*this);
47 } 47 }
48 48
49 LayoutState::LayoutState(LayoutBox& renderer, const LayoutSize& offset, LayoutUn it pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo, boo l containingBlockLogicalWidthChanged) 49 LayoutState::LayoutState(LayoutBox& renderer, const LayoutSize& offset, LayoutUn it pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo, boo l containingBlockLogicalWidthChanged)
50 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) 50 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged)
51 , m_columnInfo(columnInfo) 51 , m_columnInfo(columnInfo)
52 , m_next(renderer.view()->layoutState()) 52 , m_next(renderer.view()->layoutState())
53 , m_renderer(renderer) 53 , m_renderer(renderer)
54 { 54 {
55 m_flowThread = renderer.isLayoutFlowThread() ? toLayoutFlowThread(&renderer) : m_next->flowThread(); 55 if (renderer.isLayoutFlowThread())
56 m_flowThread = toLayoutFlowThread(&renderer);
57 else if (!renderer.isOutOfFlowPositioned() && !renderer.isColumnSpanAll())
58 m_flowThread = m_next->flowThread();
59 else
60 m_flowThread = nullptr;
56 renderer.view()->pushLayoutState(*this); 61 renderer.view()->pushLayoutState(*this);
57 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position( ) == FixedPosition; 62 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position( ) == FixedPosition;
58 if (fixed) { 63 if (fixed) {
59 // FIXME: This doesn't work correctly with transforms. 64 // FIXME: This doesn't work correctly with transforms.
60 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(), IsFixed); 65 FloatPoint fixedOffset = renderer.view()->localToAbsolute(FloatPoint(), IsFixed);
61 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset; 66 m_layoutOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset;
62 } else { 67 } else {
63 m_layoutOffset = m_next->m_layoutOffset + offset; 68 m_layoutOffset = m_next->m_layoutOffset + offset;
64 } 69 }
65 70
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 } 150 }
146 151
147 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit& childLogicalOffset) 152 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit& childLogicalOffset)
148 { 153 {
149 if (!m_columnInfo || m_columnInfo->columnHeight()) 154 if (!m_columnInfo || m_columnInfo->columnHeight())
150 return; 155 return;
151 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); 156 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset));
152 } 157 }
153 158
154 } // namespace blink 159 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698