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

Unified 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: Don't export NGBoxStrut for now 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
new file mode 100644
index 0000000000000000000000000000000000000000..b8b86edde75939f6e59a6008cc6d6c14c3e75cfa
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_exclusion.h
@@ -0,0 +1,57 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NGExclusion_h
+#define NGExclusion_h
+
+#include "core/CoreExport.h"
+#include "core/layout/ng/geometry/ng_logical_rect.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+// Struct that represents NG exclusion.
+struct CORE_EXPORT NGExclusion {
+ // Type of NG exclusion.
+ enum Type {
+ // Undefined exclusion type.
+ // At this moment it's also used to represent CSS3 exclusion.
+ kExclusionTypeUndefined = 0,
+ // Exclusion that is created by LEFT float.
+ kFloatLeft = 1,
+ // Exclusion that is created by RIGHT float.
+ kFloatRight = 2
+ };
+
+ // Rectangle in logical coordinates the represents this exclusion.
+ NGLogicalRect rect;
+
+ // Type of this exclusion.
+ Type type;
+
+ bool operator==(const NGExclusion& other) const;
+ String ToString() const;
+};
+
+CORE_EXPORT std::ostream& operator<<(std::ostream&, const NGExclusion&);
+
+struct CORE_EXPORT NGExclusions {
+ NGExclusions();
+ NGExclusions(const NGExclusions& other);
+
+ Vector<std::unique_ptr<const NGExclusion>> storage;
+
+ // Last left/right float exclusions are used to enforce the top edge alignment
+ // rule for floats and for the support of CSS "clear" property.
+ const NGExclusion* last_left_float; // Owned by storage.
+ const NGExclusion* last_right_float; // Owned by storage.
+
+ NGExclusions& operator=(const NGExclusions& other);
+
+ void Add(const NGExclusion& exclusion);
+};
+
+} // namespace blink
+
+#endif // NGExclusion_h

Powered by Google App Engine
This is Rietveld 408576698