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

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

Issue 2913773002: [WIP][b:eae_mywip_paint] Paint Selection NG.
Patch Set: update Created 3 years, 6 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 NGInlineItemsBuilder_h 5 #ifndef NGInlineItemsBuilder_h
6 #define NGInlineItemsBuilder_h 6 #define NGInlineItemsBuilder_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/layout/ng/inline/ng_inline_node.h" 9 #include "core/layout/ng/inline/ng_inline_node.h"
10 #include "platform/wtf/Allocator.h" 10 #include "platform/wtf/Allocator.h"
(...skipping 14 matching lines...) Expand all
25 // https://drafts.csswg.org/css-text-3/#white-space-rules 25 // https://drafts.csswg.org/css-text-3/#white-space-rules
26 // 26 //
27 // By calling EnterInline/ExitInline, it inserts bidirectional control 27 // By calling EnterInline/ExitInline, it inserts bidirectional control
28 // characters as defined in: 28 // characters as defined in:
29 // https://drafts.csswg.org/css-writing-modes-3/#bidi-control-codes-injection-ta ble 29 // https://drafts.csswg.org/css-writing-modes-3/#bidi-control-codes-injection-ta ble
30 class CORE_EXPORT NGInlineItemsBuilder { 30 class CORE_EXPORT NGInlineItemsBuilder {
31 STACK_ALLOCATED(); 31 STACK_ALLOCATED();
32 32
33 public: 33 public:
34 explicit NGInlineItemsBuilder(Vector<NGInlineItem>* items) : items_(items) {} 34 explicit NGInlineItemsBuilder(Vector<NGInlineItem>* items) : items_(items) {}
35 explicit NGInlineItemsBuilder(Vector<NGInlineItem>* items,
36 Vector<int>* offset_mapping)
37 : items_(items), offset_mapping_(offset_mapping) {}
kojii 2017/06/16 11:25:56 this isn't for review, correct?
35 ~NGInlineItemsBuilder(); 38 ~NGInlineItemsBuilder();
36 39
37 String ToString(); 40 String ToString();
38 41
39 void SetIsSVGText(bool value) { is_svgtext_ = value; } 42 void SetIsSVGText(bool value) { is_svgtext_ = value; }
40 43
41 // Returns whether the items contain any Bidi controls. 44 // Returns whether the items contain any Bidi controls.
42 bool HasBidiControls() const { return has_bidi_controls_; } 45 bool HasBidiControls() const { return has_bidi_controls_; }
43 46
44 // Append a string. 47 // Append a string.
(...skipping 27 matching lines...) Expand all
72 void AppendBidiControl(const ComputedStyle*, UChar ltr, UChar rtl); 75 void AppendBidiControl(const ComputedStyle*, UChar ltr, UChar rtl);
73 76
74 void EnterBlock(const ComputedStyle*); 77 void EnterBlock(const ComputedStyle*);
75 void ExitBlock(); 78 void ExitBlock();
76 void EnterInline(LayoutObject*); 79 void EnterInline(LayoutObject*);
77 void ExitInline(LayoutObject*); 80 void ExitInline(LayoutObject*);
78 81
79 private: 82 private:
80 Vector<NGInlineItem>* items_; 83 Vector<NGInlineItem>* items_;
81 StringBuilder text_; 84 StringBuilder text_;
85 Vector<int>* offset_mapping_ = nullptr;
82 86
83 typedef struct OnExitNode { 87 typedef struct OnExitNode {
84 LayoutObject* node; 88 LayoutObject* node;
85 UChar character; 89 UChar character;
86 } OnExitNode; 90 } OnExitNode;
87 Vector<OnExitNode> exits_; 91 Vector<OnExitNode> exits_;
88 92
89 enum class CollapsibleSpace { kNone, kSpace, kNewline }; 93 enum class CollapsibleSpace { kNone, kSpace, kNewline };
90 94
91 CollapsibleSpace last_collapsible_space_ = CollapsibleSpace::kSpace; 95 CollapsibleSpace last_collapsible_space_ = CollapsibleSpace::kSpace;
(...skipping 29 matching lines...) Expand all
121 unsigned, 125 unsigned,
122 const ComputedStyle*); 126 const ComputedStyle*);
123 127
124 void Enter(LayoutObject*, UChar); 128 void Enter(LayoutObject*, UChar);
125 void Exit(LayoutObject*); 129 void Exit(LayoutObject*);
126 }; 130 };
127 131
128 } // namespace blink 132 } // namespace blink
129 133
130 #endif // NGInlineItemsBuilder_h 134 #endif // NGInlineItemsBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698