Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(847)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_fragment_builder.cc

Issue 2910133002: [LayoutNG] Handle empty inlines and border edges (Closed)
Patch Set: Rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 6
7 #include "core/layout/ng/inline/ng_physical_text_fragment.h" 7 #include "core/layout/ng/inline/ng_physical_text_fragment.h"
8 #include "core/layout/ng/ng_block_break_token.h" 8 #include "core/layout/ng/ng_block_break_token.h"
9 #include "core/layout/ng/ng_block_node.h" 9 #include "core/layout/ng/ng_block_node.h"
10 #include "core/layout/ng/ng_break_token.h" 10 #include "core/layout/ng/ng_break_token.h"
11 #include "core/layout/ng/ng_fragment.h" 11 #include "core/layout/ng/ng_fragment.h"
12 #include "core/layout/ng/ng_layout_result.h" 12 #include "core/layout/ng/ng_layout_result.h"
13 #include "core/layout/ng/ng_physical_box_fragment.h" 13 #include "core/layout/ng/ng_physical_box_fragment.h"
14 #include "platform/heap/Handle.h" 14 #include "platform/heap/Handle.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 // TODO(ikilpatrick): Make writing mode and direction be in the constructor. 18 // TODO(ikilpatrick): Make writing mode and direction be in the constructor.
19 NGFragmentBuilder::NGFragmentBuilder(NGPhysicalFragment::NGFragmentType type, 19 NGFragmentBuilder::NGFragmentBuilder(NGPhysicalFragment::NGFragmentType type,
20 NGLayoutInputNode node) 20 NGLayoutInputNode node)
21 : type_(type), 21 : type_(type),
22 writing_mode_(kHorizontalTopBottom), 22 writing_mode_(kHorizontalTopBottom),
23 direction_(TextDirection::kLtr), 23 direction_(TextDirection::kLtr),
24 node_(node), 24 node_(node),
25 layout_object_(node.GetLayoutObject()), 25 layout_object_(node.GetLayoutObject()),
26 did_break_(false), 26 did_break_(false) {}
27 border_edges_(NGBorderEdges::kAll) {}
28 27
29 NGFragmentBuilder::NGFragmentBuilder(NGPhysicalFragment::NGFragmentType type, 28 NGFragmentBuilder::NGFragmentBuilder(NGPhysicalFragment::NGFragmentType type,
30 LayoutObject* layout_object) 29 LayoutObject* layout_object)
31 : type_(type), 30 : type_(type),
32 writing_mode_(kHorizontalTopBottom), 31 writing_mode_(kHorizontalTopBottom),
33 direction_(TextDirection::kLtr), 32 direction_(TextDirection::kLtr),
34 node_(nullptr), 33 node_(nullptr),
35 layout_object_(layout_object), 34 layout_object_(layout_object),
36 did_break_(false) {} 35 did_break_(false) {}
37 36
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 NGPhysicalFragment* floating_fragment = positioned_float.fragment.Get(); 222 NGPhysicalFragment* floating_fragment = positioned_float.fragment.Get();
224 floating_fragment->SetOffset( 223 floating_fragment->SetOffset(
225 positioned_float.logical_offset.ConvertToPhysical( 224 positioned_float.logical_offset.ConvertToPhysical(
226 writing_mode_, direction_, physical_size, 225 writing_mode_, direction_, physical_size,
227 floating_fragment->Size())); 226 floating_fragment->Size()));
228 } 227 }
229 228
230 RefPtr<NGPhysicalBoxFragment> fragment = AdoptRef(new NGPhysicalBoxFragment( 229 RefPtr<NGPhysicalBoxFragment> fragment = AdoptRef(new NGPhysicalBoxFragment(
231 layout_object_, physical_size, overflow_.ConvertToPhysical(writing_mode_), 230 layout_object_, physical_size, overflow_.ConvertToPhysical(writing_mode_),
232 children_, positioned_floats_, bfc_offset_, end_margin_strut_, 231 children_, positioned_floats_, bfc_offset_, end_margin_strut_,
233 NGBorderEdges::ToPhysical(border_edges_, writing_mode_), 232 border_edges_.ToPhysical(writing_mode_), std::move(break_token)));
234 std::move(break_token)));
235 233
236 return AdoptRef( 234 return AdoptRef(
237 new NGLayoutResult(std::move(fragment), out_of_flow_descendants_, 235 new NGLayoutResult(std::move(fragment), out_of_flow_descendants_,
238 out_of_flow_positions_, unpositioned_floats_)); 236 out_of_flow_positions_, unpositioned_floats_));
239 } 237 }
240 238
241 } // namespace blink 239 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698