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

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

Issue 2238523002: [LayoutNG] Initial version of NGBox wrapper object. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: third_party/WebKit/Source/core/layout/ng/ng_box.h
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.h b/third_party/WebKit/Source/core/layout/ng/ng_box.h
new file mode 100644
index 0000000000000000000000000000000000000000..be29a5281bb54c93d55eb8495d527c3ecf9cba7b
--- /dev/null
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.h
@@ -0,0 +1,38 @@
+// 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 NGBox_h
+#define NGBox_h
+
+#include "core/CoreExport.h"
+#include "core/layout/LayoutObject.h"
+#include "platform/heap/Handle.h"
+
+namespace blink {
+
+class NGConstraintSpace;
+class NGFragment;
Gleb Lanbin 2016/08/10 15:35:32 class ComputedStyle; class LayoutObject;
ikilpatrick 2016/08/10 16:20:29 Done.
+
+// Represents a node to be laid out.
+class CORE_EXPORT NGBox final {
+ public:
+ explicit NGBox(const LayoutObject* layoutObject)
+ : m_layoutObject(layoutObject) {}
+
+ operator bool() const { return m_layoutObject; }
+
+ NGFragment* layout(const NGConstraintSpace&);
+ const ComputedStyle& style() const;
+
+ // TODO(layout-ng): Returning a children iterator would be better here.
+ const NGBox firstChild() const;
+ const NGBox nextSibling() const;
+
+ private:
+ const LayoutObject* m_layoutObject;
+};
+
+} // namespace blink
+
+#endif // NGBox_h

Powered by Google App Engine
This is Rietveld 408576698