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

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

Issue 2748973002: Strictly unbreakable objects need to prevent interaction with the outside. (Closed)
Patch Set: Created 3 years, 9 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/Source/core/layout/LayoutMultiColumnFlowThread.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 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 ->setNeedsLayoutAndPrefWidthsRecalc( 591 ->setNeedsLayoutAndPrefWidthsRecalc(
592 LayoutInvalidationReason::ColumnsChanged); 592 LayoutInvalidationReason::ColumnsChanged);
593 593
594 // Now generate a column set for this ex-spanner, if needed and none is there 594 // Now generate a column set for this ex-spanner, if needed and none is there
595 // for us already. 595 // for us already.
596 flowThreadDescendantWasInserted(spannerObjectInFlowThread); 596 flowThreadDescendantWasInserted(spannerObjectInFlowThread);
597 597
598 return true; 598 return true;
599 } 599 }
600 600
601 LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::enclosingFlowThread() 601 LayoutMultiColumnFlowThread* LayoutMultiColumnFlowThread::enclosingFlowThread(
602 const { 602 AncestorSearchConstraint constraint) const {
603 if (isLayoutPagedFlowThread()) { 603 if (isLayoutPagedFlowThread()) {
604 // Paged overflow containers should never be fragmented by enclosing 604 // Paged overflow containers should never be fragmented by enclosing
605 // fragmentation contexts. They are to be treated as unbreakable content. 605 // fragmentation contexts. They are to be treated as unbreakable content.
606 return nullptr; 606 return nullptr;
607 } 607 }
608 if (multiColumnBlockFlow()->isInsideFlowThread()) 608 if (!multiColumnBlockFlow()->isInsideFlowThread())
609 return toLayoutMultiColumnFlowThread( 609 return nullptr;
610 locateFlowThreadContainingBlockOf(*multiColumnBlockFlow())); 610 return toLayoutMultiColumnFlowThread(
611 return nullptr; 611 locateFlowThreadContainingBlockOf(*multiColumnBlockFlow(), constraint));
612 } 612 }
613 613
614 FragmentationContext* 614 FragmentationContext*
615 LayoutMultiColumnFlowThread::enclosingFragmentationContext( 615 LayoutMultiColumnFlowThread::enclosingFragmentationContext(
616 AncestorSearchConstraint constraint) const { 616 AncestorSearchConstraint constraint) const {
617 // If this multicol container is strictly unbreakable (due to having 617 // If this multicol container is strictly unbreakable (due to having
618 // scrollbars, for instance), it's also strictly unbreakable in any outer 618 // scrollbars, for instance), it's also strictly unbreakable in any outer
619 // fragmentation context. As such, what kind of fragmentation that goes on 619 // fragmentation context. As such, what kind of fragmentation that goes on
620 // inside this multicol container is completely opaque to the ancestors. 620 // inside this multicol container is completely opaque to the ancestors.
621 if (constraint == IsolateUnbreakableContainers && 621 if (constraint == IsolateUnbreakableContainers &&
622 multiColumnBlockFlow()->getPaginationBreakability() == ForbidBreaks) 622 multiColumnBlockFlow()->getPaginationBreakability() == ForbidBreaks)
623 return nullptr; 623 return nullptr;
624 if (auto* enclosingFlowThread = this->enclosingFlowThread()) 624 if (auto* enclosingFlowThread = this->enclosingFlowThread(constraint))
625 return enclosingFlowThread; 625 return enclosingFlowThread;
626 return view()->fragmentationContext(); 626 return view()->fragmentationContext();
627 } 627 }
628 628
629 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded( 629 void LayoutMultiColumnFlowThread::appendNewFragmentainerGroupIfNeeded(
630 LayoutUnit offsetInFlowThread, 630 LayoutUnit offsetInFlowThread,
631 PageBoundaryRule pageBoundaryRule) { 631 PageBoundaryRule pageBoundaryRule) {
632 LayoutMultiColumnSet* columnSet = 632 LayoutMultiColumnSet* columnSet =
633 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule); 633 columnSetAtBlockOffset(offsetInFlowThread, pageBoundaryRule);
634 if (!columnSet->newFragmentainerGroupsAllowed()) 634 if (!columnSet->newFragmentainerGroupsAllowed())
(...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 const { 1376 const {
1377 return MultiColumnLayoutState(m_lastSetWorkedOn); 1377 return MultiColumnLayoutState(m_lastSetWorkedOn);
1378 } 1378 }
1379 1379
1380 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState( 1380 void LayoutMultiColumnFlowThread::restoreMultiColumnLayoutState(
1381 const MultiColumnLayoutState& state) { 1381 const MultiColumnLayoutState& state) {
1382 m_lastSetWorkedOn = state.columnSet(); 1382 m_lastSetWorkedOn = state.columnSet();
1383 } 1383 }
1384 1384
1385 } // namespace blink 1385 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698