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

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

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 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 1038485901038a4a211dbd51b71fa06440c5c91e..c1d2beac900fc15d9ae342744df22c62571156c9 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
@@ -157,9 +157,12 @@ void NGInlineItemsBuilder::AppendWithWhiteSpaceCollapsing(
return;
}
- if (last_collapsible_space_ == CollapsibleSpace::kNone)
+ if (last_collapsible_space_ == CollapsibleSpace::kNone) {
text_.Append(kSpaceCharacter);
+ }
last_collapsible_space_ = CollapsibleSpace::kNewline;
+ if (offset_mapping_)
+ offset_mapping_->push_back(text_.length());
i++;
continue;
}
@@ -169,6 +172,8 @@ void NGInlineItemsBuilder::AppendWithWhiteSpaceCollapsing(
text_.Append(kSpaceCharacter);
last_collapsible_space_ = CollapsibleSpace::kSpace;
}
+ if (offset_mapping_)
+ offset_mapping_->push_back(text_.length());
i++;
continue;
}
@@ -181,6 +186,12 @@ void NGInlineItemsBuilder::AppendWithWhiteSpaceCollapsing(
if (end_of_non_space == kNotFound)
end_of_non_space = string.length();
text_.Append(string, i, end_of_non_space - i);
+ if (offset_mapping_) {
kojii 2017/06/16 11:25:56 Changes in this file is not for review, correct?
+ size_t apend_size = end_of_non_space - i;
+ for (size_t k = 0; k < apend_size; k++)
+ offset_mapping_->push_back(text_.length() - apend_size + k + 1);
+ }
+
i = end_of_non_space;
last_collapsible_space_ = CollapsibleSpace::kNone;
}

Powered by Google App Engine
This is Rietveld 408576698