| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 LayoutTextFragmentItem_h | 5 #ifndef LayoutTextFragmentItem_h |
| 6 #define LayoutTextFragmentItem_h | 6 #define LayoutTextFragmentItem_h |
| 7 | 7 |
| 8 #include "core/layout/LayoutTextFragment.h" | 8 #include "core/layout/LayoutTextFragment.h" |
| 9 #include "core/layout/api/LayoutTextItem.h" | 9 #include "core/layout/api/LayoutTextItem.h" |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 { | 24 { |
| 25 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isTextFragment()); | 25 ASSERT_WITH_SECURITY_IMPLICATION(!item || item.isTextFragment()); |
| 26 } | 26 } |
| 27 | 27 |
| 28 explicit LayoutTextFragmentItem(std::nullptr_t) : LayoutTextItem(nullptr) {
} | 28 explicit LayoutTextFragmentItem(std::nullptr_t) : LayoutTextItem(nullptr) {
} |
| 29 | 29 |
| 30 LayoutTextFragmentItem() { } | 30 LayoutTextFragmentItem() { } |
| 31 | 31 |
| 32 void setTextFragment(PassRefPtr<StringImpl> text, unsigned start, unsigned l
ength) | 32 void setTextFragment(PassRefPtr<StringImpl> text, unsigned start, unsigned l
ength) |
| 33 { | 33 { |
| 34 toTextFragment()->setTextFragment(text, start, length); | 34 toTextFragment()->setTextFragment(std::move(text), start, length); |
| 35 } | 35 } |
| 36 | 36 |
| 37 FirstLetterPseudoElement* firstLetterPseudoElement() const | 37 FirstLetterPseudoElement* firstLetterPseudoElement() const |
| 38 { | 38 { |
| 39 return toTextFragment()->firstLetterPseudoElement(); | 39 return toTextFragment()->firstLetterPseudoElement(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 LayoutTextFragment* toTextFragment() { return toLayoutTextFragment(layoutObj
ect()); } | 43 LayoutTextFragment* toTextFragment() { return toLayoutTextFragment(layoutObj
ect()); } |
| 44 const LayoutTextFragment* toTextFragment() const { return toLayoutTextFragme
nt(layoutObject()); } | 44 const LayoutTextFragment* toTextFragment() const { return toLayoutTextFragme
nt(layoutObject()); } |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace blink | 47 } // namespace blink |
| 48 | 48 |
| 49 #endif // LayoutTextFragmentItem_h | 49 #endif // LayoutTextFragmentItem_h |
| OLD | NEW |