New issue
Advanced search Search tips

Issue 699017 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocked on:
issue 750990
issue 776272
issue 776843
issue 876150

Blocking:
issue 707656
issue 708452


Participants' hotlists:
layoutng


Sign in to add a comment

Add support for mapping between DOM and Logical position to NGLayoutInputNode

Project Member Reported by e...@chromium.org, Mar 7 2017

Issue description

Add a method to map from DOM position to Logical position and the other way around to NGLayoutInputNode. This can either be computed during the PrepareLayout() step or be computed lazily.

Editing, selections and hit testing all require a way to map between the two.
 

Comment 1 by kojii@chromium.org, Mar 8 2017

Cc: -kojii@chromium.org yoichio@chromium.org yosin@chromium.org kyosin@chromium.org
Components: Blink>Layout

Comment 2 by kojii@chromium.org, Mar 8 2017

Cc: -kyosin@chromium.org kojii@chromium.org
Cc: xiaoche...@chromium.org
Owner: yoichio@chromium.org
yoichio owns DOM->Logical part.
Blocking: 708452
Labels: -Pri-3 Pri-1
Owner: xiaoche...@chromium.org
Status: Assigned (was: Available)
I'm taking it according to the current assignment.
Project Member

Comment 7 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1bc92de1145d6d9afe97605bd39808b547bd1ae8

commit 1bc92de1145d6d9afe97605bd39808b547bd1ae8
Author: xiaochengh <xiaochengh@chromium.org>
Date: Wed Jun 28 21:25:39 2017

Templatize NGInlineItemsBuilder to take a OffsetMappingBuilder parameter

This patch templatizes NGInlineItemsBuilder with an additional parameter
OffsetMappingBuilder, but does not do anything with the new parameter, and
hence, does not introduce any new behavior yet.

A follow-up patch (*) will pass in a real offset mapping builder, and make
NGInlineItemsBuilder also construct the whitespace-collapsed offset mapping
with the passed-in builder.

Design doc of offset mapping: https://goo.gl/CJbxky

* crrev.com/2943573002

BUG=699017
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng

Review-Url: https://codereview.chromium.org/2960673004
Cr-Commit-Position: refs/heads/master@{#483145}

[modify] https://crrev.com/1bc92de1145d6d9afe97605bd39808b547bd1ae8/third_party/WebKit/Source/core/layout/BUILD.gn
[add] https://crrev.com/1bc92de1145d6d9afe97605bd39808b547bd1ae8/third_party/WebKit/Source/core/layout/ng/inline/empty_offset_mapping_builder.h
[modify] https://crrev.com/1bc92de1145d6d9afe97605bd39808b547bd1ae8/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/1bc92de1145d6d9afe97605bd39808b547bd1ae8/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
[modify] https://crrev.com/1bc92de1145d6d9afe97605bd39808b547bd1ae8/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h

Project Member

Comment 8 by bugdroid1@chromium.org, Jun 28 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f4be4da171cead27321f786d3b1306fd6bffeb3

commit 1f4be4da171cead27321f786d3b1306fd6bffeb3
Author: xiaochengh <xiaochengh@chromium.org>
Date: Wed Jun 28 23:32:37 2017

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}

[modify] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/BUILD.gn
[modify] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/empty_offset_mapping_builder.h
[modify] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
[modify] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder_test.cc
[add] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[add] https://crrev.com/1f4be4da171cead27321f786d3b1306fd6bffeb3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h

Project Member

Comment 9 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8cbc86dacc8e15bddeb0bae234ebb00fcc7550af

commit 8cbc86dacc8e15bddeb0bae234ebb00fcc7550af
Author: xiaochengh <xiaochengh@chromium.org>
Date: Fri Jun 30 01:46:34 2017

Refactor NGInlineNode::CollectInlines (both overloads)

This patch does the following refactoring:

1. Remove the parameter NGInlineNode::CollectInlines(LayoutBlockFlow*) because
it is always equal to GetLayoutBlockFlow().

2. Change NGInlineNode::CollectInlines(LayoutBlockFlow*, NGInlineItemsBuilder*)
to a local function of the .cc file, because it does not access any private
member of NGInlineNode.

3. Move call sites of NGInlineItemsBuilder::EnterBlock and ExitBlock into the
above local function, so that it is easier to reuse this function to build
offset mapping.

Step 3 is a preparation for crrev.com/2963093002

BUG=699017
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng

