| 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 NGPhysicalTextFragment_h | 5 #ifndef NGPhysicalTextFragment_h |
| 6 #define NGPhysicalTextFragment_h | 6 #define NGPhysicalTextFragment_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/layout/ng/ng_physical_fragment_base.h" | 9 #include "core/layout/ng/ng_physical_fragment_base.h" |
| 10 #include "core/layout/ng/ng_layout_input_text.h" | 10 #include "core/layout/ng/ng_layout_input_text.h" |
| 11 #include "platform/LayoutUnit.h" | 11 #include "platform/LayoutUnit.h" |
| 12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 13 #include "wtf/text/WTFString.h" | 13 #include "wtf/text/WTFString.h" |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class CORE_EXPORT NGPhysicalTextFragment final : public NGPhysicalFragmentBase { | 17 class CORE_EXPORT NGPhysicalTextFragment final : public NGPhysicalFragmentBase { |
| 18 public: | 18 public: |
| 19 NGPhysicalTextFragment(NGPhysicalSize size, NGPhysicalSize overflow) | 19 NGPhysicalTextFragment(NGPhysicalSize size, NGPhysicalSize overflow) |
| 20 : NGPhysicalFragmentBase(size, overflow, FragmentText, {}) {} | 20 : NGPhysicalFragmentBase(size, overflow, FragmentText, {}) {} |
| 21 | 21 |
| 22 String Text() const { return text_list_->Text(start_offset_, end_offset_); } | 22 String Text() const { return text_list_->Text(start_offset_, end_offset_); } |
| 23 | 23 |
| 24 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { | |
| 25 visitor->trace(text_list_); | |
| 26 NGPhysicalFragmentBase::traceAfterDispatch(visitor); | |
| 27 } | |
| 28 | |
| 29 private: | 24 private: |
| 30 Member<NGLayoutInputText> text_list_; | 25 std::unique_ptr<NGLayoutInputText> text_list_; |
| 31 unsigned start_offset_; | 26 unsigned start_offset_; |
| 32 unsigned end_offset_; | 27 unsigned end_offset_; |
| 33 }; | 28 }; |
| 34 | 29 |
| 35 DEFINE_TYPE_CASTS(NGPhysicalTextFragment, | 30 DEFINE_TYPE_CASTS(NGPhysicalTextFragment, |
| 36 NGPhysicalFragmentBase, | 31 NGPhysicalFragmentBase, |
| 37 text, | 32 text, |
| 38 text->Type() == NGPhysicalFragmentBase::FragmentText, | 33 text->Type() == NGPhysicalFragmentBase::FragmentText, |
| 39 text.Type() == NGPhysicalFragmentBase::FragmentText); | 34 text.Type() == NGPhysicalFragmentBase::FragmentText); |
| 40 | 35 |
| 41 } // namespace blink | 36 } // namespace blink |
| 42 | 37 |
| 43 #endif // NGPhysicalTextFragment_h | 38 #endif // NGPhysicalTextFragment_h |
| OLD | NEW |