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

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

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/LayoutState.h ('k') | Source/core/layout/LayoutTable.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) 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 30 matching lines...) Expand all
41 , m_flowThread(0) 41 , m_flowThread(0)
42 , m_columnInfo(0) 42 , m_columnInfo(0)
43 , m_next(0) 43 , m_next(0)
44 , m_pageLogicalHeight(pageLogicalHeight) 44 , m_pageLogicalHeight(pageLogicalHeight)
45 , m_renderer(view) 45 , m_renderer(view)
46 { 46 {
47 ASSERT(!view.layoutState()); 47 ASSERT(!view.layoutState());
48 view.pushLayoutState(*this); 48 view.pushLayoutState(*this);
49 } 49 }
50 50
51 LayoutState::LayoutState(RenderBox& renderer, const LayoutSize& offset, LayoutUn it pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo, boo l containingBlockLogicalWidthChanged) 51 LayoutState::LayoutState(LayoutBox& renderer, const LayoutSize& offset, LayoutUn it pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo, boo l containingBlockLogicalWidthChanged)
52 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged) 52 : m_containingBlockLogicalWidthChanged(containingBlockLogicalWidthChanged)
53 , m_columnInfo(columnInfo) 53 , m_columnInfo(columnInfo)
54 , m_next(renderer.view()->layoutState()) 54 , m_next(renderer.view()->layoutState())
55 , m_renderer(renderer) 55 , m_renderer(renderer)
56 { 56 {
57 m_flowThread = renderer.isLayoutFlowThread() ? toLayoutFlowThread(&renderer) : m_next->flowThread(); 57 m_flowThread = renderer.isLayoutFlowThread() ? toLayoutFlowThread(&renderer) : m_next->flowThread();
58 renderer.view()->pushLayoutState(*this); 58 renderer.view()->pushLayoutState(*this);
59 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position( ) == FixedPosition; 59 bool fixed = renderer.isOutOfFlowPositioned() && renderer.style()->position( ) == FixedPosition;
60 if (fixed) { 60 if (fixed) {
61 // FIXME: This doesn't work correctly with transforms. 61 // FIXME: This doesn't work correctly with transforms.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 } 133 }
134 134
135 void LayoutState::clearPaginationInformation() 135 void LayoutState::clearPaginationInformation()
136 { 136 {
137 m_pageLogicalHeight = m_next->m_pageLogicalHeight; 137 m_pageLogicalHeight = m_next->m_pageLogicalHeight;
138 m_pageOffset = m_next->m_pageOffset; 138 m_pageOffset = m_next->m_pageOffset;
139 m_columnInfo = m_next->m_columnInfo; 139 m_columnInfo = m_next->m_columnInfo;
140 } 140 }
141 141
142 LayoutUnit LayoutState::pageLogicalOffset(const RenderBox& child, const LayoutUn it& childLogicalOffset) const 142 LayoutUnit LayoutState::pageLogicalOffset(const LayoutBox& child, const LayoutUn it& childLogicalOffset) const
143 { 143 {
144 if (child.isHorizontalWritingMode()) 144 if (child.isHorizontalWritingMode())
145 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.heigh t(); 145 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.heigh t();
146 return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width(); 146 return m_layoutOffset.width() + childLogicalOffset - m_pageOffset.width();
147 } 147 }
148 148
149 void LayoutState::addForcedColumnBreak(const RenderBox& child, const LayoutUnit& childLogicalOffset) 149 void LayoutState::addForcedColumnBreak(const LayoutBox& child, const LayoutUnit& childLogicalOffset)
150 { 150 {
151 if (!m_columnInfo || m_columnInfo->columnHeight()) 151 if (!m_columnInfo || m_columnInfo->columnHeight())
152 return; 152 return;
153 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset)); 153 m_columnInfo->addForcedBreak(pageLogicalOffset(child, childLogicalOffset));
154 } 154 }
155 155
156 } // namespace blink 156 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutState.h ('k') | Source/core/layout/LayoutTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698