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

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

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Rebase w/HEAD Created 3 years, 9 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 NGExclusion_h
6 #define NGExclusion_h
7
8 #include "core/CoreExport.h"
9 #include "core/layout/ng/geometry/ng_logical_rect.h"
10 #include "wtf/Vector.h"
11
12 namespace blink {
13
14 // Struct that represents NG exclusion.
15 struct CORE_EXPORT NGExclusion {
16 // Type of NG exclusion.
17 enum Type {
18 // Undefined exclusion type.
19 // At this moment it's also used to represent CSS3 exclusion.
20 kExclusionTypeUndefined = 0,
21 // Exclusion that is created by LEFT float.
22 kFloatLeft = 1,
23 // Exclusion that is created by RIGHT float.
24 kFloatRight = 2
25 };
26
27 // Rectangle in logical coordinates the represents this exclusion.
28 NGLogicalRect rect;
29
30 // Type of this exclusion.
31 Type type;
32
33 bool operator==(const NGExclusion& other) const;
34 String ToString() const;
35 };
36
37 inline std::ostream& operator<<(std::ostream& stream,
38 const NGExclusion& value) {
39 return stream << value.ToString();
mstensho (USE GERRIT) 2017/02/28 12:19:47 move implementation to .cc ?
eae 2017/02/28 12:26:34 Will do, thanks!
40 }
41
42 struct CORE_EXPORT NGExclusions {
43 NGExclusions();
44 NGExclusions(const NGExclusions& other);
45
46 Vector<std::unique_ptr<const NGExclusion>> storage;
47
48 // Last left/right float exclusions are used to enforce the top edge alignment
49 // rule for floats and for the support of CSS "clear" property.
50 const NGExclusion* last_left_float; // Owned by storage.
51 const NGExclusion* last_right_float; // Owned by storage.
52
53 NGExclusions& operator=(const NGExclusions& other);
54
55 void Add(const NGExclusion& exclusion);
56 };
57
58 } // namespace blink
59
60 #endif // NGExclusion_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698