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

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

Issue 2963093002: Add full offset mapping construction in a block (Closed)
Patch Set: Fix first letter handling Created 3 years, 5 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 35c58b45412f4ada445a66c03581555a1c113be1..017d0f3579067a712de55ace7e8be88f7e3ba159 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
@@ -97,12 +97,32 @@ class CORE_TEMPLATE_CLASS_EXPORT NGInlineItemsBuilderTemplate {
void ExitInline(LayoutObject*);
OffsetMappingBuilder& GetOffsetMappingBuilder() { return mapping_builder_; }
+ OffsetMappingBuilder& GetConcatenatedOffsetMappingBuilder() {
+ return concatenated_mapping_builder_;
+ }
private:
Vector<NGInlineItem>* items_;
StringBuilder text_;
+
+ // TODO(xiaochengh): Rename |mapping_builder_| to |collapsed_mapping_builder_|
+ // |collapsed_mapping_builder_| builds the whitespace-collapsed offset mapping
+ // during inline collection. It is updated whenever |text_| is modified or a
+ // white space is collapsed.
OffsetMappingBuilder mapping_builder_;
+ // |concatenated_mapping_builder_| builds the concatenated offset mapping
+ // during inline collection. It is updated whenever a non-text character is
+ // appended to |text_|. User of NGInlineItemsBuilder should also update
+ // |concatenated_mapping_builder_| whenever collecting a text node during
+ // inline collection, by appending the text-transformed offset mapping of the
+ // text node to |concatenated_mapping_builder_|.
+ OffsetMappingBuilder concatenated_mapping_builder_;
+
+ // Indicates whether we are appending a string not, to help updating
+ // |concatenated_mapping_builder_|.
+ bool is_appending_string_ = false;
+
typedef struct OnExitNode {
LayoutObject* node;
UChar character;

Powered by Google App Engine
This is Rietveld 408576698