Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_text_fragment.h

Issue 2282213002: [LayoutNG] Introduce NGPhysicalFragment and make NGFragment a 'view' (Closed)
Patch Set: address comments. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 NGTextFragment_h 5 #ifndef NGTextFragment_h
6 #define NGTextFragment_h 6 #define NGTextFragment_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/ng_fragment_base.h" 9 #include "core/layout/ng/ng_fragment_base.h"
10 #include "core/layout/ng/ng_physical_text_fragment.h"
10 #include "core/layout/ng/ng_layout_input_text.h" 11 #include "core/layout/ng/ng_layout_input_text.h"
11 #include "platform/LayoutUnit.h" 12 #include "platform/LayoutUnit.h"
12 #include "platform/heap/Handle.h" 13 #include "platform/heap/Handle.h"
13 #include "wtf/text/WTFString.h" 14 #include "wtf/text/WTFString.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class CORE_EXPORT NGTextFragment final : public NGFragmentBase { 18 class CORE_EXPORT NGTextFragment final : public NGFragmentBase {
18 public: 19 public:
19 NGTextFragment(NGLogicalSize size, 20 NGTextFragment(NGWritingMode writing_mode,
20 NGLogicalSize overflow, 21 NGDirection direction,
21 NGWritingMode writingMode, 22 NGPhysicalTextFragment* physical_text_fragment)
22 NGDirection direction) 23 : NGFragmentBase(writing_mode, direction, physical_text_fragment) {}
23 : NGFragmentBase(size, overflow, writingMode, direction, FragmentText) {}
24 24
25 String text() const; 25 String Text() const {
26 26 return toNGPhysicalTextFragment(physical_fragment_)->Text();
27 DEFINE_INLINE_TRACE_AFTER_DISPATCH() {
28 visitor->trace(text_list_);
29 NGFragmentBase::traceAfterDispatch(visitor);
30 } 27 }
31
32 private:
33 Member<NGLayoutInputText> text_list_;
34 unsigned start_offset_;
35 unsigned end_offset_;
36 }; 28 };
37 29
38 } // namespace blink 30 } // namespace blink
39 31
40 #endif // NGTextFragment_h 32 #endif // NGTextFragment_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698