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

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

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.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
index c21c315a559df0d23820a2c5714227f9cd88b776..a1bafc8c8f278453c869855b205d098bf7168b3c 100644
--- a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
@@ -163,6 +163,7 @@ void NGInlineItemsBuilderTemplate<OffsetMappingBuilder>::Append(
return;
text_.ReserveCapacity(string.length());
+ AutoReset<bool> appending_string_scope(&is_appending_string_, true);
EWhiteSpace whitespace = style->WhiteSpace();
if (!ComputedStyle::CollapseWhiteSpace(whitespace))
return AppendWithoutWhiteSpaceCollapsing(string, style, layout_object);
@@ -310,6 +311,8 @@ void NGInlineItemsBuilderTemplate<OffsetMappingBuilder>::Append(
text_.Append(character);
mapping_builder_.AppendIdentityMapping(1);
+ if (!is_appending_string_)
+ concatenated_mapping_builder_.AppendIdentityMapping(1);
unsigned end_offset = text_.length();
AppendItem(items_, type, end_offset - 1, end_offset, style, layout_object);
@@ -323,6 +326,7 @@ void NGInlineItemsBuilderTemplate<OffsetMappingBuilder>::AppendOpaque(
UChar character) {
text_.Append(character);
mapping_builder_.AppendIdentityMapping(1);
+ concatenated_mapping_builder_.AppendIdentityMapping(1);
unsigned end_offset = text_.length();
AppendItem(items_, type, end_offset - 1, end_offset, nullptr, nullptr);

Powered by Google App Engine
This is Rietveld 408576698