Review-Url: https://codereview.chromium.org/2965573003
Cr-Commit-Position: refs/heads/master@{#483585}

[modify] https://crrev.com/8cbc86dacc8e15bddeb0bae234ebb00fcc7550af/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/8cbc86dacc8e15bddeb0bae234ebb00fcc7550af/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/8cbc86dacc8e15bddeb0bae234ebb00fcc7550af/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_test.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Jun 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cd18a26eb800d22aa951c00f42f67d98db3c8b15

commit cd18a26eb800d22aa951c00f42f67d98db3c8b15
Author: xiaochengh <xiaochengh@chromium.org>
Date: Fri Jun 30 21:25:41 2017

Move CollectInlinesInternal to anonymous namespace

This is a follow-up patch of crrev.com/2965573003, moving the local function
to the anonymous namespace.

BUG=699017
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng

Review-Url: https://codereview.chromium.org/2962243002
Cr-Commit-Position: refs/heads/master@{#483828}

[modify] https://crrev.com/cd18a26eb800d22aa951c00f42f67d98db3c8b15/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc

Project Member

Comment 11 by bugdroid1@chromium.org, Jul 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/13b1999a87a545bcab93d66a2294758c3125a84b

commit 13b1999a87a545bcab93d66a2294758c3125a84b
Author: xiaochengh <xiaochengh@chromium.org>
Date: Tue Jul 18 15:59:15 2017

Add full offset mapping construction in a block

This CL constructs the DOM-to-TextContent offset mapping of a block. It adds
the following API:

NGOffsetMappingResult NGInlineNode::BuildOffsetMapping() const;

See ng_offset_mapping_result.h for information about NGOffsetMappingResult.
See ng_inline_node_offset_mapping_test.cc for examples.

Note 1: The patch can be made cleaner if we do not write whitespace-collapsed
strings back to LayoutText after layout.

Note 2: The built offset mapping is wrong when text-transform expands/removes
characters (e.g., ß => SS)

BUG=699017
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_layout_ng

Review-Url: https://codereview.chromium.org/2963093002
Cr-Commit-Position: refs/heads/master@{#487489}

[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/BUILD.gn
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/LayoutTextFragment.h
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/empty_offset_mapping_builder.h
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[add] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h
[add] https://crrev.com/13b1999a87a545bcab93d66a2294758c3125a84b/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 12 by bugdroid1@chromium.org, Jul 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/af92c06d930d355d3335766fd34863950fcfa8dc

commit af92c06d930d355d3335766fd34863950fcfa8dc
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Jul 21 00:56:59 2017

Store NGOffsetMappingResult in NGInlineNodeData after computed

This patch makes NGInlineNodeData store the offset mapping result when
it is computed. In this way, recomputation is avoided if we need to
reuse the offset mapping.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I01811b7cf8f98b350cb1e3ff7d91fc8e418b77f6
Reviewed-on: https://chromium-review.googlesource.com/577991
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488523}
[modify] https://crrev.com/af92c06d930d355d3335766fd34863950fcfa8dc/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/af92c06d930d355d3335766fd34863950fcfa8dc/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/af92c06d930d355d3335766fd34863950fcfa8dc/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_data.h
[modify] https://crrev.com/af92c06d930d355d3335766fd34863950fcfa8dc/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/af92c06d930d355d3335766fd34863950fcfa8dc/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 13 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/23bf93166433b2adb7257cc4aa78c06bc06f22e3

commit 23bf93166433b2adb7257cc4aa78c06bc06f22e3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jul 26 02:19:59 2017

Add APIs for DOM to text content offset mapping

This patch adds APIs to NGInlineNode that maps DOM offsets to
text content offsets.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0485cb7cda938868dc03638807b5fe4bace08100
Reviewed-on: https://chromium-review.googlesource.com/580523
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489532}
[modify] https://crrev.com/23bf93166433b2adb7257cc4aa78c06bc06f22e3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/23bf93166433b2adb7257cc4aa78c06bc06f22e3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/23bf93166433b2adb7257cc4aa78c06bc06f22e3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2175b3cceb70f8c09d958e3acac90220d3dfafd2

commit 2175b3cceb70f8c09d958e3acac90220d3dfafd2
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jul 26 02:39:16 2017

Change NGOffsetMappingUnit into a class

This patch changes NGOffsetMappingUnit into a class, so that follow-up
patches can add member functions to the class.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ic5a8790ade108ad2da8a7a25fa5a85a0e66d769e
Reviewed-on: https://chromium-review.googlesource.com/585236
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489535}
[modify] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/BUILD.gn
[modify] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[add] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/2175b3cceb70f8c09d958e3acac90220d3dfafd2/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 15 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/25d94996a601cebc16d479bb06c09f4a28da6090

commit 25d94996a601cebc16d479bb06c09f4a28da6090
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jul 26 09:44:46 2017

Change NGOffsetMappingResult into a class

This patch changes the above mentioned struct into a class, so that
follow up patches can add member functions to it.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I3388a9c9ec832ba8ceb5a698cac525e5195ed856
Reviewed-on: https://chromium-review.googlesource.com/585656
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489587}
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/25d94996a601cebc16d479bb06c09f4a28da6090/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71c279d81345a740e9424edfc41b6fecb89dbf55

commit 71c279d81345a740e9424edfc41b6fecb89dbf55
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jul 26 09:54:20 2017

Wrap code into member functions of NGOffsetMappingUnit/Result

This function wraps existing code into member functions of the two
classes to improve code health. A follow up patch will move the function
bodies to the correct .cc file.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I34f70df13fc91a48e8e2319d07129692e38096a2
Reviewed-on: https://chromium-review.googlesource.com/585900
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489595}
[modify] https://crrev.com/71c279d81345a740e9424edfc41b6fecb89dbf55/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/71c279d81345a740e9424edfc41b6fecb89dbf55/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 17 by bugdroid1@chromium.org, Jul 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5c0f68c5eb016daf56aea791c6ac5f2ac805c8f3

commit 5c0f68c5eb016daf56aea791c6ac5f2ac805c8f3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Jul 26 11:02:26 2017

Move function bodies to ng_offset_mapping_result.cc

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1911243a6f465e84f559992951568ee7cbc1ce0b
Reviewed-on: https://chromium-review.googlesource.com/585901
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#489606}
[modify] https://crrev.com/5c0f68c5eb016daf56aea791c6ac5f2ac805c8f3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/5c0f68c5eb016daf56aea791c6ac5f2ac805c8f3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc

Blockedon: 750990
Project Member

Comment 19 by bugdroid1@chromium.org, Aug 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82751285d359e522d4ed491193721e334228e1f0

commit 82751285d359e522d4ed491193721e334228e1f0
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Aug 04 22:21:49 2017

Fix offset mapping construction for ::first-letter without remaining text

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4fe296c867e0553f8ebbc453bf458dde57630bd5
Reviewed-on: https://chromium-review.googlesource.com/601445
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492144}
[modify] https://crrev.com/82751285d359e522d4ed491193721e334228e1f0/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/82751285d359e522d4ed491193721e334228e1f0/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc

Project Member

Comment 20 by bugdroid1@chromium.org, Aug 5 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cdd15784955039742fe9a8235581922d41b82d78

commit cdd15784955039742fe9a8235581922d41b82d78
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Sat Aug 05 13:49:34 2017

Fix offset mapping APIs for the case ::first-letter is in another block

