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

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

Issue 2270983002: [layoutng] Add an NGFragmentBuilder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove SwapChildren Created 4 years, 3 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef NGFragmentBuilder_h
6 #define NGFragmentBuilder_h
7
8 #include "core/layout/ng/ng_fragment.h"
9 #include "core/layout/ng/ng_units.h"
10
11 namespace blink {
12
13 class CORE_EXPORT NGFragmentBuilder final {
14 public:
15 NGFragmentBuilder(NGFragmentBase::NGFragmentType);
16
17 NGFragmentBuilder& SetWritingMode(NGWritingMode);
18 NGFragmentBuilder& SetDirection(NGDirection);
19
20 NGFragmentBuilder& SetInlineSize(LayoutUnit);
21 NGFragmentBuilder& SetBlockSize(LayoutUnit);
22
23 NGFragmentBuilder& SetInlineOverflow(LayoutUnit);
24 NGFragmentBuilder& SetBlockOverflow(LayoutUnit);
25
26 NGFragmentBuilder& AddChild(const NGFragment*);
27
28 // Offsets are not supposed to be set during fragment construction, so we
29 // do not provide a setter here.
30
31 // Creates the fragment. Can only be called once.
32 NGFragment* ToFragment();
33
34 private:
35 NGFragmentBase::NGFragmentType type_;
36 NGWritingMode writing_mode_;
37 NGDirection direction_;
38
39 NGLogicalSize size_;
40 NGLogicalSize overflow_;
41
42 PersistentHeapVector<Member<const NGFragmentBase>> children_;
43 };
44
45 } // namespace blink
46
47 #endif // NGFragmentBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698