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

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

Issue 2870413005: [LayoutNG] Add "Control" NGInlineItemType for newlines and tabs (Closed)
Patch Set: Created 3 years, 7 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 UChar character; 85 UChar character;
86 } OnExitNode; 86 } OnExitNode;
87 Vector<OnExitNode> exits_; 87 Vector<OnExitNode> exits_;
88 88
89 enum class CollapsibleSpace { kNone, kSpace, kNewline }; 89 enum class CollapsibleSpace { kNone, kSpace, kNewline };
90 90
91 CollapsibleSpace last_collapsible_space_ = CollapsibleSpace::kSpace; 91 CollapsibleSpace last_collapsible_space_ = CollapsibleSpace::kSpace;
92 bool is_svgtext_ = false; 92 bool is_svgtext_ = false;
93 bool has_bidi_controls_ = false; 93 bool has_bidi_controls_ = false;
94 94
95 void AppendWithWhiteSpaceCollapsing(const String&,
96 unsigned start,
97 unsigned end,
98 const ComputedStyle*,
99 LayoutObject*);
100 void AppendWithoutWhiteSpaceCollapsing(const String&,
101 const ComputedStyle*,
102 LayoutObject*);
103 void AppendWithPreservingNewlines(const String&,
104 const ComputedStyle*,
105 LayoutObject*);
106
107 void AppendForcedBreak(const ComputedStyle*, LayoutObject*);
108
95 // Because newlines may be removed depends on following characters, newlines 109 // Because newlines may be removed depends on following characters, newlines
96 // at the end of input string is not added to |text_| but instead 110 // at the end of input string is not added to |text_| but instead
97 // |has_pending_newline_| flag is set. 111 // |has_pending_newline_| flag is set.
98 // This function determines whether to add the newline or ignore. 112 // This function determines whether to add the newline or ignore.
99 void ProcessPendingNewline(const String&, const ComputedStyle*); 113 void ProcessPendingNewline(const String&, const ComputedStyle*);
100 114
101 // Removes the collapsible space at the end of |text_| if exists. 115 // Removes the collapsible space at the end of |text_| if exists.
102 void RemoveTrailingCollapsibleSpaceIfExists(unsigned*); 116 void RemoveTrailingCollapsibleSpaceIfExists(unsigned*);
103 void RemoveTrailingCollapsibleSpace(unsigned*); 117 void RemoveTrailingCollapsibleSpace(unsigned*);
104 118
105 void RemoveTrailingCollapsibleNewlineIfNeeded(unsigned*, 119 void RemoveTrailingCollapsibleNewlineIfNeeded(unsigned*,
106 const String&, 120 const String&,
107 unsigned, 121 unsigned,
108 const ComputedStyle*); 122 const ComputedStyle*);
109 123
110 void Enter(LayoutObject*, UChar); 124 void Enter(LayoutObject*, UChar);
111 void Exit(LayoutObject*); 125 void Exit(LayoutObject*);
112 }; 126 };
113 127
114 } // namespace blink 128 } // namespace blink
115 129
116 #endif // NGInlineItemsBuilder_h 130 #endif // NGInlineItemsBuilder_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698