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 | 12 |
13 namespace blink { | 13 namespace blink { |
14 | 14 |
15 // This overrides the default layout block algorithm to use Layout NG. | 15 // This overrides the default layout block algorithm to use Layout NG. |
16 class CORE_EXPORT LayoutNGBlockFlow final : public LayoutBlockFlow { | 16 class CORE_EXPORT LayoutNGBlockFlow final : public LayoutBlockFlow { |
17 public: | 17 public: |
18 explicit LayoutNGBlockFlow(Element*); | 18 explicit LayoutNGBlockFlow(Element*); |
19 ~LayoutNGBlockFlow() override = default; | 19 ~LayoutNGBlockFlow() override = default; |
20 | 20 |
21 void UpdateBlockLayout(bool relayout_children) override; | 21 void UpdateBlockLayout(bool relayout_children) override; |
22 NGBlockNode* BoxForTesting() const { return box_.Get(); } | |
23 | 22 |
24 const char* GetName() const override { return "LayoutNGBlockFlow"; } | 23 const char* GetName() const override { return "LayoutNGBlockFlow"; } |
25 | 24 |
26 NGInlineNodeData& GetNGInlineNodeData() const; | 25 NGInlineNodeData& GetNGInlineNodeData() const; |
27 void ResetNGInlineNodeData(); | 26 void ResetNGInlineNodeData(); |
| 27 bool HasNGInlineNodeData() const { return ng_inline_node_data_.get(); } |
28 | 28 |
29 private: | 29 private: |
30 bool IsOfType(LayoutObjectType) const override; | 30 bool IsOfType(LayoutObjectType) const override; |
31 | 31 |
32 std::unique_ptr<NGInlineNodeData> ng_inline_node_data_; | 32 std::unique_ptr<NGInlineNodeData> ng_inline_node_data_; |
33 Persistent<NGBlockNode> box_; | |
34 }; | 33 }; |
35 | 34 |
36 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, IsLayoutNGBlockFlow()); | 35 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, IsLayoutNGBlockFlow()); |
37 | 36 |
38 } // namespace blink | 37 } // namespace blink |
39 | 38 |
40 #endif // LayoutNGBlockFlow_h | 39 #endif // LayoutNGBlockFlow_h |
OLD | NEW |