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

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

Issue 2782603003: Add NGColumnLayoutAlgorithm skeleton implementation. (Closed)
Patch Set: update TestExpectations 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc ('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
index a5ca1855c753cc94ad10c4c70a3e94c85e7c73b2..51c0c84c6fc8203e274de3fede90d1f1465662ac 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_algorithm.h
@@ -8,19 +8,24 @@
#include "core/CoreExport.h"
#include "core/layout/ng/ng_min_max_content_size.h"
#include "wtf/Allocator.h"
-#include "wtf/Noncopyable.h"
#include "wtf/Optional.h"
namespace blink {
-struct MinMaxContentSize;
+class ComputedStyle;
+class NGConstraintSpace;
class NGLayoutResult;
// Base class for all LayoutNG algorithms.
+template <typename NGInputNodeType, typename NGBreakTokenType>
class CORE_EXPORT NGLayoutAlgorithm {
STACK_ALLOCATED();
-
public:
+ NGLayoutAlgorithm(NGInputNodeType* node,
+ NGConstraintSpace* space,
+ NGBreakTokenType* break_token)
+ : node_(node), constraint_space_(space), break_token_(break_token) {}
+
virtual ~NGLayoutAlgorithm() {}
// Actual layout function. Lays out the children and descendants within the
@@ -37,6 +42,28 @@ class CORE_EXPORT NGLayoutAlgorithm {
virtual Optional<MinMaxContentSize> ComputeMinMaxContentSize() const {
return WTF::nullopt;
}
+
+ protected:
+ const NGConstraintSpace& ConstraintSpace() const {
+ DCHECK(constraint_space_);
+ return *constraint_space_;
+ }
+ NGConstraintSpace* MutableConstraintSpace() { return constraint_space_; }
+
+ const ComputedStyle& Style() const {
+ DCHECK(node_);
+ return node_->Style();
+ }
+
+ virtual NGInputNodeType* Node() const { return node_; }
+
+ NGBreakTokenType* BreakToken() const { return break_token_; }
+
+ Persistent<NGInputNodeType> node_;
+ NGConstraintSpace* constraint_space_;
+
+ // The break token from which we are currently resuming layout.
+ NGBreakTokenType* break_token_;
};
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/layout/ng/ng_inline_layout_algorithm.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698