OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef LayoutPagedFlowThread_h | 5 #ifndef LayoutPagedFlowThread_h |
6 #define LayoutPagedFlowThread_h | 6 #define LayoutPagedFlowThread_h |
7 | 7 |
8 #include "core/layout/LayoutMultiColumnFlowThread.h" | 8 #include "core/layout/LayoutMultiColumnFlowThread.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 // A flow thread for paged overflow. FIXME: The current implementation relies on
the multicol | 12 // A flow thread for paged overflow. FIXME: The current implementation relies on |
13 // implementation, but it in the long run it would be better to have what's comm
on between | 13 // the multicol implementation, but it in the long run it would be better to |
14 // LayoutMultiColumnFlowThread and LayoutPagedFlowThread in LayoutFlowThread, an
d have both of them | 14 // have what's common between LayoutMultiColumnFlowThread and |
15 // inherit from that one. | 15 // LayoutPagedFlowThread in LayoutFlowThread, and have both of them inherit |
| 16 // from that one. |
16 class LayoutPagedFlowThread : public LayoutMultiColumnFlowThread { | 17 class LayoutPagedFlowThread : public LayoutMultiColumnFlowThread { |
17 public: | 18 public: |
18 static LayoutPagedFlowThread* createAnonymous( | 19 static LayoutPagedFlowThread* createAnonymous( |
19 Document&, | 20 Document&, |
20 const ComputedStyle& parentStyle); | 21 const ComputedStyle& parentStyle); |
21 | 22 |
22 LayoutBlockFlow* pagedBlockFlow() const { | 23 LayoutBlockFlow* pagedBlockFlow() const { |
23 return toLayoutBlockFlow(parent()); | 24 return toLayoutBlockFlow(parent()); |
24 } | 25 } |
25 | 26 |
26 // Return the number of pages. Will never be less than 1. | 27 // Return the number of pages. Will never be less than 1. |
27 int pageCount(); | 28 int pageCount(); |
28 | 29 |
29 bool isLayoutPagedFlowThread() const override { return true; } | 30 bool isLayoutPagedFlowThread() const override { return true; } |
30 const char* name() const override { return "LayoutPagedFlowThread"; } | 31 const char* name() const override { return "LayoutPagedFlowThread"; } |
31 bool needsNewWidth() const override; | 32 bool needsNewWidth() const override; |
32 void updateLogicalWidth() override; | 33 void updateLogicalWidth() override; |
33 virtual void layout(); | 34 virtual void layout(); |
34 | 35 |
35 private: | 36 private: |
36 bool descendantIsValidColumnSpanner( | 37 bool descendantIsValidColumnSpanner( |
37 LayoutObject* /*descendant*/) const override { | 38 LayoutObject* /*descendant*/) const override { |
38 return false; | 39 return false; |
39 } | 40 } |
40 }; | 41 }; |
41 | 42 |
42 } // namespace blink | 43 } // namespace blink |
43 | 44 |
44 #endif // LayoutPagedFlowThread_h | 45 #endif // LayoutPagedFlowThread_h |
OLD | NEW |