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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.cpp

Issue 1573133002: Need to examine the *bottom* of fragmented content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Slim down the patch; back out columnSetAtBlockOffset() changes. This was already broken prior to th… Created 4 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 | « third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.h ('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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons t 139 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons t
140 { 140 {
141 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling-> previousSibling()) { 141 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling-> previousSibling()) {
142 if (sibling->isLayoutMultiColumnSet()) 142 if (sibling->isLayoutMultiColumnSet())
143 return toLayoutMultiColumnSet(sibling); 143 return toLayoutMultiColumnSet(sibling);
144 } 144 }
145 return nullptr; 145 return nullptr;
146 } 146 }
147 147
148 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit offsetInF lowThread) const 148 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit bottomOff setInFlowThread) const
149 { 149 {
150 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup(); 150 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup();
151 if (lastRow.logicalTopInFlowThread() > offsetInFlowThread) 151 if (lastRow.logicalTopInFlowThread() > bottomOffsetInFlowThread)
152 return true; 152 return true;
153 return offsetInFlowThread - lastRow.logicalTopInFlowThread() < lastRow.logic alHeight() * usedColumnCount(); 153 return bottomOffsetInFlowThread - lastRow.logicalTopInFlowThread() <= lastRo w.logicalHeight() * usedColumnCount();
154 } 154 }
155 155
156 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup () 156 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup ()
157 { 157 {
158 MultiColumnFragmentainerGroup newGroup(*this); 158 MultiColumnFragmentainerGroup newGroup(*this);
159 { // Extra scope here for previousGroup; it's potentially invalid once we mo dify the m_fragmentainerGroups Vector. 159 { // Extra scope here for previousGroup; it's potentially invalid once we mo dify the m_fragmentainerGroups Vector.
160 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las t(); 160 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las t();
161 161
162 // This is the flow thread block offset where |previousGroup| ends and | newGroup| takes over. 162 // This is the flow thread block offset where |previousGroup| ends and | newGroup| takes over.
163 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea d() + previousGroup.logicalHeight() * usedColumnCount(); 163 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea d() + previousGroup.logicalHeight() * usedColumnCount();
164 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread); 164 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread);
165 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread); 165 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread);
166
167 newGroup.setLogicalTop(previousGroup.logicalTop() + previousGroup.logica lHeight()); 166 newGroup.setLogicalTop(previousGroup.logicalTop() + previousGroup.logica lHeight());
168 newGroup.resetColumnHeight(); 167 newGroup.resetColumnHeight();
169 } 168 }
170 m_fragmentainerGroups.append(newGroup); 169 m_fragmentainerGroups.append(newGroup);
171 return m_fragmentainerGroups.last(); 170 return m_fragmentainerGroups.last();
172 } 171 }
173 172
174 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const 173 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const
175 { 174 {
176 return firstFragmentainerGroup().logicalTopInFlowThread(); 175 return firstFragmentainerGroup().logicalTopInFlowThread();
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 396
398 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const 397 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
399 { 398 {
400 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread()); 399 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread());
401 if (!isHorizontalWritingMode()) 400 if (!isHorizontalWritingMode())
402 return portionRect.transposedRect(); 401 return portionRect.transposedRect();
403 return portionRect; 402 return portionRect;
404 } 403 }
405 404
406 } 405 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698