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

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

Issue 2711003005: Merge overflowRectForFlowThreadPortion() into flowThreadPortionOverflowRectAt(). (Closed)
Patch Set: Created 3 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
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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 295 }
296 296
297 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const { 297 LayoutUnit LayoutMultiColumnSet::logicalTopInFlowThread() const {
298 return firstFragmentainerGroup().logicalTopInFlowThread(); 298 return firstFragmentainerGroup().logicalTopInFlowThread();
299 } 299 }
300 300
301 LayoutUnit LayoutMultiColumnSet::logicalBottomInFlowThread() const { 301 LayoutUnit LayoutMultiColumnSet::logicalBottomInFlowThread() const {
302 return lastFragmentainerGroup().logicalBottomInFlowThread(); 302 return lastFragmentainerGroup().logicalBottomInFlowThread();
303 } 303 }
304 304
305 LayoutRect LayoutMultiColumnSet::flowThreadPortionOverflowRect() const {
306 return overflowRectForFlowThreadPortion(flowThreadPortionRect(),
307 !previousSiblingMultiColumnSet(),
308 !nextSiblingMultiColumnSet());
309 }
310
311 LayoutRect LayoutMultiColumnSet::overflowRectForFlowThreadPortion(
312 const LayoutRect& flowThreadPortionRect,
313 bool isFirstPortion,
314 bool isLastPortion) const {
315 // Only clip along the block direction axis.
316 LayoutRect clipRect(LayoutRect::infiniteIntRect());
317
318 if (m_flowThread->isHorizontalWritingMode()) {
319 if (!isFirstPortion)
320 clipRect.shiftYEdgeTo(flowThreadPortionRect.y());
321 if (!isLastPortion)
322 clipRect.shiftMaxYEdgeTo(flowThreadPortionRect.maxY());
323 return clipRect;
324 }
325 if (!isFirstPortion)
326 clipRect.shiftXEdgeTo(flowThreadPortionRect.x());
327 if (!isLastPortion)
328 clipRect.shiftMaxXEdgeTo(flowThreadPortionRect.maxX());
329 return clipRect;
330 }
331
332 bool LayoutMultiColumnSet::heightIsAuto() const { 305 bool LayoutMultiColumnSet::heightIsAuto() const {
333 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread(); 306 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread();
334 if (!flowThread->isLayoutPagedFlowThread()) { 307 if (!flowThread->isLayoutPagedFlowThread()) {
335 // If support for the column-fill property isn't enabled, we want to behave 308 // If support for the column-fill property isn't enabled, we want to behave
336 // as if column-fill were auto, so that multicol containers with specified 309 // as if column-fill were auto, so that multicol containers with specified
337 // height don't get their columns balanced (auto-height multicol containers 310 // height don't get their columns balanced (auto-height multicol containers
338 // will still get their columns balanced, even if column-fill isn't 311 // will still get their columns balanced, even if column-fill isn't
339 // 'balance' - in accordance with the spec). 312 // 'balance' - in accordance with the spec).
340 // Pretending that column-fill is auto also matches the old multicol 313 // Pretending that column-fill is auto also matches the old multicol
341 // implementation, which has no support for this property. 314 // implementation, which has no support for this property.
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 // Now add in column rule bounds, if present. 583 // Now add in column rule bounds, if present.
611 Vector<LayoutRect> columnRuleBounds; 584 Vector<LayoutRect> columnRuleBounds;
612 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { 585 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) {
613 for (auto& bound : columnRuleBounds) 586 for (auto& bound : columnRuleBounds)
614 blockFlowBounds.unite(bound); 587 blockFlowBounds.unite(bound);
615 } 588 }
616 return blockFlowBounds; 589 return blockFlowBounds;
617 } 590 }
618 591
619 } // namespace blink 592 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698