New issue
Advanced search Search tips

Issue 776272 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task

Blocking:
issue 699017
issue 770152



Sign in to add a comment

Support IMG in LayoutNG offset mapping

Project Member Reported by xiaoche...@chromium.org, Oct 19 2017

Issue description

Since IMG can be considered as part of word (see issue 770152 for context), offset mapping should support mapping IMG to canonical text, instead of just text nodes.
 

Comment 1 by yosin@chromium.org, Oct 19 2017

Editing wants to have node which layout object is AtomicInlineLevel(), not sure
about list marker and float.

In NGInlineNode::CollectInlines(), kObjectReplacementCharacter is added into
text content for
 - IsFloating()
 - IsAtomicInlineLevel() except for list marker


# IsAtomicInlineLevel: based on call sites of SetIsAtomicInlineLevel()
- LayoutBlock if display:inline
- LayoutRubyRun inherited from LayoutBlockFlow
- LayoutReplaced: subclasses are:
 * LayoutEmbeddedContent
 * LayoutHTMLCanvas
 * LayoutImage
 * LayoutSVGRoot

Project Member

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

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

commit 8dbf1e70fcef99f2d8df1bbf497b58b255791b7e
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Fri Oct 20 00:43:35 2017

[LayoutNG] Change offset mapping annotation type to general LayoutObject

This patch is a preparation for supporting IMG and other atomic inlines
in offset mapping, for which we need to use general annotation type in
offset mapping builder instead of LayoutText.

Bug:  776272 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: I0c9a24dc4ff97f1c839cb36f25dbef38e30cd4a8
Reviewed-on: https://chromium-review.googlesource.com/728925
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510272}
[modify] https://crrev.com/8dbf1e70fcef99f2d8df1bbf497b58b255791b7e/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.cc
[modify] https://crrev.com/8dbf1e70fcef99f2d8df1bbf497b58b255791b7e/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_builder.h

Project Member

Comment 3 by bugdroid1@chromium.org, Oct 21 2017

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

commit 6b2e4dd03964d5389c80aae678502bc7c3176e68
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Sat Oct 21 01:14:39 2017

[LayoutNG] Support atomic inlines in offset mapping

This patch adds support of atomic inlines to offset mapping, so that
DOM positions anchored at an atomic inline (e.g, IMG@BeforeAnchor) can
be mapped to/from an offset in the NGInlineNode canonical text.

See unit test NGInlineNodeOffsetMappingTest.ReplacedElement for sample usage.

Bug:  776272 
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Change-Id: Ifc929780085323de1bb413eb584438cd3f001806
Reviewed-on: https://chromium-review.googlesource.com/731184
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510631}
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.cc
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder.h
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_items_builder_test.cc
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node.cc
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_inline_node_offset_mapping_test.cc
[modify] https://crrev.com/6b2e4dd03964d5389c80aae678502bc7c3176e68/third_party/WebKit/Source/core/layout/ng/inline/ng_offset_mapping_result.h

Status: Fixed (was: Assigned)

Sign in to add a comment