| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef LineLayoutText_h | 5 #ifndef LineLayoutText_h |
| 6 #define LineLayoutText_h | 6 #define LineLayoutText_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutText.h" | 8 #include "core/layout/LayoutText.h" |
| 9 #include "core/layout/api/LineLayoutItem.h" | 9 #include "core/layout/api/LineLayoutItem.h" |
| 10 #include "platform/LayoutUnit.h" | 10 #include "platform/LayoutUnit.h" |
| 11 #include "platform/text/TextPath.h" | 11 #include "platform/text/TextPath.h" |
| 12 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class LayoutText; | 16 class LayoutText; |
| 17 | 17 |
| 18 class LineLayoutText : public LineLayoutItem { | 18 class LineLayoutText : public LineLayoutItem { |
| 19 public: | 19 public: |
| 20 explicit LineLayoutText(LayoutText* layoutObject) : LineLayoutItem(layoutObj
ect) { } | 20 explicit LineLayoutText(LayoutText* layoutObject) : LineLayoutItem(layoutObj
ect) { } |
| 21 | 21 |
| 22 explicit LineLayoutText(const LineLayoutItem& item) | 22 explicit LineLayoutText(const LineLayoutItem& item) |
| 23 : LineLayoutItem(item) | 23 : LineLayoutItem(item) |
| 24 { | 24 { |
| 25 ASSERT(!item || item.isText()); | 25 ASSERT(!item || item.isText()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 LineLayoutText() { } | 28 LineLayoutText() { } |
| 29 | 29 |
| 30 InlineTextBox* firstTextBox() const |
| 31 { |
| 32 return toText()->firstTextBox(); |
| 33 } |
| 34 |
| 30 void extractTextBox(InlineTextBox* inlineTextBox) | 35 void extractTextBox(InlineTextBox* inlineTextBox) |
| 31 { | 36 { |
| 32 toText()->extractTextBox(inlineTextBox); | 37 toText()->extractTextBox(inlineTextBox); |
| 33 } | 38 } |
| 34 | 39 |
| 35 void attachTextBox(InlineTextBox* inlineTextBox) | 40 void attachTextBox(InlineTextBox* inlineTextBox) |
| 36 { | 41 { |
| 37 toText()->attachTextBox(inlineTextBox); | 42 toText()->attachTextBox(inlineTextBox); |
| 38 } | 43 } |
| 39 | 44 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 bool hasEmptyText() const | 85 bool hasEmptyText() const |
| 81 { | 86 { |
| 82 return toText()->hasEmptyText(); | 87 return toText()->hasEmptyText(); |
| 83 } | 88 } |
| 84 | 89 |
| 85 unsigned textLength() const | 90 unsigned textLength() const |
| 86 { | 91 { |
| 87 return toText()->textLength(); | 92 return toText()->textLength(); |
| 88 } | 93 } |
| 89 | 94 |
| 95 unsigned resolvedTextLength() const |
| 96 { |
| 97 return toText()->resolvedTextLength(); |
| 98 } |
| 99 |
| 90 const String& text() const | 100 const String& text() const |
| 91 { | 101 { |
| 92 return toText()->text(); | 102 return toText()->text(); |
| 93 } | 103 } |
| 94 | 104 |
| 95 bool canUseSimpleFontCodePath() const | 105 bool canUseSimpleFontCodePath() const |
| 96 { | 106 { |
| 97 return toText()->canUseSimpleFontCodePath(); | 107 return toText()->canUseSimpleFontCodePath(); |
| 98 } | 108 } |
| 99 | 109 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 128 } | 138 } |
| 129 | 139 |
| 130 private: | 140 private: |
| 131 LayoutText* toText() { return toLayoutText(layoutObject()); } | 141 LayoutText* toText() { return toLayoutText(layoutObject()); } |
| 132 const LayoutText* toText() const { return toLayoutText(layoutObject()); } | 142 const LayoutText* toText() const { return toLayoutText(layoutObject()); } |
| 133 }; | 143 }; |
| 134 | 144 |
| 135 } // namespace blink | 145 } // namespace blink |
| 136 | 146 |
| 137 #endif // LineLayoutText_h | 147 #endif // LineLayoutText_h |
| OLD | NEW |