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

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

Issue 2951213005: [LayoutNG] Support objects that are opaque to whitespace collapsing (Closed)
Patch Set: Renamed to AppendOpaque 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
index 9f295706ea0b3e1cdb2b3afe22068a496810b9bc..87195e47d6e86f89ed62efaba12d89120f17619d 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
@@ -63,10 +63,16 @@ class CORE_EXPORT NGInlineItemsBuilder {
const ComputedStyle* = nullptr,
LayoutObject* = nullptr);
- // Append a non-character item.
- void Append(NGInlineItem::NGInlineItemType,
- const ComputedStyle* = nullptr,
- LayoutObject* = nullptr);
+ // Append a character.
+ // The character is opaque to space collapsing; i.e., spaces before this
+ // character and after this character can collapse as if this character does
+ // not exist.
+ void AppendOpaque(NGInlineItem::NGInlineItemType, UChar);
+
+ // Append a non-character item that is opaque to space collapsing.
+ void AppendOpaque(NGInlineItem::NGInlineItemType,
+ const ComputedStyle* = nullptr,
+ LayoutObject* = nullptr);
// Append a Bidi control character, for LTR or RTL depends on the style.
void AppendBidiControl(const ComputedStyle*, UChar ltr, UChar rtl);
@@ -112,12 +118,9 @@ class CORE_EXPORT NGInlineItemsBuilder {
// This function determines whether to add the newline or ignore.
void ProcessPendingNewline(const String&, const ComputedStyle*);
- // Removes the collapsible space at the end of |text_| if exists.
- void RemoveTrailingCollapsibleSpaceIfExists(unsigned*);
- void RemoveTrailingCollapsibleSpace(unsigned*);
-
- void RemoveTrailingCollapsibleNewlineIfNeeded(unsigned*,
- const String&,
+ void RemoveTrailingCollapsibleSpaceIfExists();
+ void RemoveTrailingCollapsibleSpace(unsigned);
+ void RemoveTrailingCollapsibleNewlineIfNeeded(const String&,
unsigned,
const ComputedStyle*);

Powered by Google App Engine
This is Rietveld 408576698