New issue
Advanced search Search tips

Issue 827923 link

Starred by 1 user

Issue metadata

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


Show other hotlists

Hotlists containing this issue:
layout-backlog


Sign in to add a comment

Deprecate and design proper version of LayoutObject::CreatePositionWithAffinity

Project Member Reported by yosin@chromium.org, Apr 2 2018

Issue description

LayoutObject::CreatePositionWithAffinity() attempts to construct out of
bound position.

Here is examples adding DCHECK to Position ctor and run layout tests for
"editing/"

# editing/selection/doubleclick-whitespace-img-crash.html
<IMG style="-webkit-user-select: none;">@1
Maybe LayoutReplaced::PositionForPoint()

# editing/shadow/rightclick-on-meter-in-shadow-crash.html
METER@1
LayoutBlock::PositionForPointIfOutsideAtomicInlineLevel
 
Summary: Deprecate and design proper version of LayoutObject::CreatePositionWithAffinity (was: LayoutObject::CreatePositionWithAffinity should not construct out of bound Position)
The function is poorly designed.

It currently takes and int offset as parameter, which is out-of-bound in some cases. It can't distinguish positions inside a container node, and positions before/after a container node, either.

We should deprecate this function, and design and switch to a proper version of it.
Labels: -Type-Bug Type-Task

Sign in to add a comment