Offset mapping APIs used to assume that a text node can only be laid out
in a single block, which is incorrect if ::first-letter is positioned.

This patch fixes the issue by adding an offset parameter to
GetNGInlineNodeFor(), so that different inline nodes can be returned for
different offsets in the same text node.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ib21f43ed5a1fbe94f94e3e69efabb27a0b72a51c
Reviewed-on: https://chromium-review.googlesource.com/602743
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492239}
[modify] https://crrev.com/cdd15784955039742fe9a8235581922d41b82d78/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/cdd15784955039742fe9a8235581922d41b82d78/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/cdd15784955039742fe9a8235581922d41b82d78/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc

Project Member

Comment 21 by bugdroid1@chromium.org, Aug 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f7e67e13155b9b4a63c9bf1f7979bd7b1e2b3f07

commit f7e67e13155b9b4a63c9bf1f7979bd7b1e2b3f07
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Aug 09 06:30:48 2017

Simplify ::first-letter handling in offset mapping construction

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I12d434be7de901948047f0b547245dbe01ab7fc6
Reviewed-on: https://chromium-review.googlesource.com/606671
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492856}
[modify] https://crrev.com/f7e67e13155b9b4a63c9bf1f7979bd7b1e2b3f07/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc

Project Member

Comment 22 by bugdroid1@chromium.org, Aug 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/95a9122661c5e4598da31fc1c0700327c14e278b

commit 95a9122661c5e4598da31fc1c0700327c14e278b
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Aug 10 05:29:38 2017

TextIterator NG

This patch reimplements TextIteratorTextNodeHandler on top of the NG offset mapping
APIs to make TextIterator work with Layout NG.

Most critical changes are in TextIteratorTextNodeHandler.cpp, which gives a new and clean
implementation of the class. Other changes are rebaseline of layout tests and changes to
test expectations.

New failure due to LayoutText writeback:
- editing/text-iterator/findString-restarts-at-last-position.html
- editing/pasteboard/19644-1.html
- editing/pasteboard/19644-2.html
- virtual/layout_ng/fast/block/float/overhanging-float-crashes-when-sibling-becomes-formatting-context.html
- minimal repro: https://jsfiddle.net/767q3cbc/.
  There should be a trailing space in |container.innerText|, which is missing when LayoutNG
  is enabled

New failures due to lack of support for rect-related APIs:
- accessibility/selection-affinity.html
- fast/multicol/float-truncation.html
- fast/multicol/vertical-lr/float-truncation.html

Some new failures are due to irrelevant bugs in layout test framework.

Other tests are rebaselined.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8670c1d879437a36788c6ff50d83c7609cf08e79
Reviewed-on: https://chromium-review.googlesource.com/580371
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#493273}
[modify] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/FlagExpectations/enable-blink-features=LayoutNG
[modify] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/TestExpectations
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/accessibility/draw-focus-if-needed-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/accessibility/image-map2-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/draws-content/canvas-background-layer-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/draws-content/webgl-background-layer-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/gestures/gesture-tapHighlight-pixel-rotated-link-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/overflow/iframe-scroll-children-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/compositing/webgl/webgl-copy-image-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/button-right-click-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/editing/selection/selection-in-iframe-removed-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/animation/request-animation-frame-detach-element-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/animation/request-animation-frame-detach-element2-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/float/trailing-float-layout-2-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/block/skip-cleaning-up-anonymous-wrappers-when-subtree-being-destroyed-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/borders/extreme-outline-offset-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-intrinsic-dimensions/css-tables-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-intrinsic-dimensions/fit-content-container-with-replaced-child-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-intrinsic-dimensions/intrinsic-sized-blocks-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css-intrinsic-dimensions/tables-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/containment/inline-contain-layout-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/css/display-inline-block-scrollbar-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/deprecated-flexbox/crash-flexbox-no-layout-child-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/Document/xml-document-focus-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-1x-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-in-template-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-invalid-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-nested-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-dynamic-changes-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-src-and-srcset-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/HTMLImageElement/image-picture-source-src-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/nodesFromRect/nodesFromRect-continuation-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/shadow/event-path-for-user-agent-shadow-tree-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/dom/window-load-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/encoding/bracket-in-tag-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/input-element-attach-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/forms/text/textfield-inside-anchor-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/reparented-iframe-cleared-contentWindow-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/frames/unique-name-set-same-name-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/gradients/unprefixed-repeating-gradient-color-hint-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/html/layout-runs-and-floats-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline-block/vertical-align-top-and-bottom-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/inline/inline-offsetLeft-continuation-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/js/text-field-resize-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/image-map-alt-content-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/replaced/render-inline-cast-to-render-box-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/ruby/split-ruby-run-percentage-height-descendant-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-div-in-anchor-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-fully-aligned-horizontally-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-imagemap-area-not-focusable-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-imagemap-area-without-image-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-imagemap-overlapped-areas-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-imagemap-simple-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/spatial-navigation/snav-zero-margin-content-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/table/convert-inline-anonoymous-wrapper-to-block-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/font-linux-normalize-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/text/line-break-between-text-nodes-with-inline-blocks-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xpath/preceding-axis-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fast/xpath/union-context-node-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/fullscreen/full-screen-line-boxes-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/cache/cached-main-resource-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/cache/iframe-304-crash-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/loading/nested_bad_objects-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/loading/preload-picture-nested-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/loading/preload-picture-sizes-2x-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/loading/preload-picture-sizes-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/http/tests/misc/recreate-location-after-detach-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/color-profile-background-image-cross-fade-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/color-profile-background-image-cross-fade-png-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/color-profile-munsell-adobe-to-srgb-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/color-profile-munsell-srgb-to-srgb-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/crash-bad-cast-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/images/imagemap-nested-area-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/inspector/elements/styles-2/add-import-rule-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/inspector/layers/layer-sticky-position-constraint-get-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/obscured-background-no-repaint-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/paint/invalidation/remove-subframe-composited-nonstacking-ancestor-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/printing/webgl-repeated-printing-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/printing/webgl-repeated-printing-preservedrawingbuffer-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/svg/animations/multiple-begin-animation-events-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/traversal/tree-walker-001-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/traversal/tree-walker-002-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/traversal/tree-walker-005-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/flag-specific/enable-blink-features=LayoutNG/virtual/without-smil/svg/animations/exposed/effect-expected.txt
[add] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/LayoutTests/virtual/layout_ng/fast/block/float/trailing-float-layout-2-expected.txt
[modify] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/95a9122661c5e4598da31fc1c0700327c14e278b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.h

