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

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

Issue 2237623002: Demo patch that demonstrates simple block layout using Layout NG (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed NGBlockLayoutAlgorithmTest 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
index e2a9e2c3468d32099c831a868dc95aff8a5c3d7a..10f23a49c497790240c9ccac7cbc0b974f86855b 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.h
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.h
@@ -5,33 +5,32 @@
#ifndef NGBox_h
#define NGBox_h
+#include "core/layout/ng/ng_box_iterator.h"
+#include "core/layout/LayoutBox.h"
#include "core/CoreExport.h"
#include "platform/heap/Handle.h"
namespace blink {
class ComputedStyle;
-class LayoutObject;
+class LayoutBox;
class NGConstraintSpace;
class NGFragment;
// Represents a node to be laid out.
class CORE_EXPORT NGBox final {
public:
- explicit NGBox(const LayoutObject* layoutObject)
- : m_layoutObject(layoutObject) {}
+ explicit NGBox(LayoutObject* layoutObject)
+ : m_layoutBox(toLayoutBox(layoutObject)) {}
- operator bool() const { return m_layoutObject; }
+ NGBoxIterator iterator() { return NGBoxIterator(m_layoutBox); }
+ operator bool() const { return m_layoutBox; }
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;
+ LayoutBox* m_layoutBox;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698