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

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

Issue 1503003002: Paginated containers are opaque to enclosing fragmentation contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase master 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/ColumnBalancer.cpp ('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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 spannerObjectInFlowThread->containingBlock()->setNeedsLayoutAndPrefWidthsRec alc(LayoutInvalidationReason::ColumnsChanged); 429 spannerObjectInFlowThread->containingBlock()->setNeedsLayoutAndPrefWidthsRec alc(LayoutInvalidationReason::ColumnsChanged);
430 430
431 // Now generate a column set for this ex-spanner, if needed and none is ther e for us already. 431 // Now generate a column set for this ex-spanner, if needed and none is ther e for us already.
432 flowThreadDescendantWasInserted(spannerObjectInFlowThread); 432 flowThreadDescendantWasInserted(spannerObjectInFlowThread);
433 433
434 return true; 434 return true;
435 } 435 }
436 436
437 LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::enclosingFlowThread() const 437 LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::enclosingFlowThread() const
438 { 438 {
439 if (isLayoutPagedFlowThread()) {
440 // Paged overflow containers should never be fragmented by enclosing fra gmentation
441 // contexts. They are to be treated as unbreakable content.
442 return nullptr;
443 }
439 if (multiColumnBlockFlow()->isInsideFlowThread()) 444 if (multiColumnBlockFlow()->isInsideFlowThread())
440 return toLayoutMultiColumnFlowThread(locateFlowThreadContainingBlockOf(* multiColumnBlockFlow())); 445 return toLayoutMultiColumnFlowThread(locateFlowThreadContainingBlockOf(* multiColumnBlockFlow()));
441 return nullptr; 446 return nullptr;
442 } 447 }
443 448
444 FragmentationContext* LayoutMultiColumnFlowThread::enclosingFragmentationContext () const 449 FragmentationContext* LayoutMultiColumnFlowThread::enclosingFragmentationContext () const
445 { 450 {
446 if (LayoutMultiColumnFlowThread* enclosingFlowThread = this->enclosingFlowTh read()) 451 if (LayoutMultiColumnFlowThread* enclosingFlowThread = this->enclosingFlowTh read())
447 return enclosingFlowThread; 452 return enclosingFlowThread;
448 return view()->fragmentationContext(); 453 return view()->fragmentationContext();
(...skipping 14 matching lines...) Expand all
463 // We only insert additional fragmentainer groups in the initial layout pass. We only want 468 // We only insert additional fragmentainer groups in the initial layout pass. We only want
464 // to balance columns in the last fragmentainer group (if we need to bal ance at all), so we 469 // to balance columns in the last fragmentainer group (if we need to bal ance at all), so we
465 // want that last fragmentainer group to be the same one in all layout p asses that follow. 470 // want that last fragmentainer group to be the same one in all layout p asses that follow.
466 return; 471 return;
467 } 472 }
468 473
469 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread)) { 474 if (!columnSet->hasFragmentainerGroupForColumnAt(offsetInFlowThread)) {
470 FragmentationContext* enclosingFragmentationContext = this->enclosingFra gmentationContext(); 475 FragmentationContext* enclosingFragmentationContext = this->enclosingFra gmentationContext();
471 if (!enclosingFragmentationContext) 476 if (!enclosingFragmentationContext)
472 return; // Not nested. We'll never need more rows than the one we al ready have then. 477 return; // Not nested. We'll never need more rows than the one we al ready have then.
473 478 ASSERT(!isLayoutPagedFlowThread());
474 // We have run out of columns here, so we add another row to hold more c olumns. When we add 479 // We have run out of columns here, so we add another row to hold more c olumns. When we add
475 // a new row, it implicitly means that we're inserting another column in our enclosing 480 // a new row, it implicitly means that we're inserting another column in our enclosing
476 // multicol container. That in turn may mean that we've run out of colum ns there too. 481 // multicol container. That in turn may mean that we've run out of colum ns there too.
477 const MultiColumnFragmentainerGroup& newRow = columnSet->appendNewFragme ntainerGroup(); 482 const MultiColumnFragmentainerGroup& newRow = columnSet->appendNewFragme ntainerGroup();
478 if (LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragment ationContext->associatedFlowThread()) 483 if (LayoutMultiColumnFlowThread* enclosingFlowThread = enclosingFragment ationContext->associatedFlowThread())
479 enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(newRow.bloc kOffsetInEnclosingFragmentationContext()); 484 enclosingFlowThread->appendNewFragmentainerGroupIfNeeded(newRow.bloc kOffsetInEnclosingFragmentationContext());
480 } 485 }
481 } 486 }
482 487
483 bool LayoutMultiColumnFlowThread::isFragmentainerLogicalHeightKnown() 488 bool LayoutMultiColumnFlowThread::isFragmentainerLogicalHeightKnown()
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that 950 // the "mayBe"), if we're in an out-of-flow subtree and have an outer multic ol container that
946 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to 951 // doesn't affect us, but that's okay. We'll discover that further down the road when trying to
947 // locate our enclosing flow thread for real. 952 // locate our enclosing flow thread for real.
948 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext(); 953 bool mayBeNested = multiColumnBlockFlow()->isInsideFlowThread() || view()->f ragmentationContext();
949 if (!mayBeNested) 954 if (!mayBeNested)
950 return; 955 return;
951 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination); 956 appendNewFragmentainerGroupIfNeeded(logicalTopInFlowThreadAfterPagination);
952 } 957 }
953 958
954 } 959 }
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/ColumnBalancer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698