Project Member

Comment 23 by bugdroid1@chromium.org, Sep 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d984dce70f72490f5b28f408eb8bcbe6fbccd508

commit d984dce70f72490f5b28f408eb8bcbe6fbccd508
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Sat Sep 09 19:55:26 2017

[LayoutNG] Store Node instead of LayoutText in mapping result

This patch simplifies NGOffsetMappingResult, and make it closer to the design
doc by changing it to store Node instead of LayoutText. After this patch, the
mess related to the mapping between LayoutText and Node is limited to the
construction phase of offset mapping.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ia0e6f35e35faba343e043af910acd7320228b9fd
Reviewed-on: https://chromium-review.googlesource.com/658605
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500801}
[modify] https://crrev.com/d984dce70f72490f5b28f408eb8bcbe6fbccd508/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/d984dce70f72490f5b28f408eb8bcbe6fbccd508/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/d984dce70f72490f5b28f408eb8bcbe6fbccd508/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/d984dce70f72490f5b28f408eb8bcbe6fbccd508/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/d984dce70f72490f5b28f408eb8bcbe6fbccd508/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 24 by bugdroid1@chromium.org, Sep 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd

commit f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Sep 11 03:28:46 2017

[LayoutNG] Introduce a range-to-range offset mapping API

This patch adds a new offset mapping API, GetMappingUnitsForDOMOffsetRange,
which maps a DOM offset range to a text content offset range in the form of
a sorted sequence of offset mapping units. The API is useful when we need to
map a range of consecutive offsets.

A follow-up patch will utilize the API in TextIterator NG: crrev.com/c/659339/

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ie03158efbbf4638a51f026689c9868c4636cb85e
Reviewed-on: https://chromium-review.googlesource.com/659319
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500832}
[modify] https://crrev.com/f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/f0e39bff7b7e18b5d3ecb2d3d08974ee359019bd/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 25 by bugdroid1@chromium.org, Sep 11 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c87813224eb049e9d2bcbf9c7b6d55a10d8025a8

commit c87813224eb049e9d2bcbf9c7b6d55a10d8025a8
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Sep 11 08:46:43 2017

Apply the range-to-range offset mapping API in TextIterator NG

This patch reimplements TextIterator's NG text node handler on top of the
range-to-range offset mapping API to make it more efficient and intuitive.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ibcde49554d87ad289abc7904d1ef8dab853949dd
Reviewed-on: https://chromium-review.googlesource.com/659339
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500864}
[modify] https://crrev.com/c87813224eb049e9d2bcbf9c7b6d55a10d8025a8/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp

Project Member

Comment 26 by bugdroid1@chromium.org, Oct 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8b05cb280a8de6cfcd089dae1282d06a77e435b7

commit 8b05cb280a8de6cfcd089dae1282d06a77e435b7
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 10 20:06:32 2017

[LayoutNG] Expose NGOffsetMappingResult from NGInlineNode

This patch exposes NGOffsetMappingResult from NGInlineNode to reduce
unnecessary wrapping and simplify the layering.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0e733dd47f8f0f69c58bacb9a3c7d68b613e61f5
Reviewed-on: https://chromium-review.googlesource.com/708516
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507748}
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_data.cc
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/8b05cb280a8de6cfcd089dae1282d06a77e435b7/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 27 by bugdroid1@chromium.org, Oct 12 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e14219c4615286901cbe3ea9e45e3e022220b3a5

commit e14219c4615286901cbe3ea9e45e3e022220b3a5
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Oct 12 05:27:05 2017

[LayoutNG] Remove "concatenated mapping" from mapping construction

The existing offset mapping construction algorithm maintains a "concatenated
mapping", which is reserved for supporting text-transform in offset mapping.

However, as we are not supporting text-transform in near future, maintaining
an additional mapping adds a lot of code complexity, and confuses other
developers.

Hence, this patch removes the concatenated mapping for simplicity.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I7a36d6853561d3aa1bae19cc3e43773aebc553b5
Reviewed-on: https://chromium-review.googlesource.com/714517
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508260}
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/empty_offset_mapping_builder.h
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/e14219c4615286901cbe3ea9e45e3e022220b3a5/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h

Comment 28 by e...@chromium.org, Oct 18 2017

Labels: -Pri-1 Pri-2
Blocking: 707656
Blockedon: 776272
Project Member

Comment 31 by bugdroid1@chromium.org, Oct 19 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3

commit fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Oct 19 18:09:01 2017

Rename NGOffsetMappingResult::IsNonCollapsedCharacter to IsBeforeNonCollapsedCharacter

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0ad635a08ffed1fdca4e370a320e12854e2ef227
Reviewed-on: https://chromium-review.googlesource.com/727406
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510140}
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/fb336c787e5e91d43b51bc95cd0fc5f5ff899ff3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 32 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6e772f6a798862c855ef699e1ec6df03a7cc61e0

commit 6e772f6a798862c855ef699e1ec6df03a7cc61e0
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Oct 20 01:05:40 2017

[LayoutNG] Change return type of {StartOfNext,EndOfLast}NonCollapsedCharacter to Optional<>

