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/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 #include "core/layout/ng/ng_block_node.h" | 9 #include "core/layout/ng/ng_block_node.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 // This overrides the default layout block algorithm to use Layout NG. | 13 // This overrides the default layout block algorithm to use Layout NG. |
14 class LayoutNGBlockFlow final : public LayoutBlockFlow { | 14 class LayoutNGBlockFlow final : public LayoutBlockFlow { |
15 public: | 15 public: |
16 explicit LayoutNGBlockFlow(Element*); | 16 explicit LayoutNGBlockFlow(Element*); |
17 ~LayoutNGBlockFlow() override = default; | 17 ~LayoutNGBlockFlow() override = default; |
18 | 18 |
19 void layoutBlock(bool relayoutChildren) override; | 19 void layoutBlock(bool relayoutChildren) override; |
20 NGBlockNode* boxForTesting() const { return m_box.get(); } | 20 NGBlockNode* boxForTesting() const { return m_box.get(); } |
21 | 21 |
| 22 protected: |
| 23 void computeIntrinsicLogicalWidths( |
| 24 LayoutUnit& minLogicalWidth, |
| 25 LayoutUnit& maxLogicalWidth) const override; |
| 26 |
22 private: | 27 private: |
23 bool isOfType(LayoutObjectType) const override; | 28 bool isOfType(LayoutObjectType) const override; |
24 | 29 |
25 Persistent<NGBlockNode> m_box; | 30 Persistent<NGBlockNode> m_box; |
26 }; | 31 }; |
27 | 32 |
28 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, isLayoutNGBlockFlow()); | 33 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutNGBlockFlow, isLayoutNGBlockFlow()); |
29 | 34 |
30 } // namespace blink | 35 } // namespace blink |
31 | 36 |
32 #endif // LayoutNGBlockFlow_h | 37 #endif // LayoutNGBlockFlow_h |
OLD | NEW |