New issue
Advanced search Search tips

Issue 811418 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Blocking:
issue 707656



Sign in to add a comment

[LayoutNG] NOTREACH reached with WBR

Project Member Reported by xiaoche...@chromium.org, Feb 12 2018

Issue description

Chrome Version: ToT
OS: (e.g. Win7, OSX 10.9.5, etc...)

What steps will reproduce the problem?
(1) Load "data:text/html, foo <wbr> bar" with LayoutNG enabled
(2) Set selection "fo^o <wbr> ba|r" where ^ and | denote selection anchor and focus, respectively
(3) Try copy the selection

What is the expected result?

No crash

What happens instead?

Crash, hitting a NOTREACHED() in LayoutText::PositionForCaretOffset():

LayoutView 0x248762004010              	#document
  LayoutNGBlockFlow 0x248762018010     	HTML
    LayoutNGBlockFlow 0x248762018158   	BODY
      LayoutText 0x2487620281b0        	#text "foo "
*     LayoutWordBreak 0x2487620280e0   	WBR
      LayoutText 0x248762028010        	#text " bar "
[1:1:0212/130111.393750:FATAL:LayoutText.cpp(1990)] Check failed: false. 0
#0 0x7ff5bafa69fd base::debug::StackTrace::StackTrace()
#1 0x7ff5bafa4eec base::debug::StackTrace::StackTrace()
#2 0x7ff5bb02d93a logging::LogMessage::~LogMessage()
#3 0x7ff5b3275356 blink::LayoutText::PositionForCaretOffset()
#4 0x7ff5b3275fc6 blink::LayoutText::ResolvedTextLength()
#5 0x7ff5b29e09f1 blink::(anonymous namespace)::EndOfParagraphAlgorithm<>()
#6 0x7ff5b29ddf99 blink::(anonymous namespace)::EndOfParagraphAlgorithm<>()
#7 0x7ff5b29dde72 blink::EndOfParagraph()
#8 0x7ff5b29deb4b blink::(anonymous namespace)::IsEndOfParagraphAlgorithm<>()
#9 0x7ff5b29dea1a blink::IsEndOfParagraph()
#10 0x7ff5b2a9ff4b blink::NeedInterchangeNewlineAfter<>()
#11 0x7ff5b2aa1cb2 blink::StyledMarkupSerializer<>::CreateMarkup()
#12 0x7ff5b2a9cc42 blink::CreateMarkupAlgorithm<>::CreateMarkup()
#13 0x7ff5b2a99c0a blink::CreateMarkup()


 
Project Member

Comment 1 by bugdroid1@chromium.org, Feb 26 2018

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

commit 606d69291fed8bf3449075aa1d39180195e854c6
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Mon Feb 26 19:58:08 2018

[LayoutNG] Fix caret offset handling of LayoutWordBreak

LayoutText::PositionForCaretOffset() and ::CaretOffsetForPosition() hit
DCHECK when called on LayoutWordBreak. This patch adds LayoutWordBreak
handling on them so that the functions can be called normally.

The handling simply assumes that LayoutWordBreak is fully collapsed text,
which matches the behavior in legacy layout.

No fixing to NGOffsetMapping is needed, as it already (unintentionally)
treats LayoutWordBreak as collapsed.

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_layout_ng
Bug:  811418 
Change-Id: I23061a63e386e522841626fa36e3cd24e1431afc
Reviewed-on: https://chromium-review.googlesource.com/936433
Reviewed-by: Emil A Eklund <eae@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#539245}
[modify] https://crrev.com/606d69291fed8bf3449075aa1d39180195e854c6/third_party/WebKit/Source/core/layout/LayoutText.cpp
[modify] https://crrev.com/606d69291fed8bf3449075aa1d39180195e854c6/third_party/WebKit/Source/core/layout/LayoutTextTest.cpp
[modify] https://crrev.com/606d69291fed8bf3449075aa1d39180195e854c6/third_party/WebKit/Source/core/layout/LayoutWordBreak.cpp
[modify] https://crrev.com/606d69291fed8bf3449075aa1d39180195e854c6/third_party/WebKit/Source/core/layout/LayoutWordBreak.h

Status: Fixed (was: Assigned)

Sign in to add a comment