Chromium Code Reviews| 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 LineLayoutItem(LayoutObject*); | |
| 21 LineLayoutItem(const LineLayoutItem& item) : m_layoutObject(item.m_layoutObj ect) { } | |
| 22 LineLayoutItem() : m_layoutObject(0) { } | |
| 23 | |
| 24 // TODO: Remove this. It's only here to make things compile before | |
| 25 // switching all of core/layout/line to using the API. | |
| 26 // https://crbug.com/499321 | |
| 27 operator LayoutObject*() const { return m_layoutObject; } | |
| 28 | |
| 29 LineLayoutItem* operator->() { return this; } | |
| 30 | |
| 31 LineLayoutItem parent() const | |
| 32 { | |
| 33 return m_layoutObject->parent(); | |
| 34 } | |
| 35 | |
| 36 LineLayoutItem nextSibling() const | |
| 37 { | |
| 38 return m_layoutObject->nextSibling(); | |
| 39 } | |
| 40 | |
| 41 LineLayoutItem previousSibling() const | |
| 42 { | |
| 43 return m_layoutObject->previousSibling(); | |
| 44 } | |
| 45 | |
| 46 LineLayoutItem slowFirstChild() const | |
| 47 { | |
| 48 return m_layoutObject->slowFirstChild(); | |
| 49 } | |
| 50 | |
| 51 LineLayoutItem slowLastChild() const | |
| 52 { | |
| 53 return m_layoutObject->slowLastChild(); | |
| 54 } | |
| 55 | |
| 56 const ComputedStyle* style() const | |
| 57 { | |
| 58 return m_layoutObject->style(); | |
| 59 } | |
| 60 | |
| 61 const ComputedStyle& styleRef() const | |
| 62 { | |
| 63 return m_layoutObject->styleRef(); | |
| 64 } | |
| 65 | |
| 66 Document& document() const | |
| 67 { | |
| 68 return m_layoutObject->document(); | |
| 69 } | |
| 70 | |
| 71 bool preservesNewline() const | |
| 72 { | |
| 73 return m_layoutObject->preservesNewline(); | |
| 74 } | |
| 75 | |
| 76 unsigned length() const | |
| 77 { | |
| 78 return m_layoutObject->length(); | |
| 79 } | |
| 80 | |
| 81 bool isFloatingOrOutOfFlowPositioned() const | |
| 82 { | |
| 83 return m_layoutObject->isFloatingOrOutOfFlowPositioned(); | |
| 84 } | |
| 85 | |
| 86 bool isFloating() const | |
| 87 { | |
| 88 return m_layoutObject->isFloating(); | |
| 89 } | |
| 90 | |
| 91 bool isOutOfFlowPositioned() const | |
| 92 { | |
| 93 return m_layoutObject->isOutOfFlowPositioned(); | |
| 94 } | |
| 95 | |
| 96 bool isBR() const | |
| 97 { | |
| 98 return m_layoutObject->isBR(); | |
| 99 } | |
| 100 | |
| 101 bool isHorizontalWritingMode() const | |
| 102 { | |
| 103 return m_layoutObject->isHorizontalWritingMode(); | |
| 104 } | |
| 105 | |
| 106 bool isImage() const | |
| 107 { | |
| 108 return m_layoutObject->isImage(); | |
| 109 } | |
| 110 | |
| 111 bool isLayoutInline() const | |
| 112 { | |
| 113 return m_layoutObject->isLayoutInline(); | |
| 114 } | |
| 115 | |
| 116 bool isListMarker() const | |
| 117 { | |
| 118 return m_layoutObject->isListMarker(); | |
| 119 } | |
| 120 | |
| 121 bool isReplaced() const | |
| 122 { | |
| 123 return m_layoutObject->isReplaced(); | |
| 124 } | |
| 125 | |
| 126 bool isRubyRun() const | |
| 127 { | |
| 128 return m_layoutObject->isRubyRun(); | |
| 129 } | |
| 130 | |
| 131 bool isSVGInlineText() const | |
| 132 { | |
| 133 return m_layoutObject->isSVGInlineText(); | |
| 134 } | |
| 135 | |
| 136 bool isTableCell() const | |
| 137 { | |
| 138 return m_layoutObject->isTableCell(); | |
| 139 } | |
| 140 | |
| 141 bool isText() const | |
| 142 { | |
| 143 return m_layoutObject->isText(); | |
| 144 } | |
| 145 | |
| 146 protected: | |
| 147 LayoutObject* layoutObject() { return m_layoutObject; } | |
| 148 const LayoutObject* layoutObject() const { return m_layoutObject; } | |
| 149 | |
| 150 friend class LineLayoutBlockFlow; // for layoutObject | |
|
esprehn
2015/06/17 20:29:52
You shouldn't need to make any of these friends.
| |
| 151 friend class LineLayoutBox; | |
| 152 friend class LineLayoutInline; | |
| 153 friend class LineLayoutText; | |
| 154 | |
| 155 private: | |
| 156 LayoutObject* m_layoutObject; | |
| 157 }; | |
| 158 | |
| 159 } // namespace blink | |
| 160 | |
| 161 #endif // LineLayoutItem_h | |
| OLD | NEW |