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

Issue 2943573002: Make NGInlineItemsBuilder construct whitespace-collapsed offset mapping (Closed)

Created:
3 years, 6 months ago by Xiaocheng
Modified:
3 years, 5 months ago
Reviewers:
yoichio, kojii, yosin_UTC9, eae
CC:
atotic+reviews_chromium.org, blink-reviews, blink-reviews-layout_chromium.org, cbiesinger, chromium-reviews, dgrogan+ng_chromium.org, eae+blinkwatch, glebl+reviews_chromium.org, jchaffraix+rendering, lchoi+reviews_chromium.org, leviw+renderwatch, ojan+watch_chromium.org, pdr+renderingwatchlist_chromium.org, szager+layoutwatch_chromium.org, zoltan1
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Make NGInlineItemsBuilder construct whitespace-collapsed offset mapping This patch: 1. Introduces the NGOffsetMappingBuilder class with a mock implementation; 2. Allows NGInlineItemsBuilder to report how white spaces are collapsed by taking an addition NGOffsetMappingBuilder parameter, and use it to construct the whitespace-collapsed offset mapping. The way how the NGOffsetMappingBuilder is used is straightforward: whenever |text_| is modified, NGOffsetMappingBuilder should be notified correspondingly. This patch is the part of the project to support DOM/TextContent offset mapping in LayoutNG. Design doc: https://goo.gl/CJbxky BUG=699017 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng Review-Url: https://codereview.chromium.org/2943573002 Cr-Commit-Position: refs/heads/master@{#483192} Committed: https://chromium.googlesource.com/chromium/src/+/1f4be4da171cead27321f786d3b1306fd6bffeb3

Patch Set 1 #

Total comments: 3

Patch Set 2 : Fri Jun 16 16:49:54 PDT 2017 #

Patch Set 3 : Fri Jun 16 16:53:14 PDT 2017 #

Patch Set 4 : Add documentation #

Total comments: 10

Patch Set 5 : Mon Jun 19 14:03:52 PDT 2017 #

Total comments: 6

Patch Set 6 : Wed Jun 21 16:39:01 PDT 2017 #

Patch Set 7 : Wed Jun 21 16:40:35 PDT 2017 #

Total comments: 7

Patch Set 8 : Tue Jun 27 15:21:00 PDT 2017 #

Patch Set 9 : Tue Jun 27 15:22:36 PDT 2017 #

Total comments: 8

Patch Set 10 : Tue Jun 27 20:31:45 PDT 2017 #

Patch Set 11 : Tue Jun 27 20:31:45 PDT 2017 #

Total comments: 4

Patch Set 12 : Add comment to |mapping_| #

Patch Set 13 : Wed Jun 28 11:44:29 PDT 2017 #

Messages

