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