OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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 LayoutNGBlockFlow_h | 5 #ifndef LayoutNGBlockFlow_h |
6 #define LayoutNGBlockFlow_h | 6 #define LayoutNGBlockFlow_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/LayoutBlockFlow.h" | 9 #include "core/layout/LayoutBlockFlow.h" |
10 #include "core/layout/ng/inline/ng_inline_node_data.h" | 10 #include "core/layout/ng/inline/ng_inline_node_data.h" |
11 #include "core/layout/ng/ng_block_node.h" | 11 #include "core/layout/ng/ng_block_node.h" |
| 12 #include "core/layout/ng/ng_physical_fragment.h" |
12 | 13 |
13 namespace blink { | 14 namespace blink { |
14 | 15 |
15 // This overrides the default layout block algorithm to use Layout NG. | 16 // This overrides the default layout block algorithm to use Layout NG. |
16 class CORE_EXPORT LayoutNGBlockFlow final : public LayoutBlockFlow { | 17 class CORE_EXPORT LayoutNGBlockFlow final : public LayoutBlockFlow { |
17 public: | 18 public: |
18 explicit LayoutNGBlockFlow(Element*); | 19 explicit LayoutNGBlockFlow(Element*); |
19 ~LayoutNGBlockFlow() override = default; | 20 ~LayoutNGBlockFlow() override = default; |
20 | 21 |
21 void UpdateBlockLayout(bool relayout_children) override; | 22 void UpdateBlockLayout(bool relayout_children) override; |
22 NGBlockNode* BoxForTesting() const { return box_.Get(); } | 23 NGBlockNode* BoxForTesting() const { return box_.Get(); } |
23 | 24 |
24 const char* GetName() const override { return "LayoutNGBlockFlow"; } | 25 const char* GetName() const override { return "LayoutNGBlockFlow"; } |
25 | 26 |
26 NGInlineNodeData& GetNGInlineNodeData() const; | 27 NGInlineNodeData& GetNGInlineNodeData() const; |
27 void ResetNGInlineNodeData(); | 28 void ResetNGInlineNodeData(); |
28 | 29 |
| 30 void PaintObject(const PaintInfo&, const LayoutPoint&) const override; |
| 31 |
| 32 NGPhysicalFragment* RootFragment() const { return root_fragment_.Get(); } |
| 33 |
29 private: | 34 private: |
30 bool IsOfType(LayoutObjectType) const override; | 35 bool IsOfType(LayoutObjectType) const override; |
31 | 36 |
32 std::unique_ptr<NGInlineNodeData> ng_inline_node_data_; | 37 std::unique_ptr<NGInlineNodeData> ng_inline_node_data_; |
33 Persistent<NGBlockNode> box_; | 38 Persistent<NGBlockNode> box_; |
| 39 |
| 40 public: // TODO(eae): |
| 41 RefPtr<NGPhysicalFragment> root_fragment_; |
34 }; | 42 }; |
35 | 43 |
36 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, IsLayoutNGBlockFlow()); | 44 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, IsLayoutNGBlockFlow()); |
37 | 45 |
38 } // namespace blink | 46 } // namespace blink |
39 | 47 |
40 #endif // LayoutNGBlockFlow_h | 48 #endif // LayoutNGBlockFlow_h |
OLD | NEW |