This patch changes the return type of the above two functions to
Optional<>, so that they stop using magic numbers to indicate inexistent
results.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I2dfc620c559b5f0043bf859118d0f0dccaada5fd
Reviewed-on: https://chromium-review.googlesource.com/728729
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510283}
[modify] https://crrev.com/6e772f6a798862c855ef699e1ec6df03a7cc61e0/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/6e772f6a798862c855ef699e1ec6df03a7cc61e0/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/6e772f6a798862c855ef699e1ec6df03a7cc61e0/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/6e772f6a798862c855ef699e1ec6df03a7cc61e0/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/6e772f6a798862c855ef699e1ec6df03a7cc61e0/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Blockedon: 776843
Project Member

Comment 34 by bugdroid1@chromium.org, Oct 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42326dc3128c99dc8a13a8111a09d764459147ba

commit 42326dc3128c99dc8a13a8111a09d764459147ba
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Oct 20 21:42:24 2017

Remove an unused member from NGInlineItemsBuilder

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I04e59e74fc450186b0e37659f017bf4673c1c1c9
Reviewed-on: https://chromium-review.googlesource.com/731265
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510571}
[modify] https://crrev.com/42326dc3128c99dc8a13a8111a09d764459147ba/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h

Project Member

Comment 35 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f

commit 494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 24 15:27:46 2017

[LayoutNG] Change return type of GetTextContentOffset to Optional<>

This patch changes NGOffsetMappingResult::GetTextContentOffset to return
Optional<>, so that it can use nullopt to indicate inexistent result,
instead of using the magic number kNotFound.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I955392c99ad7eb167bea86bee6c0c0f09911e622
Reviewed-on: https://chromium-review.googlesource.com/731110
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511157}
[modify] https://crrev.com/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc
[modify] https://crrev.com/494bd0e2000d0bdfcaf8f4c3a8aec3780c347e0f/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Project Member

Comment 36 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ac882be15176d745bc9387bbe816b29b6cddd256

commit ac882be15176d745bc9387bbe816b29b6cddd256
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 24 17:04:22 2017

Rename NGInlineNodeOffsetMappingTest to NGOffsetMappingTest

This patch does the renaming to better cope with the fact that offset
mapping APIs no longer reside in NGInlineNode.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Id733db5d4c3b70764635dfbd43ab032547816bc6
Reviewed-on: https://chromium-review.googlesource.com/734136
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511184}
[modify] https://crrev.com/ac882be15176d745bc9387bbe816b29b6cddd256/third_party/WebKit/Source/core/BUILD.gn
[modify] https://crrev.com/ac882be15176d745bc9387bbe816b29b6cddd256/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_data.h
[rename] https://crrev.com/ac882be15176d745bc9387bbe816b29b6cddd256/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 37 by bugdroid1@chromium.org, Oct 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c7743fbd8a527cdd035517b2aff0b45fa5597ee6

commit c7743fbd8a527cdd035517b2aff0b45fa5597ee6
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 24 19:08:59 2017

Return WTF::nullopt instead of {} in NGOffsetMappingResult

This patch makes the change for better clarity.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4f7625dd148bf2b1fcb0a4f48c69855bc71dce17
Reviewed-on: https://chromium-review.googlesource.com/734131
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511225}
[modify] https://crrev.com/c7743fbd8a527cdd035517b2aff0b45fa5597ee6/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.cc

Project Member

Comment 38 by bugdroid1@chromium.org, Oct 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac

commit e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Oct 25 09:54:40 2017

[LayoutNG] Rename NGOffsetMappingResult to NGOffsetMapping

The word "result" doesn't add any clarity to NGOffsetMappingResult, but
only makes its name longer and more confusing. Hence, this patch removes
it from the class name.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ib27543da192bc0195abdb710a2987f69e9dbe081
Reviewed-on: https://chromium-review.googlesource.com/736319
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511409}
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/BUILD.gn
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_data.cc
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_data.h
[rename] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[rename] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h
[modify] https://crrev.com/e0b9229a6287b6a7a1b1ccd6fbdf9ee774ddd9ac/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 39 by bugdroid1@chromium.org, Oct 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/896aab1971cb86907e97ea09726b3872fbfde09a

commit 896aab1971cb86907e97ea09726b3872fbfde09a
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Oct 25 22:23:42 2017

[LayoutNG] Make offset mapping APIs free of NGInlineNode

We used to obtain the offset mapping object from NGInlineNode because it is
owned there, which, however, is not the most efficient design.

This patch moves the API entrance to GetNGOffsetMappingFor(node, offset) so
that API users no longer need to make a detour to NGInlineNode.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I8fa3187883b7d52ca89eb0abea9f5e6d005e739b
Reviewed-on: https://chromium-review.googlesource.com/737278
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511615}
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.h
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/896aab1971cb86907e97ea09726b3872fbfde09a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 40 by bugdroid1@chromium.org, Oct 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/25026abe389147fec23d92830232c3ca9068665a

commit 25026abe389147fec23d92830232c3ca9068665a
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Oct 25 22:44:50 2017

[LayoutNG] Add APIs to map text offsets back to DOM positions

This patch adds API that maps offsets in the |text_content_| string of
NGInlineNodeData back to DOM positions. Since the mapping from DOM to
|text_content_| offset is many-to-one, this patch adds two APIs that return
the first and last DOM positions, respectively.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Idd8fb899cb7cf53ea35ed84cf84cfaca703dbc5c
Reviewed-on: https://chromium-review.googlesource.com/732323
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511624}
[modify] https://crrev.com/25026abe389147fec23d92830232c3ca9068665a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/25026abe389147fec23d92830232c3ca9068665a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/25026abe389147fec23d92830232c3ca9068665a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 41 by bugdroid1@chromium.org, Oct 26 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0fc4f70e27c755effd3d9ef861d7b4604d83a182

commit 0fc4f70e27c755effd3d9ef861d7b4604d83a182
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Oct 26 19:02:52 2017

[LayoutNG] Change NGOffsetMapping::GetFor to take Position

