OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/inline/ng_line_box_fragment_builder.h" | 5 #include "core/layout/ng/inline/ng_line_box_fragment_builder.h" |
6 | 6 |
7 #include "core/layout/ng/geometry/ng_logical_size.h" | 7 #include "core/layout/ng/geometry/ng_logical_size.h" |
8 #include "core/layout/ng/inline/ng_inline_break_token.h" | 8 #include "core/layout/ng/inline/ng_inline_break_token.h" |
9 #include "core/layout/ng/inline/ng_inline_node.h" | 9 #include "core/layout/ng/inline/ng_inline_node.h" |
10 #include "core/layout/ng/inline/ng_physical_line_box_fragment.h" | 10 #include "core/layout/ng/inline/ng_physical_line_box_fragment.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 offsets_.push_back(child_offset); | 37 offsets_.push_back(child_offset); |
38 | 38 |
39 return *this; | 39 return *this; |
40 } | 40 } |
41 | 41 |
42 void NGLineBoxFragmentBuilder::MoveChildrenInBlockDirection(LayoutUnit delta) { | 42 void NGLineBoxFragmentBuilder::MoveChildrenInBlockDirection(LayoutUnit delta) { |
43 for (auto& offset : offsets_) | 43 for (auto& offset : offsets_) |
44 offset.block_offset += delta; | 44 offset.block_offset += delta; |
45 } | 45 } |
46 | 46 |
| 47 void NGLineBoxFragmentBuilder::MoveChildrenInBlockDirection(LayoutUnit delta, |
| 48 unsigned start, |
| 49 unsigned end) { |
| 50 for (unsigned index = start; index < end; index++) |
| 51 offsets_[index].block_offset += delta; |
| 52 } |
| 53 |
47 void NGLineBoxFragmentBuilder::UniteMetrics( | 54 void NGLineBoxFragmentBuilder::UniteMetrics( |
48 const NGLineHeightMetrics& metrics) { | 55 const NGLineHeightMetrics& metrics) { |
49 metrics_.Unite(metrics); | 56 metrics_.Unite(metrics); |
50 } | 57 } |
51 | 58 |
52 void NGLineBoxFragmentBuilder::SetBreakToken( | 59 void NGLineBoxFragmentBuilder::SetBreakToken( |
53 RefPtr<NGInlineBreakToken> break_token) { | 60 RefPtr<NGInlineBreakToken> break_token) { |
54 break_token_ = std::move(break_token); | 61 break_token_ = std::move(break_token); |
55 } | 62 } |
56 | 63 |
(...skipping 13 matching lines...) Expand all Loading... |
70 writing_mode, direction_, physical_size, child->Size())); | 77 writing_mode, direction_, physical_size, child->Size())); |
71 } | 78 } |
72 | 79 |
73 return AdoptRef(new NGPhysicalLineBoxFragment( | 80 return AdoptRef(new NGPhysicalLineBoxFragment( |
74 physical_size, children_, metrics_, | 81 physical_size, children_, metrics_, |
75 break_token_ ? std::move(break_token_) | 82 break_token_ ? std::move(break_token_) |
76 : NGInlineBreakToken::Create(node_))); | 83 : NGInlineBreakToken::Create(node_))); |
77 } | 84 } |
78 | 85 |
79 } // namespace blink | 86 } // namespace blink |
OLD | NEW |