Bug 249010 - SHOULD NEVER BE REACHED in Layout::TextUtil::breakWord
Summary: SHOULD NEVER BE REACHED in Layout::TextUtil::breakWord
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: zalan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-12-08 22:13 PST by Fujii Hironori
Modified: 2022-12-15 22:14 PST (History)
4 users (show)

See Also:


Attachments
reduced content for WinCairo (503.28 KB, text/html)
2022-12-08 23:28 PST, Fujii Hironori
no flags Details
Another test reduction (723 bytes, text/html)
2022-12-09 08:07 PST, zalan
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fujii Hironori 2022-12-08 22:13:59 PST
SHOULD NEVER BE REACHED in Layout::TextUtil::breakWord

WinCairo Debug (257609@main) hits an assertion failure by loading https://b.hatena.ne.jp/ .

SHOULD NEVER BE REACHED
C:\home\webkit\gc\Source\WebCore\layout/formattingContexts/inline/text/TextUtil.cpp(303) : WebCore::Layout::TextUtil::breakWord
1   00007FF8FF28248B WTFCrash
2   00007FF8E481D6BE WTFCrashWithInfo
3   00007FF8E7C69CB7 WebCore::Layout::TextUtil::breakWord
4   00007FF8E7C24748 WebCore::Layout::Line::Run::truncate
5   00007FF8E7C2307D WebCore::Layout::Line::truncate
6   00007FF8E7C7571D `WebCore::Layout::LineBuilder::close'::`2'::<lambda_2>::operator()
7   00007FF8E7C68030 WebCore::Layout::LineBuilder::close
8   00007FF8E7C63C10 WebCore::Layout::LineBuilder::layoutInlineContent
9   00007FF8E7C3AB0B WebCore::Layout::InlineFormattingContext::lineLayout
10  00007FF8E7C3A387 WebCore::Layout::InlineFormattingContext::layoutInFlowContentForIntegration
11  00007FF8E7CE5E07 WebCore::LayoutIntegration::LineLayout::layout
12  00007FF8E866DBE2 WebCore::RenderBlockFlow::layoutModernLines
13  00007FF8E865BA5A WebCore::RenderBlockFlow::layoutInlineChildren
14  00007FF8E865B659 WebCore::RenderBlockFlow::layoutInFlowChildren
15  00007FF8E8659B37 WebCore::RenderBlockFlow::layoutBlock
16  00007FF8E864C09F WebCore::RenderBlock::layout
17  00007FF8E7D1080E WebCore::RenderElement::layoutIfNeeded
18  00007FF8E872A390 WebCore::RenderDeprecatedFlexibleBox::applyModernLineClamp
19  00007FF8E8729691 WebCore::RenderDeprecatedFlexibleBox::applyLineClamp
20  00007FF8E8726F1B WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox
21  00007FF8E8724CCF WebCore::RenderDeprecatedFlexibleBox::layoutBlock
22  00007FF8E864C09F WebCore::RenderBlock::layout
23  00007FF8E865CBE4 WebCore::RenderBlockFlow::layoutBlockChild
24  00007FF8E865B9B6 WebCore::RenderBlockFlow::layoutBlockChildren
25  00007FF8E865B697 WebCore::RenderBlockFlow::layoutInFlowChildren
26  00007FF8E8659B37 WebCore::RenderBlockFlow::layoutBlock
27  00007FF8E864C09F WebCore::RenderBlock::layout
28  00007FF8E7D1080E WebCore::RenderElement::layoutIfNeeded
29  00007FF8E8731759 WebCore::RenderFlexibleBox::maybeCacheChildMainIntrinsicSize
30  00007FF8E8731220 WebCore::RenderFlexibleBox::computeFlexBaseSizeForChild
31  00007FF8E8734FA7 WebCore::RenderFlexibleBox::constructFlexItem
Comment 1 Fujii Hironori 2022-12-08 23:28:56 PST
Created attachment 463957 [details]
reduced content for WinCairo
Comment 2 zalan 2022-12-09 08:06:49 PST
(In reply to Fujii Hironori from comment #1)
> Created attachment 463957 [details]
> reduced content
Thank you for the test reduction. I wasn't able to repro the assert with it but surely the page asserts.
Comment 3 zalan 2022-12-09 08:07:28 PST
Created attachment 463961 [details]
Another test reduction
Comment 4 zalan 2022-12-09 13:04:23 PST
This is caused by a shortcut we take in IFC when measuring text based content. It results in a slightly incorrect content width value when runs separated by soft wrap opportunities measure differently than the sum of the run widths individually (ie width("AB") != width("A") + width("B")). In case of "b.hatena.ne.jp" we produce an incorrect rendering but that is addressed here: bug 249030 (and there's no other visual impact AFAICT).
Comment 5 Radar WebKit Bug Importer 2022-12-15 22:14:19 PST
<rdar://problem/103434293>