This patch changes the API to take Position parameters to better support
mapping non-text anchored positions to LayoutNG canonical text.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4757c731cbbba563f577dfaf9f302b711ede1c30
Reviewed-on: https://chromium-review.googlesource.com/737523
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#511904}
[modify] https://crrev.com/0fc4f70e27c755effd3d9ef861d7b4604d83a182/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/0fc4f70e27c755effd3d9ef861d7b4604d83a182/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/0fc4f70e27c755effd3d9ef861d7b4604d83a182/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/0fc4f70e27c755effd3d9ef861d7b4604d83a182/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/0fc4f70e27c755effd3d9ef861d7b4604d83a182/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 42 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bb5489be954d5c313223395c7e9a2744cc809898

commit bb5489be954d5c313223395c7e9a2744cc809898
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Oct 27 02:05:38 2017

[LayoutNG] Change NGOffsetMapping::GetTextContentOffset() to take Position

This patch changes the API to take Position parameters to better support
mapping non-text anchored positions to LayoutNG canonical text.

To better cope with the modified API, this patch also adds a helper method
LayoutText::PositionForCaretOffset() to rewrite ResolvedTextLength(), the
call site of GetTextContentOffset().

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ia3846a509eaed5f63770b0853a8bcef0d9948de4
Reviewed-on: https://chromium-review.googlesource.com/738832
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512063}
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/LayoutTextFragment.h
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/bb5489be954d5c313223395c7e9a2744cc809898/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 43 by bugdroid1@chromium.org, Oct 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/920bdc038a677bd4d6e8f46f03c4829f484dcd7f

commit 920bdc038a677bd4d6e8f46f03c4829f484dcd7f
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Oct 27 02:33:54 2017

[LayoutNG] Ensure single entrance to NGOffsetMapping objects

We currently have two entrances to NGOffsetMapping:
- (1) NGOffsetMapping::GetFor()
- (2) LayoutText::GetNGOffsetMapping().

This patch makes (2) get the mapping object from (1) instead to unify the code
paths.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I1582344c76bad3e6b9786ef97cbc0d3485f03a37
Reviewed-on: https://chromium-review.googlesource.com/738495
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512066}
[modify] https://crrev.com/920bdc038a677bd4d6e8f46f03c4829f484dcd7f/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/920bdc038a677bd4d6e8f46f03c4829f484dcd7f/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/920bdc038a677bd4d6e8f46f03c4829f484dcd7f/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/920bdc038a677bd4d6e8f46f03c4829f484dcd7f/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/920bdc038a677bd4d6e8f46f03c4829f484dcd7f/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 44 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c

commit e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 31 20:00:21 2017

[LayoutNG] Change Start/EndOfNext/LastNonCollapsedCharacter to take Position

This patch changes the APIs to take Position parameters to better support
mapping non-text anchored positions to LayoutNG canonical text.

To better cope with the modified APIs, this patch also adds a helper method
LayoutText::CaretOffsetForPosition() for converting Position back to caret
offset. It also helps consolidating overrides of CaretMin/MaxOffset in
LayoutTextFragment, by overriding CaretOffsetForPosition() instead.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iff7e4e3388e70e8ee7d8412f7d62a829ebc9efb7
Reviewed-on: https://chromium-review.googlesource.com/740702
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512923}
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/LayoutTextFragment.h
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/e38e621b9b51b905ef1a0f2bf9ba4b2d77df857c/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 45 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/825338de106e0d0b2cc3c67065877d9af7f0db73

commit 825338de106e0d0b2cc3c67065877d9af7f0db73
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 31 20:17:52 2017

[LayoutNG] Convert GetMappingUnitForDOMOffset to take Position

This patch changes the API to take Position parameter to better support
mapping non-text anchored positions to LayoutNG canonical text.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I450ce5a7b27e246862df3ed6e94d09eba765884c
Reviewed-on: https://chromium-review.googlesource.com/742148
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512930}
[modify] https://crrev.com/825338de106e0d0b2cc3c67065877d9af7f0db73/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/825338de106e0d0b2cc3c67065877d9af7f0db73/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/825338de106e0d0b2cc3c67065877d9af7f0db73/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 46 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b040b5139be0348af9e481fd81f03658c01a9d06

commit b040b5139be0348af9e481fd81f03658c01a9d06
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 31 21:21:31 2017

[LayoutNG] Convert some offset mapping APIs to take Position

This patch changes three APIs to take Position parameters to better support
mapping non-text anchored positions to LayoutNG canonical text:
- IsBeforeNonCollapsedCharacter
- IsAfterNonCollapsedCharacter
- GetCharacterBefore

By changing the API, we are also allowed to consolidate some overridden
functions in LayoutTextFragment.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ied30ef2e26f74342b68e8b27b385436aa7afc33e
Reviewed-on: https://chromium-review.googlesource.com/742689
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#512956}
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/editing/commands/EditCommand.cpp
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/LayoutText.h
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/LayoutTextFragment.h
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/b040b5139be0348af9e481fd81f03658c01a9d06/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 47 by bugdroid1@chromium.org, Oct 31 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fd4b3e5bc0ee2ef3cc8821434745276d320f9fbb

commit fd4b3e5bc0ee2ef3cc8821434745276d320f9fbb
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Oct 31 23:49:29 2017

[LayoutNG] Convert GetMappingUnitsForDOMOffsetRange to take EphemeralRange

This patch changes the API to take Position parameters to better support
mapping non-text anchored positions to LayoutNG canonical text.

After this patch, NGOffsetMapping is fully converted to take Position parameters.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iee9956dc59c1ab34fe03f9f0f11fe890ddf9e568
Reviewed-on: https://chromium-review.googlesource.com/744733
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513010}
[modify] https://crrev.com/fd4b3e5bc0ee2ef3cc8821434745276d320f9fbb/third_party/WebKit/Source/core/editing/iterators/TextIteratorTextNodeHandler.cpp
[modify] https://crrev.com/fd4b3e5bc0ee2ef3cc8821434745276d320f9fbb/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/fd4b3e5bc0ee2ef3cc8821434745276d320f9fbb/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 48 by bugdroid1@chromium.org, Nov 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/516ae0d2cab5f33ddfbaef3c1199a239d6fdf9f5

