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..64f45ed7d5b671d433d7560e503f0ba301fe3ff1 |
| --- /dev/null |
| +++ b/Source/core/layout/api/LineLayoutItem.h |
| @@ -0,0 +1,80 @@ |
| +// 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 "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: add operator= ? |
| + |
| + // TODO(leviw): re-enable when we don't have the LayoutObject*() operator. |
| + // This conversion operator allows implicit conversion to bool but not to |
| + // other integer types. |
| + // typedef void* UnspecifiedBoolType; |
| + // operator UnspecifiedBoolType() const { return m_layoutObject; } |
|
leviw_travelin_and_unemployed
2015/06/08 18:14:28
We shouldn't land this commented out code. I assum
|
| + |
| + // TODO(leviw): Remove this. It's only here to make things compile before |
| + // switching all of core/layout/line to using the API. |
| + operator LayoutObject*() const { return m_layoutObject; } |
| + |
| + LineLayoutItem* operator->() { return this; } |
| + |
| + LineLayoutItem parent() const; |
| + LineLayoutItem nextSibling() const; |
| + LineLayoutItem previousSibling() const; |
| + LineLayoutItem slowFirstChild() const; |
| + LineLayoutItem slowLastChild() const; |
| + |
| + const ComputedStyle* style() const; |
| + const ComputedStyle& styleRef() const; |
| + |
| + Document& document() const; |
| + |
| + bool preservesNewline() const; |
| + |
| + unsigned length() const; |
| + |
| + bool isFloatingOrOutOfFlowPositioned() const; |
| + bool isFloating() const; |
| + bool isOutOfFlowPositioned() const; |
| + bool isBR() const; |
| + bool isHorizontalWritingMode() const; |
| + bool isImage() const; |
| + bool isLayoutInline() const; |
| + bool isListMarker() const; |
| + bool isReplaced() const; |
| + bool isRubyRun() const; |
| + bool isSVGInlineText() const; |
| + bool isTableCell() const; |
| + bool isText() const; |
| + |
| +protected: |
| + LayoutObject* layoutObject() { return m_layoutObject; } |
| + const LayoutObject* layoutObject() const { return m_layoutObject; } |
| + |
| + friend class LineLayoutBlockFlow; // for layoutObject |
| + friend class LineLayoutBox; |
| + friend class LineLayoutInline; |
| + friend class LineLayoutText; |
| + |
| +private: |
| + LayoutObject* m_layoutObject; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // LineLayoutItem_h |