OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef FragmentationContext_h |
| 6 #define FragmentationContext_h |
| 7 |
| 8 #include "core/CoreExport.h" |
| 9 #include "platform/LayoutUnit.h" |
| 10 #include "platform/geometry/LayoutSize.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 // A fragmentation context is either established by a multicol container, or by
pages when |
| 15 // printing. A fragmentation context consists of a series of fragmentainers. A f
ragmentainer is |
| 16 // simply a column or page, depending on the type of fragmentation context. [1] |
| 17 // |
| 18 // A couple of methods here take a |blockOffset| parameter. This is the offset f
rom the start of the |
| 19 // fragmentation context, pretending that everything is laid out in one single s
trip (and not sliced |
| 20 // into pages or columns). In multicol, this is referred to as the flow thread c
oordinate space. |
| 21 // |
| 22 // It should be noted that a multicol container may be nested inside another fra
gmentation context |
| 23 // (another multicol container, or the pages when printing), although this class
doesn't deal with |
| 24 // that (it's internal to the multicol implementation). |
| 25 // |
| 26 // [1] http://www.w3.org/TR/css3-break/#fragmentation-model |
| 27 class CORE_EXPORT FragmentationContext { |
| 28 public: |
| 29 virtual ~FragmentationContext() { } |
| 30 |
| 31 // The height of the fragmentainers may depend on the total height of the co
ntents (column |
| 32 // balancing), in which case false is returned if we haven't laid out yet. O
therwise, true is |
| 33 // returned. |
| 34 virtual bool isFragmentainerLogicalHeightKnown() = 0; |
| 35 |
| 36 // Return the height of the fragmentainer at the specified offset. The fragm
entainer height |
| 37 // isn't necessarily uniform all across the fragmentation context. |
| 38 virtual LayoutUnit fragmentainerLogicalHeightAt(LayoutUnit blockOffset) = 0; |
| 39 |
| 40 // Return how much is left of the fragmentainer at the specified offset. Cal
lers typically want |
| 41 // this information to decide whether some piece of content fits in this fra
gmentainer, or if it |
| 42 // has to push the content to the next fragmentainer. |
| 43 virtual LayoutUnit remainingLogicalHeightAt(LayoutUnit blockOffset) = 0; |
| 44 |
| 45 // Return the flow thread of the fragmentation context, if it is a multicol
fragmentation |
| 46 // context. Since multicol containers may be nested inside other fragmentati
on contexts, |
| 47 // sometimes we need to know if it's a multicol container that we're dealing
with. |
| 48 virtual class LayoutMultiColumnFlowThread* associatedFlowThread() { return n
ullptr; } |
| 49 }; |
| 50 |
| 51 } // namespace blink |
| 52 |
| 53 #endif // FragmentationContext_h |
OLD | NEW |