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

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

Issue 1487083003: It's not just the last column set that may need additional fragmentainer groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sqrt(squareheight) Created 5 years 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons t 140 LayoutMultiColumnSet* LayoutMultiColumnSet::previousSiblingMultiColumnSet() cons t
141 { 141 {
142 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling-> previousSibling()) { 142 for (LayoutObject* sibling = previousSibling(); sibling; sibling = sibling-> previousSibling()) {
143 if (sibling->isLayoutMultiColumnSet()) 143 if (sibling->isLayoutMultiColumnSet())
144 return toLayoutMultiColumnSet(sibling); 144 return toLayoutMultiColumnSet(sibling);
145 } 145 }
146 return nullptr; 146 return nullptr;
147 } 147 }
148 148
149 bool LayoutMultiColumnSet::hasFragmentainerGroupForColumnAt(LayoutUnit offsetInF lowThread) const
150 {
151 const MultiColumnFragmentainerGroup& lastRow = lastFragmentainerGroup();
152 if (lastRow.logicalTopInFlowThread() > offsetInFlowThread)
153 return true;
154 return offsetInFlowThread - lastRow.logicalTopInFlowThread() < lastRow.logic alHeight() * usedColumnCount();
155 }
156
149 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup () 157 MultiColumnFragmentainerGroup& LayoutMultiColumnSet::appendNewFragmentainerGroup ()
150 { 158 {
151 MultiColumnFragmentainerGroup newGroup(*this); 159 MultiColumnFragmentainerGroup newGroup(*this);
152 { // Extra scope here for previousGroup; it's potentially invalid once we mo dify the m_fragmentainerGroups Vector. 160 { // Extra scope here for previousGroup; it's potentially invalid once we mo dify the m_fragmentainerGroups Vector.
153 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las t(); 161 MultiColumnFragmentainerGroup& previousGroup = m_fragmentainerGroups.las t();
154 162
155 // This is the flow thread block offset where |previousGroup| ends and | newGroup| takes over. 163 // This is the flow thread block offset where |previousGroup| ends and | newGroup| takes over.
156 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea d() + previousGroup.logicalHeight() * usedColumnCount(); 164 LayoutUnit blockOffsetInFlowThread = previousGroup.logicalTopInFlowThrea d() + previousGroup.logicalHeight() * usedColumnCount();
157 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread); 165 previousGroup.setLogicalBottomInFlowThread(blockOffsetInFlowThread);
158 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread); 166 newGroup.setLogicalTopInFlowThread(blockOffsetInFlowThread);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 398
391 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const 399 LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
392 { 400 {
393 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread()); 401 LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWi dth(), logicalHeightInFlowThread());
394 if (!isHorizontalWritingMode()) 402 if (!isHorizontalWritingMode())
395 return portionRect.transposedRect(); 403 return portionRect.transposedRect();
396 return portionRect; 404 return portionRect;
397 } 405 }
398 406
399 } 407 }
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