New issue
Advanced search Search tips

Issue 873949 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Feature



Sign in to add a comment

[LayoutNG] Should we support LayoutText::ContainsReversedText()?

Project Member Reported by yosin@chromium.org, Aug 14

Issue description

LayoutText::ContainsReversedText() is used in editing as below:
 - CompositeEditCommand::DeleteInsignificantText()
 - EditCommand::IsRenderedCharacter()
 - TextIteratorTextNodeHandler::HandleTextBox()
for mapping list of inline box (in visual order) to logical order.

LayoutText::ContainsReversedText() returns contains_reversed_text_ and it is set in LayoutText::PositionLineBox(InlineBox* box) as
  contains_reversed_text_ |= !s->IsLeftToRightDirection()

LayoutText::ContainsReversedText() can make following function faster:
 - Element#innerText
 - Typing a character

 
This seems to be a helper function for editing to decide whether we need to sort text boxes to get the logical order.

Supporting it shouldn't be too hard. Or we may check NGInlineNodeData::is_bidi_enabled_.

Anyway, if possible, I prefer using the block's text content directly.

Sign in to add a comment