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; | |
|
esprehn
2015/06/23 21:57:18
You don't need this forward decl, you include Layo
| |
| 17 | |
| 18 class LineLayoutItem { | |
| 19 public: | |
| 20 explicit LineLayoutItem(LayoutObject* layoutObject) | |
| 21 : m_layoutObject(layoutObject) | |
| 22 { | |
| 23 } | |
| 24 | |
| 25 explicit LineLayoutItem(const LineLayoutItem& item) : m_layoutObject(item.m_ layoutObject) { } | |
|
leviw_travelin_and_unemployed
2015/06/24 19:10:51
The jyasskin took a look and this is the problem:
| |
| 26 explicit LineLayoutItem() : m_layoutObject(0) { } | |
|
leviw_travelin_and_unemployed
2015/06/23 21:51:46
You don't need the explicit here... maybe try remo
| |
| 27 | |
| 28 // TODO: Remove this. It's only here to make things compile before | |
| 29 // switching all of core/layout/line to using the API. | |
| 30 // https://crbug.com/499321 | |
| 31 operator LayoutObject*() const { return m_layoutObject; } | |
| 32 | |
| 33 LineLayoutItem* operator->() { return this; } | |
| 34 | |
| 35 bool hasLayoutObject() const | |
|
esprehn
2015/06/23 21:57:18
isNull(), but I think you want to just use the Uns
| |
| 36 { | |
| 37 return m_layoutObject; | |
| 38 } | |
| 39 | |
| 40 LineLayoutItem parent() const | |
| 41 { | |
| 42 return LineLayoutItem(m_layoutObject->parent()); | |
|
leviw_travelin_and_unemployed
2015/06/23 21:51:46
../../third_party/WebKit/Source/core/layout/api/Li
| |
| 43 } | |
| 44 | |
| 45 LineLayoutItem nextSibling() const | |
| 46 { | |
| 47 return LineLayoutItem(m_layoutObject->nextSibling()); | |
| 48 } | |
| 49 | |
| 50 LineLayoutItem previousSibling() const | |
| 51 { | |
| 52 return LineLayoutItem(m_layoutObject->previousSibling()); | |
| 53 } | |
| 54 | |
| 55 LineLayoutItem slowFirstChild() const | |
| 56 { | |
| 57 return LineLayoutItem(m_layoutObject->slowFirstChild()); | |
| 58 } | |
| 59 | |
| 60 LineLayoutItem slowLastChild() const | |
| 61 { | |
| 62 return LineLayoutItem(m_layoutObject->slowLastChild()); | |
| 63 } | |
| 64 | |
| 65 const ComputedStyle* style() const | |
| 66 { | |
| 67 return m_layoutObject->style(); | |
| 68 } | |
| 69 | |
| 70 const ComputedStyle& styleRef() const | |
| 71 { | |
| 72 return m_layoutObject->styleRef(); | |
| 73 } | |
| 74 | |
| 75 Document& document() const | |
| 76 { | |
| 77 return m_layoutObject->document(); | |
| 78 } | |
| 79 | |
| 80 bool preservesNewline() const | |
| 81 { | |
| 82 return m_layoutObject->preservesNewline(); | |
| 83 } | |
| 84 | |
| 85 unsigned length() const | |
| 86 { | |
| 87 return m_layoutObject->length(); | |
| 88 } | |
| 89 | |
| 90 bool isFloatingOrOutOfFlowPositioned() const | |
| 91 { | |
| 92 return m_layoutObject->isFloatingOrOutOfFlowPositioned(); | |
| 93 } | |
| 94 | |
| 95 bool isFloating() const | |
| 96 { | |
| 97 return m_layoutObject->isFloating(); | |
| 98 } | |
| 99 | |
| 100 bool isOutOfFlowPositioned() const | |
| 101 { | |
| 102 return m_layoutObject->isOutOfFlowPositioned(); | |
| 103 } | |
| 104 | |
| 105 bool isBox() const | |
| 106 { | |
| 107 return m_layoutObject->isBox(); | |
| 108 } | |
| 109 | |
| 110 bool isBR() const | |
| 111 { | |
| 112 return m_layoutObject->isBR(); | |
| 113 } | |
| 114 | |
| 115 bool isHorizontalWritingMode() const | |
| 116 { | |
| 117 return m_layoutObject->isHorizontalWritingMode(); | |
| 118 } | |
| 119 | |
| 120 bool isImage() const | |
| 121 { | |
| 122 return m_layoutObject->isImage(); | |
| 123 } | |
| 124 | |
| 125 bool isLayoutBlockFlow() const | |
| 126 { | |
| 127 return m_layoutObject->isLayoutBlockFlow(); | |
| 128 } | |
| 129 | |
| 130 bool isLayoutInline() const | |
| 131 { | |
| 132 return m_layoutObject->isLayoutInline(); | |
| 133 } | |
| 134 | |
| 135 bool isListMarker() const | |
| 136 { | |
| 137 return m_layoutObject->isListMarker(); | |
| 138 } | |
| 139 | |
| 140 bool isReplaced() const | |
| 141 { | |
| 142 return m_layoutObject->isReplaced(); | |
| 143 } | |
| 144 | |
| 145 bool isRubyRun() const | |
| 146 { | |
| 147 return m_layoutObject->isRubyRun(); | |
| 148 } | |
| 149 | |
| 150 bool isSVGInlineText() const | |
| 151 { | |
| 152 return m_layoutObject->isSVGInlineText(); | |
| 153 } | |
| 154 | |
| 155 bool isTableCell() const | |
| 156 { | |
| 157 return m_layoutObject->isTableCell(); | |
| 158 } | |
| 159 | |
| 160 bool isText() const | |
| 161 { | |
| 162 return m_layoutObject->isText(); | |
| 163 } | |
| 164 | |
| 165 protected: | |
| 166 LayoutObject* layoutObject() { return m_layoutObject; } | |
| 167 const LayoutObject* layoutObject() const { return m_layoutObject; } | |
| 168 | |
| 169 private: | |
| 170 LayoutObject* m_layoutObject; | |
| 171 }; | |
| 172 | |
| 173 } // namespace blink | |
| 174 | |
| 175 #endif // LineLayoutItem_h | |
| OLD | NEW |