Chromium Code Reviews| Index: Source/core/layout/api/LineLayoutItem.h |
| diff --git a/Source/core/layout/api/LineLayoutItem.h b/Source/core/layout/api/LineLayoutItem.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f287eb49d911b38e177926c3e31ab2a1da6f51fc |
| --- /dev/null |
| +++ b/Source/core/layout/api/LineLayoutItem.h |
| @@ -0,0 +1,161 @@ |
| +// 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 LineLayoutItem_h |
| +#define LineLayoutItem_h |
| + |
| +#include "core/layout/LayoutObject.h" |
| + |
| +#include "platform/LayoutUnit.h" |
| + |
| +namespace blink { |
| + |
| +class ComputedStyle; |
| +class Document; |
| +class LayoutObject; |
| + |
| +class LineLayoutItem { |
| +public: |
| + LineLayoutItem(LayoutObject*); |
| + LineLayoutItem(const LineLayoutItem& item) : m_layoutObject(item.m_layoutObject) { } |
| + LineLayoutItem() : m_layoutObject(0) { } |
| + |
| + // TODO: Remove this. It's only here to make things compile before |
| + // switching all of core/layout/line to using the API. |
| + // https://crbug.com/499321 |
| + operator LayoutObject*() const { return m_layoutObject; } |
| + |
| + LineLayoutItem* operator->() { return this; } |
| + |
| + LineLayoutItem parent() const |
| + { |
| + return m_layoutObject->parent(); |
| + } |
| + |
| + LineLayoutItem nextSibling() const |
| + { |
| + return m_layoutObject->nextSibling(); |
| + } |
| + |
| + LineLayoutItem previousSibling() const |
| + { |
| + return m_layoutObject->previousSibling(); |
| + } |
| + |
| + LineLayoutItem slowFirstChild() const |
| + { |
| + return m_layoutObject->slowFirstChild(); |
| + } |
| + |
| + LineLayoutItem slowLastChild() const |
| + { |
| + return m_layoutObject->slowLastChild(); |
| + } |
| + |
| + const ComputedStyle* style() const |
| + { |
| + return m_layoutObject->style(); |
| + } |
| + |
| + const ComputedStyle& styleRef() const |
| + { |
| + return m_layoutObject->styleRef(); |
| + } |
| + |
| + Document& document() const |
| + { |
| + return m_layoutObject->document(); |
| + } |
| + |
| + bool preservesNewline() const |
| + { |
| + return m_layoutObject->preservesNewline(); |
| + } |
| + |
| + unsigned length() const |
| + { |
| + return m_layoutObject->length(); |
| + } |
| + |
| + bool isFloatingOrOutOfFlowPositioned() const |
| + { |
| + return m_layoutObject->isFloatingOrOutOfFlowPositioned(); |
| + } |
| + |
| + bool isFloating() const |
| + { |
| + return m_layoutObject->isFloating(); |
| + } |
| + |
| + bool isOutOfFlowPositioned() const |
| + { |
| + return m_layoutObject->isOutOfFlowPositioned(); |
| + } |
| + |
| + bool isBR() const |
| + { |
| + return m_layoutObject->isBR(); |
| + } |
| + |
| + bool isHorizontalWritingMode() const |
| + { |
| + return m_layoutObject->isHorizontalWritingMode(); |
| + } |
| + |
| + bool isImage() const |
| + { |
| + return m_layoutObject->isImage(); |
| + } |
| + |
| + bool isLayoutInline() const |
| + { |
| + return m_layoutObject->isLayoutInline(); |
| + } |
| + |
| + bool isListMarker() const |
| + { |
| + return m_layoutObject->isListMarker(); |
| + } |
| + |
| + bool isReplaced() const |
| + { |
| + return m_layoutObject->isReplaced(); |
| + } |
| + |
| + bool isRubyRun() const |
| + { |
| + return m_layoutObject->isRubyRun(); |
| + } |
| + |
| + bool isSVGInlineText() const |
| + { |
| + return m_layoutObject->isSVGInlineText(); |
| + } |
| + |
| + bool isTableCell() const |
| + { |
| + return m_layoutObject->isTableCell(); |
| + } |
| + |
| + bool isText() const |
| + { |
| + return m_layoutObject->isText(); |
| + } |
| + |
| +protected: |
| + LayoutObject* layoutObject() { return m_layoutObject; } |
| + const LayoutObject* layoutObject() const { return m_layoutObject; } |
| + |
| + friend class LineLayoutBlockFlow; // for layoutObject |
|
esprehn
2015/06/17 20:29:52
You shouldn't need to make any of these friends.
|
| + friend class LineLayoutBox; |
| + friend class LineLayoutInline; |
| + friend class LineLayoutText; |
| + |
| +private: |
| + LayoutObject* m_layoutObject; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // LineLayoutItem_h |