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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h

Issue 2237643003: [layoutng] Add a base class for layout algorithms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fast alloc and noncopyable Created 4 years, 4 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
new file mode 100644
index 0000000000000000000000000000000000000000..b77f270ad86a55dfe7ae3c9ba9181acd5b592779
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
@@ -0,0 +1,35 @@
+// 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 NGLayoutAlgorithm_h
+#define NGLayoutAlgorithm_h
+
+#include "core/CoreExport.h"
+#include "wtf/Allocator.h"
+#include "wtf/Noncopyable.h"
+
+namespace blink {
+
+class NGConstraintSpace;
+class NGFragment;
+
+// Base class for all LayoutNG algorithms.
+class CORE_EXPORT NGLayoutAlgorithm {
+ WTF_MAKE_NONCOPYABLE(NGLayoutAlgorithm);
+ USING_FAST_MALLOC(NGLayoutAlgorithm);
+
+ public:
+ NGLayoutAlgorithm() {}
+
+ // Actual layout function. Lays out the children and descendents within the
+ // constraints given by the NGConstraintSpace. Returns a fragment with the
+ // resulting layout information.
+ // This function can not be const because for interruptible layout, we have
+ // to be able to store state information.
+ virtual NGFragment* layout(const NGConstraintSpace&) = 0;
+};
+
+} // namespace blink
+
+#endif // NGLayoutAlgorithm_h
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698