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

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

Issue 1164933006: Create LineLayout api (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: non-working version without const_cast 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/LineLayoutBox.h
diff --git a/Source/core/layout/api/LineLayoutBox.h b/Source/core/layout/api/LineLayoutBox.h
new file mode 100644
index 0000000000000000000000000000000000000000..c6e71824066c65ea62ff2a67bcaf95acdc3b8bc9
--- /dev/null
+++ b/Source/core/layout/api/LineLayoutBox.h
@@ -0,0 +1,55 @@
+// 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 LineLayoutBox_h
+#define LineLayoutBox_h
+
+#include "core/layout/LayoutBox.h"
+#include "core/layout/api/LineLayoutItem.h"
+#include "platform/LayoutUnit.h"
+
+namespace blink {
+
+class LayoutBox;
+
+class LineLayoutBox : public LineLayoutItem {
+public:
+ LineLayoutBox(LayoutBox* layoutBox)
+ : LineLayoutItem(layoutBox)
+ {
+ }
+
+ LineLayoutBox(const LineLayoutItem& item)
+ : LineLayoutItem(item)
+ {
+ ASSERT(!item.hasLayoutObject() || item.isBox());
+ }
+
+ LineLayoutBox() { }
+
+ void setLogicalHeight(LayoutUnit size)
+ {
+ toBox()->setLogicalHeight(size);
+ }
+
+ LayoutUnit logicalHeight() const
+ {
+ return toBox()->logicalHeight();
+ }
+
+private:
+ LayoutBox* toBox()
+ {
+ return toLayoutBox(layoutObject());
+ }
+
+ const LayoutBox* toBox() const
+ {
+ return toLayoutBox(layoutObject());
+ }
+};
+
+} // namespace blink
+
+#endif // LineLayoutBox_h

Powered by Google App Engine
This is Rietveld 408576698