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

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

Issue 2699653002: Avoid over-eager clipping of child layers in multicol. (Closed)
Patch Set: Add test that demonstrates what is now fixed in the rebaselined border-antialiasing.html 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
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win7/fast/borders/border-antialiasing-expected.png ('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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 LayoutRect LayoutMultiColumnSet::flowThreadPortionOverflowRect() const { 305 LayoutRect LayoutMultiColumnSet::flowThreadPortionOverflowRect() const {
306 return overflowRectForFlowThreadPortion(flowThreadPortionRect(), 306 return overflowRectForFlowThreadPortion(flowThreadPortionRect(),
307 !previousSiblingMultiColumnSet(), 307 !previousSiblingMultiColumnSet(),
308 !nextSiblingMultiColumnSet()); 308 !nextSiblingMultiColumnSet());
309 } 309 }
310 310
311 LayoutRect LayoutMultiColumnSet::overflowRectForFlowThreadPortion( 311 LayoutRect LayoutMultiColumnSet::overflowRectForFlowThreadPortion(
312 const LayoutRect& flowThreadPortionRect, 312 const LayoutRect& flowThreadPortionRect,
313 bool isFirstPortion, 313 bool isFirstPortion,
314 bool isLastPortion) const { 314 bool isLastPortion) const {
315 if (hasOverflowClip()) 315 // Only clip along the block direction axis.
316 return flowThreadPortionRect; 316 LayoutRect clipRect(LayoutRect::infiniteIntRect());
317 317
318 LayoutRect flowThreadOverflow = m_flowThread->visualOverflowRect();
319
320 // Only clip along the flow thread axis.
321 LayoutRect clipRect;
322 if (m_flowThread->isHorizontalWritingMode()) { 318 if (m_flowThread->isHorizontalWritingMode()) {
323 LayoutUnit minY = 319 if (!isFirstPortion)
324 isFirstPortion ? flowThreadOverflow.y() : flowThreadPortionRect.y(); 320 clipRect.shiftYEdgeTo(flowThreadPortionRect.y());
325 LayoutUnit maxY = isLastPortion ? std::max(flowThreadPortionRect.maxY(), 321 if (!isLastPortion)
326 flowThreadOverflow.maxY()) 322 clipRect.shiftMaxYEdgeTo(flowThreadPortionRect.maxY());
327 : flowThreadPortionRect.maxY(); 323 return clipRect;
328 LayoutUnit minX =
329 std::min(flowThreadPortionRect.x(), flowThreadOverflow.x());
330 LayoutUnit maxX =
331 std::max(flowThreadPortionRect.maxX(), flowThreadOverflow.maxX());
332 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
333 } else {
334 LayoutUnit minX =
335 isFirstPortion ? flowThreadOverflow.x() : flowThreadPortionRect.x();
336 LayoutUnit maxX = isLastPortion ? std::max(flowThreadPortionRect.maxX(),
337 flowThreadOverflow.maxX())
338 : flowThreadPortionRect.maxX();
339 LayoutUnit minY =
340 std::min(flowThreadPortionRect.y(), (flowThreadOverflow.y()));
341 LayoutUnit maxY =
342 std::max(flowThreadPortionRect.y(), (flowThreadOverflow.maxY()));
343 clipRect = LayoutRect(minX, minY, maxX - minX, maxY - minY);
344 } 324 }
345 325 if (!isFirstPortion)
326 clipRect.shiftXEdgeTo(flowThreadPortionRect.x());
327 if (!isLastPortion)
328 clipRect.shiftMaxXEdgeTo(flowThreadPortionRect.maxX());
346 return clipRect; 329 return clipRect;
347 } 330 }
348 331
349 bool LayoutMultiColumnSet::heightIsAuto() const { 332 bool LayoutMultiColumnSet::heightIsAuto() const {
350 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread(); 333 LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread();
351 if (!flowThread->isLayoutPagedFlowThread()) { 334 if (!flowThread->isLayoutPagedFlowThread()) {
352 // If support for the column-fill property isn't enabled, we want to behave 335 // If support for the column-fill property isn't enabled, we want to behave
353 // as if column-fill were auto, so that multicol containers with specified 336 // as if column-fill were auto, so that multicol containers with specified
354 // height don't get their columns balanced (auto-height multicol containers 337 // height don't get their columns balanced (auto-height multicol containers
355 // will still get their columns balanced, even if column-fill isn't 338 // will still get their columns balanced, even if column-fill isn't
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 // Now add in column rule bounds, if present. 610 // Now add in column rule bounds, if present.
628 Vector<LayoutRect> columnRuleBounds; 611 Vector<LayoutRect> columnRuleBounds;
629 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) { 612 if (computeColumnRuleBounds(LayoutPoint(), columnRuleBounds)) {
630 for (auto& bound : columnRuleBounds) 613 for (auto& bound : columnRuleBounds)
631 blockFlowBounds.unite(bound); 614 blockFlowBounds.unite(bound);
632 } 615 }
633 return blockFlowBounds; 616 return blockFlowBounds;
634 } 617 }
635 618
636 } // namespace blink 619 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/platform/win7/fast/borders/border-antialiasing-expected.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698