commit 516ae0d2cab5f33ddfbaef3c1199a239d6fdf9f5
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Nov 09 05:04:15 2017

[LayoutNG] Add better documentation to NGOffsetMapping

NOTRY=TRUE

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I51006f407515a43b38a941f24af9de66229c7034
Reviewed-on: https://chromium-review.googlesource.com/759123
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515104}
[modify] https://crrev.com/516ae0d2cab5f33ddfbaef3c1199a239d6fdf9f5/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 49 by bugdroid1@chromium.org, Nov 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/69f624398257f14e3e15968ccba4826bc39a5a8a

commit 69f624398257f14e3e15968ccba4826bc39a5a8a
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Nov 20 00:12:44 2017

[LayoutNG] Parameterize NGOffsetMappingTest with LayoutNGPaintFragments

Since offset mapping must work with inline painting enabled, its unit
tests must also work. This patch parameterizes the unit tests to verify
this.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ifcb03aa1992498b973e2cf9e59e136be0e93fe63
Reviewed-on: https://chromium-review.googlesource.com/777724
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517739}
[modify] https://crrev.com/69f624398257f14e3e15968ccba4826bc39a5a8a/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 50 by bugdroid1@chromium.org, Nov 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d4d54d717621690346fef0d5841af036829b9187

commit d4d54d717621690346fef0d5841af036829b9187
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Nov 20 07:01:31 2017

[LayoutNG] Add a unit test for offset mapping in table cells

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I4588bad36c3b38e1722bf4b8ef8b33d313cbe1d2
Reviewed-on: https://chromium-review.googlesource.com/777732
Reviewed-by: Koji Ishii <kojii@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517769}
[modify] https://crrev.com/d4d54d717621690346fef0d5841af036829b9187/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 51 by bugdroid1@chromium.org, Nov 20 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07308a5e0d199ac171c59fb5db5c23a940f797e3

commit 07308a5e0d199ac171c59fb5db5c23a940f797e3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Nov 20 07:22:48 2017

[LayoutNG] Make offset mapping construction more adapted to fragment painting

The construction of offset mapping used to have some hacks to work around the
LayoutText writeback. The hacks are no longer necessary if fragment painting is
enabled.

This patch makes the hacks disabled when fragment painting is enabled, so that
we can remove the hacks easier in the future.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I57e28f32f318d118e8ebe4a89999e3f07a9a806a
Reviewed-on: https://chromium-review.googlesource.com/777964
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517772}
[modify] https://crrev.com/07308a5e0d199ac171c59fb5db5c23a940f797e3/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/07308a5e0d199ac171c59fb5db5c23a940f797e3/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc

Project Member

Comment 52 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1f543e1a220122c079494306b6d8512d661eb61b

commit 1f543e1a220122c079494306b6d8512d661eb61b
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Nov 21 05:38:14 2017

[LayoutNG] DCHECK IsLayoutNGMixin in NGOffsetMappingTest

This change is requested in:

crrev.com/c/777732#message-f0818ef6b64b49a72ba9a50cfcef7a9342041e9b

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ida14a5b3ba16a621819d782037e7eeefd01a3cd5
Reviewed-on: https://chromium-review.googlesource.com/778191
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518138}
[modify] https://crrev.com/1f543e1a220122c079494306b6d8512d661eb61b/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 53 by bugdroid1@chromium.org, Dec 1 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bcd58929f5dd0276306e9fdd308a5c9b850fe880

commit bcd58929f5dd0276306e9fdd308a5c9b850fe880
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Dec 01 23:20:40 2017

[LayoutNG] Fix NGOffsetMapping::GetFor() for positions anchored to inline blocks

NGOffsetMapping::GetFor() used to return the wrong mapping for positions before
or after an inline block. Example:

<div><span style='display: inline-block'>foo</span></div>

When taking SPAN@BeforeAnchor, GetFor() returns the offset mapping of the SPAN,
but the correct result should be that of the DIV since the position is outside
of the SPAN. The root cause is that EnclosingNGBlockFlow() on SPAN returns the
layout object of SPAN itself, since it is a LayoutNGBlockFlow by itself.

This patch fixes the issue by returning EnclosingNGBlockFlow() of its parent
instead when the given position is before/after an atomic inline.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Idf2cdda0fd9c5ed533e5d516fe459374e0383b29
Reviewed-on: https://chromium-review.googlesource.com/802628
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521110}
[modify] https://crrev.com/bcd58929f5dd0276306e9fdd308a5c9b850fe880/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/bcd58929f5dd0276306e9fdd308a5c9b850fe880/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/bcd58929f5dd0276306e9fdd308a5c9b850fe880/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 54 by bugdroid1@chromium.org, Dec 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ef53c41c1c51df078e940465939c47087aeafee8

commit ef53c41c1c51df078e940465939c47087aeafee8
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Dec 07 18:01:06 2017

[LayoutNG] Expose NGInlineFormattingContextOf() with unit tests

This patch exposes NGInlineFormattingContextOf() from ng_offset_mapping.cc
as a utility function, so that we can easily check if a given position is
laid out as layout ng inline, and if so, which context it is in. New unit
tests are added for the function.

This patch is split off from crrev.com/c/803015: Compute LocalCaretRect in NG

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I6ea8c8f77f7389ea7b68a58311900171883a582b
Reviewed-on: https://chromium-review.googlesource.com/809767
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Reviewed-by: yosin (OOO Dec 11 to Jan 8) <yosin@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522471}
[modify] https://crrev.com/ef53c41c1c51df078e940465939c47087aeafee8/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/ef53c41c1c51df078e940465939c47087aeafee8/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/ef53c41c1c51df078e940465939c47087aeafee8/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 55 by bugdroid1@chromium.org, Feb 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/119451560b905f543a68eb0c3e2b19123a9001b8

