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

Unified Diff: Source/core/layout/api/LineLayoutInline.h

Issue 1164933006: Create LineLayout api (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: non-working version with explicit constructors Created 5 years, 6 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: Source/core/layout/api/LineLayoutInline.h
diff --git a/Source/core/layout/api/LineLayoutInline.h b/Source/core/layout/api/LineLayoutInline.h
new file mode 100644
index 0000000000000000000000000000000000000000..39f2c081266fd0ce3e081f6968c222503776a7e1
--- /dev/null
+++ b/Source/core/layout/api/LineLayoutInline.h
@@ -0,0 +1,58 @@
+// Copyright 2015 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 LineLayoutInline_h
+#define LineLayoutInline_h
+
+#include "core/layout/LayoutInline.h"
+#include "core/layout/api/LineLayoutItem.h"
+#include "platform/LayoutUnit.h"
+
+namespace blink {
+
+class ComputedStyle;
+class LayoutInline;
+class LayoutObject;
+
+class LineLayoutInline : public LineLayoutItem {
+public:
+ explicit LineLayoutInline(LayoutInline* layoutInline)
+ : LineLayoutItem(layoutInline)
+ {
+ }
+
+ explicit LineLayoutInline(const LineLayoutItem& item)
+ : LineLayoutItem(item)
+ {
+ ASSERT(!item.hasLayoutObject() || item.isLayoutInline());
+ }
+
+ explicit LineLayoutInline() { }
+
+ LineLayoutItem firstChild() const
+ {
+ return toInline()->firstChild();
+ }
+
+ LineLayoutItem lastChild() const
+ {
+ return toInline()->lastChild();
+ }
+
+protected:
+ LayoutInline* toInline()
+ {
+ return toLayoutInline(layoutObject());
+ }
+
+ const LayoutInline* toInline() const
+ {
+ return toLayoutInline(layoutObject());
+ }
+
+};
+
+} // namespace blink
+
+#endif // LineLayoutInline_h

Powered by Google App Engine
This is Rietveld 408576698