OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 FragmentainerIterator_h |
| 6 #define FragmentainerIterator_h |
| 7 |
| 8 #include "core/layout/LayoutFlowThread.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 class MultiColumnFragmentainerGroup; |
| 13 |
| 14 // Used to find the fragmentainers that intersect with a given portion of the fl
ow thread. The |
| 15 // portion typically corresponds to the bounds of some descendant layout object.
The iterator walks |
| 16 // in block direction order. |
| 17 class FragmentainerIterator { |
| 18 public: |
| 19 FragmentainerIterator(const LayoutFlowThread&, const LayoutRect& physicalBou
ndingBoxInFlowThread, const LayoutRect& clipRectInMulticolContainer); |
| 20 |
| 21 // Advance to the next fragmentainer. Not allowed to call this if atEnd() is
true. |
| 22 void advance(); |
| 23 |
| 24 // Return true if we have walked through all relevant fragmentainers. |
| 25 bool atEnd() const { return !m_currentColumnSet; } |
| 26 |
| 27 // The physical translation to apply to shift the box when converting from f
lowthread to visual |
| 28 // coordinates. |
| 29 LayoutSize paginationOffset() const { DCHECK(!atEnd()); return m_paginationO
ffset; } |
| 30 |
| 31 // Return the physical clip rectangle of the current fragmentainer, relative
to the flow thread. |
| 32 LayoutRect clipRectInFlowThread() const { DCHECK(!atEnd()); return m_clipRec
tInFlowThread; } |
| 33 |
| 34 private: |
| 35 const LayoutFlowThread& m_flowThread; |
| 36 const LayoutRect m_clipRectInMulticolContainer; |
| 37 |
| 38 const LayoutMultiColumnSet* m_currentColumnSet; |
| 39 unsigned m_currentFragmentainerGroupIndex; |
| 40 unsigned m_currentFragmentainerIndex; |
| 41 unsigned m_endFragmentainerIndex; |
| 42 |
| 43 LayoutUnit m_logicalTopInFlowThread; |
| 44 LayoutUnit m_logicalBottomInFlowThread; |
| 45 |
| 46 LayoutSize m_paginationOffset; |
| 47 LayoutRect m_clipRectInFlowThread; |
| 48 |
| 49 const MultiColumnFragmentainerGroup& currentGroup() const; |
| 50 void moveToNextFragmentainerGroup(); |
| 51 bool setFragmentainersOfInterest(); |
| 52 void updateOutput(); |
| 53 void setAtEnd() { m_currentColumnSet = nullptr; } |
| 54 }; |
| 55 |
| 56 } // namespace blink |
| 57 |
| 58 #endif // FragmentainerIterator_h |
| 59 |
OLD | NEW |