commit 119451560b905f543a68eb0c3e2b19123a9001b8
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Feb 06 01:16:40 2018

[LayoutNG] Add test cases of soft hyphen and ellipsis to NGOffsetMappingTest

This is a follow-up of crrev.com/c/900602 to verify that offset mapping
works in these cases.

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Iee9ebe758786bd1f3b8ff309b3f227404057f18a
Reviewed-on: https://chromium-review.googlesource.com/902932
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534565}
[modify] https://crrev.com/119451560b905f543a68eb0c3e2b19123a9001b8/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 56 by bugdroid1@chromium.org, Mar 27 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/084cac136d253348facf9fb9dd451cc897917acf

commit 084cac136d253348facf9fb9dd451cc897917acf
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Mar 27 03:05:40 2018

[LayoutNG] Allow positions before/after text nodes

Since Position::Before/AfterNode(text_node) are valid DOM
positions, offset mapping should accept such positions.

This patch ensures it, and also fixes test cases incidentally
passing such positions to offset mapping.

This patch is also preparation for crrev.com/c/974909

Bug: 699017
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I34aa4f9701d0476c93cbe5155e1b6758ebe8c7db
Reviewed-on: https://chromium-review.googlesource.com/974903
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Yoshifumi Inoue <yosin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#545927}
[modify] https://crrev.com/084cac136d253348facf9fb9dd451cc897917acf/third_party/WebKit/Source/core/editing/LocalCaretRectTest.cpp
[modify] https://crrev.com/084cac136d253348facf9fb9dd451cc897917acf/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/084cac136d253348facf9fb9dd451cc897917acf/third_party/WebKit/Source/core/layout/LayoutTextFragment.cpp
[modify] https://crrev.com/084cac136d253348facf9fb9dd451cc897917acf/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/084cac136d253348facf9fb9dd451cc897917acf/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 57 by bugdroid1@chromium.org, Jul 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0eb47bbfb877b834368ba8236c050f6dbeef7f04

commit 0eb47bbfb877b834368ba8236c050f6dbeef7f04
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Tue Jul 24 00:39:24 2018

[LayoutNG] Reorganize code in ng_offset_mapping_builder.h

This patch moves the definition of NGOffsetMappingBuilder::SourceNodeScope
to the beginning of NGOffsetMappingBuilder before all member functions
for better coding style.

Bug: 699017
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: If0a6d9ea5fad9194a5a3148f4724a45861964d6c
Reviewed-on: https://chromium-review.googlesource.com/1147547
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577379}
[modify] https://crrev.com/0eb47bbfb877b834368ba8236c050f6dbeef7f04/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping_builder.h

Project Member

Comment 58 by bugdroid1@chromium.org, Aug 16

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8e225510e31524c3bba1a24f763fc68e8d3c8c7d

commit 8e225510e31524c3bba1a24f763fc68e8d3c8c7d
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Thu Aug 16 22:00:38 2018

[LayoutNG] Removed unused parameterization in NGOffsetMappingTest

Bug: 699017
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I88f9753576e67f1ed5ff4f6ca8fbf52cac4bcda2
Reviewed-on: https://chromium-review.googlesource.com/1178755
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Emil A Eklund <eae@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583840}
[modify] https://crrev.com/8e225510e31524c3bba1a24f763fc68e8d3c8c7d/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping_test.cc

Blockedon: 876150
Project Member

Comment 60 by bugdroid1@chromium.org, Aug 24

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3

commit e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Aug 24 20:45:15 2018

[LayoutNG] Optimize NGOffsetMappingBuilder

This patch optimizes NGOffsetMappingBuilder so that it constructs
an offset mapping faster. The change is basically:
- Before: maintains the mapping function as a plain array, and converts
  it into mapping units and ranges in Build()
- After: maintains the mapping units and ranges directly

Design doc: https://goo.gl/QAn57A

This patch also adds a performance test, which forces offset mapping
creation by setting selection, to measure the improvement:
- Before: 18.5 runs/s
- After: 24.9 runs/s

Bug: 699017
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng
Change-Id: I9cd0aa0c4b42320ae0812b460dc374433bac4119
Reviewed-on: https://chromium-review.googlesource.com/1149150
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ned Nguyen <nednguyen@google.com>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585982}
[add] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/perf_tests/layout/line-layout-repeat-append-select.html
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_inline_items_builder_test.cc
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.h
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping_builder.h
[modify] https://crrev.com/e075f9402dfe0c8195fdb66aa4f8cfb2b3234da3/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping_test.cc

Project Member

Comment 61 by bugdroid1@chromium.org, Dec 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cac945199621195535beacd75cf5965794f688d5

commit cac945199621195535beacd75cf5965794f688d5
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Dec 17 21:23:15 2018

Unify block flow getter code for NGOffsetMapping

ElementInnerTextCollector and FindBuffer has duplicated code doing the
same thing: given a LayoutObject, find the block flow where the
NGOffsetMapping should be hosted.

This patch unifies the duplicated code.

Bug: 699017
Change-Id: I1f533c0d1dad215842151b52698903295a2819d2
Reviewed-on: https://chromium-review.googlesource.com/c/1380800
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#617234}
[modify] https://crrev.com/cac945199621195535beacd75cf5965794f688d5/third_party/blink/renderer/core/editing/element_inner_text.cc
[modify] https://crrev.com/cac945199621195535beacd75cf5965794f688d5/third_party/blink/renderer/core/editing/finder/find_buffer.cc
[modify] https://crrev.com/cac945199621195535beacd75cf5965794f688d5/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.cc
[modify] https://crrev.com/cac945199621195535beacd75cf5965794f688d5/third_party/blink/renderer/core/layout/ng/inline/ng_offset_mapping.h

Project Member

Comment 62 by bugdroid1@chromium.org, Dec 17

Sign in to add a comment