OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef LineLayoutItem_h |
| 6 #define LineLayoutItem_h |
| 7 |
| 8 #include "core/layout/LayoutObject.h" |
| 9 |
| 10 #include "platform/LayoutUnit.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class ComputedStyle; |
| 15 class Document; |
| 16 class LayoutObject; |
| 17 |
| 18 class LineLayoutItem { |
| 19 public: |
| 20 explicit LineLayoutItem(LayoutObject* layoutObject) |
| 21 : m_layoutObject(layoutObject) |
| 22 { |
| 23 } |
| 24 |
| 25 LineLayoutItem(const LineLayoutItem& item) : m_layoutObject(item.m_layoutObj
ect) { } |
| 26 |
| 27 LineLayoutItem(std::nullptr_t) |
| 28 : m_layoutObject(0) |
| 29 { |
| 30 } |
| 31 |
| 32 LineLayoutItem() : m_layoutObject(0) { } |
| 33 |
| 34 // TODO(pilgrim): Remove this. It's only here to make things compile before |
| 35 // switching all of core/layout/line to using the API. |
| 36 // https://crbug.com/499321 |
| 37 operator LayoutObject*() const { return m_layoutObject; } |
| 38 |
| 39 LineLayoutItem* operator->() { return this; } |
| 40 |
| 41 LineLayoutItem parent() const |
| 42 { |
| 43 return LineLayoutItem(m_layoutObject->parent()); |
| 44 } |
| 45 |
| 46 LineLayoutItem nextSibling() const |
| 47 { |
| 48 return LineLayoutItem(m_layoutObject->nextSibling()); |
| 49 } |
| 50 |
| 51 LineLayoutItem previousSibling() const |
| 52 { |
| 53 return LineLayoutItem(m_layoutObject->previousSibling()); |
| 54 } |
| 55 |
| 56 LineLayoutItem slowFirstChild() const |
| 57 { |
| 58 return LineLayoutItem(m_layoutObject->slowFirstChild()); |
| 59 } |
| 60 |
| 61 LineLayoutItem slowLastChild() const |
| 62 { |
| 63 return LineLayoutItem(m_layoutObject->slowLastChild()); |
| 64 } |
| 65 |
| 66 const ComputedStyle* style() const |
| 67 { |
| 68 return m_layoutObject->style(); |
| 69 } |
| 70 |
| 71 const ComputedStyle& styleRef() const |
| 72 { |
| 73 return m_layoutObject->styleRef(); |
| 74 } |
| 75 |
| 76 Document& document() const |
| 77 { |
| 78 return m_layoutObject->document(); |
| 79 } |
| 80 |
| 81 bool preservesNewline() const |
| 82 { |
| 83 return m_layoutObject->preservesNewline(); |
| 84 } |
| 85 |
| 86 unsigned length() const |
| 87 { |
| 88 return m_layoutObject->length(); |
| 89 } |
| 90 |
| 91 bool isFloatingOrOutOfFlowPositioned() const |
| 92 { |
| 93 return m_layoutObject->isFloatingOrOutOfFlowPositioned(); |
| 94 } |
| 95 |
| 96 bool isFloating() const |
| 97 { |
| 98 return m_layoutObject->isFloating(); |
| 99 } |
| 100 |
| 101 bool isOutOfFlowPositioned() const |
| 102 { |
| 103 return m_layoutObject->isOutOfFlowPositioned(); |
| 104 } |
| 105 |
| 106 bool isBox() const |
| 107 { |
| 108 return m_layoutObject->isBox(); |
| 109 } |
| 110 |
| 111 bool isBR() const |
| 112 { |
| 113 return m_layoutObject->isBR(); |
| 114 } |
| 115 |
| 116 bool isHorizontalWritingMode() const |
| 117 { |
| 118 return m_layoutObject->isHorizontalWritingMode(); |
| 119 } |
| 120 |
| 121 bool isImage() const |
| 122 { |
| 123 return m_layoutObject->isImage(); |
| 124 } |
| 125 |
| 126 bool isLayoutBlockFlow() const |
| 127 { |
| 128 return m_layoutObject->isLayoutBlockFlow(); |
| 129 } |
| 130 |
| 131 bool isLayoutInline() const |
| 132 { |
| 133 return m_layoutObject->isLayoutInline(); |
| 134 } |
| 135 |
| 136 bool isListMarker() const |
| 137 { |
| 138 return m_layoutObject->isListMarker(); |
| 139 } |
| 140 |
| 141 bool isReplaced() const |
| 142 { |
| 143 return m_layoutObject->isReplaced(); |
| 144 } |
| 145 |
| 146 bool isRubyRun() const |
| 147 { |
| 148 return m_layoutObject->isRubyRun(); |
| 149 } |
| 150 |
| 151 bool isSVGInlineText() const |
| 152 { |
| 153 return m_layoutObject->isSVGInlineText(); |
| 154 } |
| 155 |
| 156 bool isTableCell() const |
| 157 { |
| 158 return m_layoutObject->isTableCell(); |
| 159 } |
| 160 |
| 161 bool isText() const |
| 162 { |
| 163 return m_layoutObject->isText(); |
| 164 } |
| 165 |
| 166 protected: |
| 167 LayoutObject* layoutObject() { return m_layoutObject; } |
| 168 const LayoutObject* layoutObject() const { return m_layoutObject; } |
| 169 |
| 170 private: |
| 171 LayoutObject* m_layoutObject; |
| 172 }; |
| 173 |
| 174 } // namespace blink |
| 175 |
| 176 #endif // LineLayoutItem_h |
OLD | NEW |