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/ng_fragment_builder.h" | 5 #include "core/layout/ng/ng_fragment_builder.h" |
| 6 #include "core/layout/ng/ng_box.h" |
| 7 #include "core/style/ComputedStyle.h" |
6 | 8 |
7 namespace blink { | 9 namespace blink { |
8 | 10 |
9 NGFragmentBuilder::NGFragmentBuilder( | 11 NGFragmentBuilder::NGFragmentBuilder( |
10 NGPhysicalFragmentBase::NGFragmentType type) | 12 NGPhysicalFragmentBase::NGFragmentType type) |
11 : type_(type), writing_mode_(HorizontalTopBottom), direction_(LTR) {} | 13 : type_(type), writing_mode_(HorizontalTopBottom), direction_(LTR) {} |
12 | 14 |
13 NGFragmentBuilder& NGFragmentBuilder::SetWritingMode( | 15 NGFragmentBuilder& NGFragmentBuilder::SetWritingMode( |
14 NGWritingMode writing_mode) { | 16 NGWritingMode writing_mode) { |
15 writing_mode_ = writing_mode; | 17 writing_mode_ = writing_mode; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 NGPhysicalSize physical_size = size_.ConvertToPhysical(writing_mode_); | 74 NGPhysicalSize physical_size = size_.ConvertToPhysical(writing_mode_); |
73 HeapVector<Member<const NGPhysicalFragmentBase>> children; | 75 HeapVector<Member<const NGPhysicalFragmentBase>> children; |
74 children.reserveCapacity(children_.size()); | 76 children.reserveCapacity(children_.size()); |
75 | 77 |
76 for (size_t i = 0; i < children_.size(); ++i) { | 78 for (size_t i = 0; i < children_.size(); ++i) { |
77 NGPhysicalFragmentBase* child = children_[i].get(); | 79 NGPhysicalFragmentBase* child = children_[i].get(); |
78 child->SetOffset(offsets_[i].ConvertToPhysical( | 80 child->SetOffset(offsets_[i].ConvertToPhysical( |
79 writing_mode_, direction_, physical_size, child->Size())); | 81 writing_mode_, direction_, physical_size, child->Size())); |
80 children.append(child); | 82 children.append(child); |
81 } | 83 } |
82 return new NGPhysicalFragment(physical_size, | 84 return new NGPhysicalFragment( |
83 overflow_.ConvertToPhysical(writing_mode_), | 85 physical_size, overflow_.ConvertToPhysical(writing_mode_), children, |
84 children, margin_strut_); | 86 out_of_flow_descendants_, out_of_flow_offsets_, margin_strut_); |
| 87 } |
| 88 |
| 89 DEFINE_TRACE(NGFragmentBuilder) { |
| 90 visitor->trace(children_); |
| 91 visitor->trace(out_of_flow_descendants_); |
85 } | 92 } |
86 | 93 |
87 } // namespace blink | 94 } // namespace blink |
OLD | NEW |