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

Side by Side Diff: Source/core/rendering/RenderMultiColumnSet.cpp

Issue 265293005: [New Multicolumn] Update sets' flow thread portion rectangles properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove unnecessary call to validateRegions(). Created 6 years, 7 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 | « Source/core/rendering/RenderMultiColumnSet.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 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 // to encompass that remaining height and overflow. The idea is that we will generate 296 // to encompass that remaining height and overflow. The idea is that we will generate
297 // additional columns and pages to hold that overflow, since people do write bad 297 // additional columns and pages to hold that overflow, since people do write bad
298 // content like <body style="height:0px"> in multi-column layouts. 298 // content like <body style="height:0px"> in multi-column layouts.
299 bool isHorizontal = flowThread()->isHorizontalWritingMode(); 299 bool isHorizontal = flowThread()->isHorizontalWritingMode();
300 LayoutUnit logicalTopOffset = isHorizontal ? rect.y() : rect.x(); 300 LayoutUnit logicalTopOffset = isHorizontal ? rect.y() : rect.x();
301 LayoutRect layoutRect = flowThread()->layoutOverflowRect(); 301 LayoutRect layoutRect = flowThread()->layoutOverflowRect();
302 LayoutUnit logicalHeightWithOverflow = (isHorizontal ? layoutRect.maxY() : l ayoutRect.maxX()) - logicalTopOffset; 302 LayoutUnit logicalHeightWithOverflow = (isHorizontal ? layoutRect.maxY() : l ayoutRect.maxX()) - logicalTopOffset;
303 setFlowThreadPortionRect(LayoutRect(rect.x(), rect.y(), isHorizontal ? rect. width() : logicalHeightWithOverflow, isHorizontal ? logicalHeightWithOverflow : rect.height())); 303 setFlowThreadPortionRect(LayoutRect(rect.x(), rect.y(), isHorizontal ? rect. width() : logicalHeightWithOverflow, isHorizontal ? logicalHeightWithOverflow : rect.height()));
304 } 304 }
305 305
306 void RenderMultiColumnSet::layout()
307 {
308 RenderRegion::layout();
309
310 if (!nextSiblingMultiColumnSet()) {
311 // This is the last set, i.e. the last region. Seize the opportunity to validate them.
312 multiColumnFlowThread()->validateRegions();
313 }
314 }
315
306 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTo p, LogicalExtentComputedValues& computedValues) const 316 void RenderMultiColumnSet::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTo p, LogicalExtentComputedValues& computedValues) const
307 { 317 {
308 computedValues.m_extent = m_computedColumnHeight; 318 computedValues.m_extent = m_computedColumnHeight;
309 computedValues.m_position = logicalTop; 319 computedValues.m_position = logicalTop;
310 } 320 }
311 321
312 LayoutUnit RenderMultiColumnSet::columnGap() const 322 LayoutUnit RenderMultiColumnSet::columnGap() const
313 { 323 {
314 RenderBlockFlow* parentBlock = multiColumnBlockFlow(); 324 RenderBlockFlow* parentBlock = multiColumnBlockFlow();
315 if (parentBlock->style()->hasNormalColumnGap()) 325 if (parentBlock->style()->hasNormalColumnGap())
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 fragments.append(fragment); 631 fragments.append(fragment);
622 } 632 }
623 } 633 }
624 634
625 const char* RenderMultiColumnSet::renderName() const 635 const char* RenderMultiColumnSet::renderName() const
626 { 636 {
627 return "RenderMultiColumnSet"; 637 return "RenderMultiColumnSet";
628 } 638 }
629 639
630 } 640 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderMultiColumnSet.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698