Total messages: 96 (50 generated)
Xiaocheng
How do you like the idea of returning indexes of removed white spaces from NGInlineItemsBuilder? ...
3 years, 6 months ago (2017-06-16 00:09:44 UTC) #9
yosin_UTC9
For implementation wise, I guess final shape of NGInlineItemBuilder is template <typename Purpose> NGInlineItemBuilder { ...
3 years, 6 months ago (2017-06-16 01:39:04 UTC) #10
yoichio
https://codereview.chromium.org/2943573002/diff/1/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h (right): https://codereview.chromium.org/2943573002/diff/1/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h#newcode57 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h:57: // of the collapsed spaces in the appended string. ...
3 years, 6 months ago (2017-06-16 01:47:48 UTC) #11
Xiaocheng
I'm not a fan of storing results in NGInlineItemsBuilder (which is in fact my first ...
3 years, 6 months ago (2017-06-16 01:59:14 UTC) #12
yosin_UTC9
On 2017/06/16 at 01:59:14, xiaochengh wrote: > I'm not a fan of storing results in ...
3 years, 6 months ago (2017-06-16 02:14:14 UTC) #13
Xiaocheng
On 2017/06/16 at 02:14:14, yosin wrote: > On 2017/06/16 at 01:59:14, xiaochengh wrote: > > ...
3 years, 6 months ago (2017-06-16 03:10:11 UTC) #14
kojii
Both points look reasonable to me. In most cases (other than editing or selected) the ...
3 years, 6 months ago (2017-06-16 07:16:05 UTC) #15
Xiaocheng
Updated. PTAL. Thanks to all the comments. The current version has been improved by a ...
3 years, 6 months ago (2017-06-17 00:35:07 UTC) #20
yosin_UTC9
Better than before. I would like to avoid patterns, training_new_line = AppendForceBrake() if (trailing_new_line && ...
3 years, 6 months ago (2017-06-19 03:23:11 UTC) #25
Xiaocheng
Thanks for the review! https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h (right): https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h#newcode91 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h:91: Optional<Vector<unsigned>> input_strings_lengths_; On 2017/06/19 at ...
3 years, 6 months ago (2017-06-19 05:15:51 UTC) #26
Xiaocheng
On 2017/06/19 at 03:23:11, yosin wrote: > Better than before. > I would like to ...
3 years, 6 months ago (2017-06-19 05:18:55 UTC) #27
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h (right): https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h#newcode91 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h:91: Optional<Vector<unsigned>> input_strings_lengths_; On 2017/06/19 at 05:15:51, Xiaocheng wrote: > ...
3 years, 6 months ago (2017-06-19 05:55:13 UTC) #28
kojii
> Do you want to templatize NGInlineItemBuilder? We may want to templatize if the perf ...
3 years, 6 months ago (2017-06-19 05:56:34 UTC) #29
Xiaocheng
https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc (right): https://codereview.chromium.org/2943573002/diff/60001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc#newcode197 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc:197: AddLastTrailingSpaceToRemovedIndexes(i); On 2017/06/19 at 05:56:33, kojii wrote: > Why ...
3 years, 6 months ago (2017-06-19 17:53:01 UTC) #30
Xiaocheng
Patch updated. Regarding the performance impact, I did some experiments with the following benchmark: TEST_F(NGInlineItemsBuilderTest, ...
3 years, 6 months ago (2017-06-19 22:03:27 UTC) #31
yosin_UTC9
On 2017/06/19 at 22:03:27, xiaochengh wrote: > Patch updated. > > Regarding the performance impact, ...
3 years, 6 months ago (2017-06-20 05:38:59 UTC) #36
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc (right): https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc#newcode372 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc:372: void NGInlineItemsBuilder::AddLastTrailingSpaceToRemovedIndexes( nit: %s/RemovedIndexes/CollapsedIndexes/
3 years, 6 months ago (2017-06-20 05:39:09 UTC) #37
Xiaocheng
On 2017/06/20 at 05:38:59, yosin wrote: > On 2017/06/19 at 22:03:27, xiaochengh wrote: > > ...
3 years, 6 months ago (2017-06-20 05:56:46 UTC) #38
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h (right): https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h#newcode107 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h:107: Vector<Vector<unsigned>>* collapsed_indexes_; Could you introduce OffsetMappingBuilder class to hold ...
3 years, 6 months ago (2017-06-21 04:22:42 UTC) #39
kojii
https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc (right): https://codereview.chromium.org/2943573002/diff/80001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc#newcode372 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc:372: void NGInlineItemsBuilder::AddLastTrailingSpaceToRemovedIndexes( This may depend on above, but I ...
3 years, 6 months ago (2017-06-21 09:47:13 UTC) #40
Xiaocheng
Thanks for the review. I think it's better to take an OffsetMappingBuilder as the additional ...
3 years, 6 months ago (2017-06-21 18:15:07 UTC) #41
Xiaocheng
PTAL at Patch 7. I think this version is cleaner. Instead of returning vectors, this ...
3 years, 6 months ago (2017-06-21 23:48:57 UTC) #42
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h (right): https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h#newcode19 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h:19: virtual ~NGOffsetMappingBuilder(); Why interface? Do you want to introduce ...
3 years, 6 months ago (2017-06-22 03:31:05 UTC) #45
Xiaocheng
https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h (right): https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h#newcode19 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h:19: virtual ~NGOffsetMappingBuilder(); On 2017/06/22 at 03:31:04, yosin_UTC9 wrote: > ...
3 years, 6 months ago (2017-06-22 03:36:10 UTC) #46
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h (right): https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h#newcode19 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h:19: virtual ~NGOffsetMappingBuilder(); On 2017/06/22 at 03:36:10, Xiaocheng wrote: > ...
3 years, 6 months ago (2017-06-22 03:44:22 UTC) #47
Xiaocheng
On 2017/06/22 at 03:44:22, yosin wrote: > https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h > File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h (right): > > https://codereview.chromium.org/2943573002/diff/120001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.h#newcode19 ...
3 years, 6 months ago (2017-06-22 03:50:07 UTC) #48
kojii
Sorry, this is even harder to understand than before. What is "bijection"? Please use more ...
3 years, 6 months ago (2017-06-22 05:01:39 UTC) #49
Xiaocheng
On 2017/06/22 at 05:01:39, kojii wrote: > Sorry, this is even harder to understand than ...
3 years, 6 months ago (2017-06-22 06:02:10 UTC) #52
kojii
On 2017/06/22 at 06:02:10, xiaochengh wrote: > On 2017/06/22 at 05:01:39, kojii wrote: > > ...
3 years, 6 months ago (2017-06-22 07:00:31 UTC) #53
yosin_UTC9
On 2017/06/22 at 03:50:07, xiaochengh wrote: > On 2017/06/22 at 03:44:22, yosin wrote: > > ...
3 years, 6 months ago (2017-06-22 07:01:22 UTC) #54
Xiaocheng
On 2017/06/22 at 07:01:22, yosin wrote: > On 2017/06/22 at 03:50:07, xiaochengh wrote: > > ...
3 years, 6 months ago (2017-06-22 07:10:25 UTC) #55
Xiaocheng
On 2017/06/22 at 07:00:31, kojii wrote: > On 2017/06/22 at 06:02:10, xiaochengh wrote: > > ...
3 years, 6 months ago (2017-06-22 07:12:47 UTC) #56
Xiaocheng
Sorry for my mistake of rushing too hard. We've got quite some good new ideas ...
3 years, 6 months ago (2017-06-22 07:14:34 UTC) #57
kojii
ok, look forward to updates. Please keep in mind, NGInlineItemsBuilder is not really final. I'll ...
3 years, 6 months ago (2017-06-22 07:53:15 UTC) #58
yosin_UTC9
On 2017/06/22 at 07:53:15, kojii wrote: > ok, look forward to updates. > > Please ...
3 years, 6 months ago (2017-06-22 07:55:48 UTC) #59
kojii
On 2017/06/22 at 07:53:15, kojii wrote: > Please keep in mind, NGInlineItemsBuilder is not really ...
3 years, 5 months ago (2017-06-26 03:35:22 UTC) #60
Xiaocheng
On 2017/06/26 at 03:35:22, kojii wrote: > On 2017/06/22 at 07:53:15, kojii wrote: > > ...
3 years, 5 months ago (2017-06-26 05:09:37 UTC) #61
Xiaocheng
Patch updated following the updated design doc. I also did the same benchmark before, and ...
3 years, 5 months ago (2017-06-27 22:33:00 UTC) #63
yosin_UTC9
On 2017/06/27 at 22:33:00, xiaochengh wrote: > Patch updated following the updated design doc. > ...
3 years, 5 months ago (2017-06-28 01:40:08 UTC) #64
yosin_UTC9
https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc (right): https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc#newcode16 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc:16: DCHECK_GT(length, 0u); Please add |DCHECK(!mapping_.IsEmpty())| for |mapping_.back()| https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc#newcode25 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc:25: ...
3 years, 5 months ago (2017-06-28 01:44:21 UTC) #65
Xiaocheng
https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc File third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc (right): https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc#newcode197 third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc:197: mapping_builder_->AppendIdentityMapping(end_of_non_space - i); On 2017/06/28 at 01:44:21, yosin_UTC9 wrote: ...
3 years, 5 months ago (2017-06-28 02:05:20 UTC) #66
Xiaocheng
Updated. NGInlineItemsBuilder is templatized in a preparation patch. https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc File third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc (right): https://codereview.chromium.org/2943573002/diff/160001/third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc#newcode16 third_party/WebKit/Source/core/layout/ng/api/ng_offset_mapping_builder.cc:16: DCHECK_GT(length, ...
3 years, 5 months ago (2017-06-28 03:34:05 UTC) #67
kojii
lgtm w/nits https://codereview.chromium.org/2943573002/diff/190001/third_party/WebKit/Source/core/layout/BUILD.gn File third_party/WebKit/Source/core/layout/BUILD.gn (right): https://codereview.chromium.org/2943573002/diff/190001/third_party/WebKit/Source/core/layout/BUILD.gn#newcode330 third_party/WebKit/Source/core/layout/BUILD.gn:330: "ng/api/ng_offset_mapping_builder.h", Can you please put them into ...
3 years, 5 months ago (2017-06-28 07:45:50 UTC) #76
Xiaocheng
Thanks for reviewing! https://codereview.chromium.org/2943573002/diff/190001/third_party/WebKit/Source/core/layout/BUILD.gn File third_party/WebKit/Source/core/layout/BUILD.gn (right): https://codereview.chromium.org/2943573002/diff/190001/third_party/WebKit/Source/core/layout/BUILD.gn#newcode330 third_party/WebKit/Source/core/layout/BUILD.gn:330: "ng/api/ng_offset_mapping_builder.h", On 2017/06/28 at 07:45:50, kojii ...
3 years, 5 months ago (2017-06-28 18:21:58 UTC) #77
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2943573002/230001
3 years, 5 months ago (2017-06-28 23:18:25 UTC) #91
commit-bot: I haz the power
3 years, 5 months ago (2017-06-28 23:32:54 UTC) #96
Message was sent while issue was closed.
Committed patchset #13 (id:230001) as
https://chromium.googlesource.com/chromium/src/+/1f4be4da171cead27321f786d3b1...

Powered by Google App Engine
This is Rietveld 408576698