| 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 #include "core/layout/ng/layout_ng_block_flow.h" | 5 #include "core/layout/ng/layout_ng_block_flow.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutAnalyzer.h" | 7 #include "core/layout/LayoutAnalyzer.h" |
| 8 #include "core/layout/ng/ng_constraint_space.h" | 8 #include "core/layout/ng/ng_constraint_space.h" |
| 9 #include "core/layout/ng/ng_fragment.h" | 9 #include "core/layout/ng/ng_fragment.h" |
| 10 #include "core/layout/ng/ng_layout_result.h" | 10 #include "core/layout/ng/ng_layout_result.h" |
| 11 #include "core/paint/NGBlockFlowPainter.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) | 15 LayoutNGBlockFlow::LayoutNGBlockFlow(Element* element) |
| 15 : LayoutBlockFlow(element) {} | 16 : LayoutBlockFlow(element) {} |
| 16 | 17 |
| 17 bool LayoutNGBlockFlow::IsOfType(LayoutObjectType type) const { | 18 bool LayoutNGBlockFlow::IsOfType(LayoutObjectType type) const { |
| 18 return type == kLayoutObjectNGBlockFlow || LayoutBlockFlow::IsOfType(type); | 19 return type == kLayoutObjectNGBlockFlow || LayoutBlockFlow::IsOfType(type); |
| 19 } | 20 } |
| 20 | 21 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 56 |
| 56 NGInlineNodeData& LayoutNGBlockFlow::GetNGInlineNodeData() const { | 57 NGInlineNodeData& LayoutNGBlockFlow::GetNGInlineNodeData() const { |
| 57 DCHECK(ng_inline_node_data_); | 58 DCHECK(ng_inline_node_data_); |
| 58 return *ng_inline_node_data_.get(); | 59 return *ng_inline_node_data_.get(); |
| 59 } | 60 } |
| 60 | 61 |
| 61 void LayoutNGBlockFlow::ResetNGInlineNodeData() { | 62 void LayoutNGBlockFlow::ResetNGInlineNodeData() { |
| 62 ng_inline_node_data_ = WTF::MakeUnique<NGInlineNodeData>(); | 63 ng_inline_node_data_ = WTF::MakeUnique<NGInlineNodeData>(); |
| 63 } | 64 } |
| 64 | 65 |
| 66 void LayoutNGBlockFlow::PaintObject(const PaintInfo& paint_info, |
| 67 const LayoutPoint& paint_offset) const { |
| 68 // TODO(eae): This is incorrect but it'll do for now. |
| 69 if (root_fragment_) { |
| 70 NGBlockFlowPainter(*this).PaintContents(paint_info, paint_offset); |
| 71 } else { |
| 72 LayoutBlockFlow::PaintObject(paint_info, paint_offset); |
| 73 } |
| 74 } |
| 75 |
| 65 } // namespace blink | 76 } // namespace blink |
| OLD | NEW |