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

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

Issue 2655783006: Top down version of algorithm to position margins and floats in LayoutNG (Closed)
Patch Set: git rebase-update Created 3 years, 10 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 #ifndef NGPhysicalBoxFragment_h 5 #ifndef NGPhysicalBoxFragment_h
6 #define NGPhysicalBoxFragment_h 6 #define NGPhysicalBoxFragment_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_physical_fragment.h" 9 #include "core/layout/ng/ng_physical_fragment.h"
10 #include "core/layout/ng/ng_units.h" 10 #include "core/layout/ng/ng_units.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "wtf/Optional.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class NGBlockNode; 16 class NGBlockNode;
16 struct NGFloatingObject; 17 struct NGFloatingObject;
17 18
18 class CORE_EXPORT NGPhysicalBoxFragment final : public NGPhysicalFragment { 19 class CORE_EXPORT NGPhysicalBoxFragment final : public NGPhysicalFragment {
19 public: 20 public:
20 // This modifies the passed-in children vector. 21 // This modifies the passed-in children vector.
21 NGPhysicalBoxFragment( 22 NGPhysicalBoxFragment(
22 LayoutObject* layout_object, 23 LayoutObject* layout_object,
23 NGPhysicalSize size, 24 NGPhysicalSize size,
24 NGPhysicalSize overflow, 25 NGPhysicalSize overflow,
25 HeapVector<Member<NGPhysicalFragment>>& children, 26 HeapVector<Member<NGPhysicalFragment>>& children,
26 HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants, 27 HeapLinkedHashSet<WeakMember<NGBlockNode>>& out_of_flow_descendants,
27 Vector<NGStaticPosition>& out_of_flow_positions, 28 Vector<NGStaticPosition>& out_of_flow_positions,
28 NGDeprecatedMarginStrut margin_strut,
29 HeapVector<Member<NGFloatingObject>>& unpositioned_floats, 29 HeapVector<Member<NGFloatingObject>>& unpositioned_floats,
30 HeapVector<Member<NGFloatingObject>>& positioned_floats, 30 HeapVector<Member<NGFloatingObject>>& positioned_floats,
31 const WTF::Optional<NGLogicalOffset>& bfc_offset,
32 const NGMarginStrut& end_margin_strut,
31 NGBreakToken* break_token = nullptr); 33 NGBreakToken* break_token = nullptr);
32 34
33 const HeapVector<Member<NGPhysicalFragment>>& Children() const { 35 const HeapVector<Member<NGPhysicalFragment>>& Children() const {
34 return children_; 36 return children_;
35 } 37 }
36 38
37 NGDeprecatedMarginStrut MarginStrut() const { return margin_strut_; } 39 const WTF::Optional<NGLogicalOffset>& BfcOffset() const {
40 return bfc_offset_;
41 }
42
43 const NGMarginStrut& EndMarginStrut() const { return end_margin_strut_; }
38 44
39 DECLARE_TRACE_AFTER_DISPATCH(); 45 DECLARE_TRACE_AFTER_DISPATCH();
40 46
41 private: 47 private:
42 HeapVector<Member<NGPhysicalFragment>> children_; 48 HeapVector<Member<NGPhysicalFragment>> children_;
43 NGDeprecatedMarginStrut margin_strut_; 49 const WTF::Optional<NGLogicalOffset> bfc_offset_;
50 const NGMarginStrut end_margin_strut_;
44 }; 51 };
45 52
46 WILL_NOT_BE_EAGERLY_TRACED_CLASS(NGPhysicalBoxFragment); 53 WILL_NOT_BE_EAGERLY_TRACED_CLASS(NGPhysicalBoxFragment);
47 54
48 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment, 55 DEFINE_TYPE_CASTS(NGPhysicalBoxFragment,
49 NGPhysicalFragment, 56 NGPhysicalFragment,
50 fragment, 57 fragment,
51 fragment->Type() == NGPhysicalFragment::kFragmentBox, 58 fragment->Type() == NGPhysicalFragment::kFragmentBox,
52 fragment.Type() == NGPhysicalFragment::kFragmentBox); 59 fragment.Type() == NGPhysicalFragment::kFragmentBox);
53 60
54 } // namespace blink 61 } // namespace blink
55 62
56 #endif // NGPhysicalBoxFragment_h 63 #endif // NGPhysicalBoxFragment_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698