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

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

Issue 2764753007: [LayoutNG] Add NGLineBoxFragment (Closed)
Patch Set: Rebase again as other CLs landed faster Created 3 years, 9 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
(Empty)
1 // Copyright 2017 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 NGTextFragmentBuilder_h
6 #define NGTextFragmentBuilder_h
7
8 #include "core/layout/ng/geometry/ng_logical_size.h"
9 #include "core/layout/ng/ng_line_height_metrics.h"
10 #include "platform/text/TextDirection.h"
11 #include "wtf/Allocator.h"
12
13 namespace blink {
14
15 class NGInlineNode;
16 class NGPhysicalTextFragment;
17
18 class CORE_EXPORT NGTextFragmentBuilder final {
19 STACK_ALLOCATED();
20
21 public:
22 NGTextFragmentBuilder(NGInlineNode*);
23
24 NGTextFragmentBuilder& SetDirection(TextDirection);
25
26 NGTextFragmentBuilder& SetInlineSize(LayoutUnit);
27 NGTextFragmentBuilder& SetBlockSize(LayoutUnit);
28
29 void UniteMetrics(const NGLineHeightMetrics&);
30 const NGLineHeightMetrics& Metrics() const { return metrics_; }
31
32 // Creates the fragment. Can only be called once.
33 RefPtr<NGPhysicalTextFragment> ToTextFragment(unsigned index,
34 unsigned start_offset,
35 unsigned end_offset);
36
37 private:
38 TextDirection direction_;
39
40 Persistent<NGInlineNode> node_;
41
42 NGLogicalSize size_;
43
44 NGLineHeightMetrics metrics_;
45 };
46
47 } // namespace blink
48
49 #endif // NGTextFragmentBuilder
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698