RESOLVED FIXED 224546
[IFC] Incorrect box height when scrollbar takes padding box space
https://bugs.webkit.org/show_bug.cgi?id=224546
Summary [IFC] Incorrect box height when scrollbar takes padding box space
cathiechen
Reported 2021-04-14 07:47:01 PDT
Created attachment 425979 [details] selection-crash.html This issue occurs on the Debug building with LAYOUT_FORMATTING_CONTEXT enabled. The code is updated to commit 80e1bf3d759003a97b3e676d78fca630407fdd35. The test case contains inline-block box and text. The height of body is 35px, but others are 24px. It crashes when select the text. Debug a bit: - During layout, in RenderBlockFlow::layoutInlineChildren, it uses layoutModernLines() to layout lines. The logical height is 35. - During select, in RenderBlockFlow::ensureLineBoxes, it calls complexLineLayout.layoutLineBoxes. The logical height is 24. - Then it fails `ASSERT(didNeedLayout || ceilf(logicalHeight()) == ceilf(oldHeight));` in RenderBlockFlow::ensureLineBoxes.
Attachments
selection-crash.html (558 bytes, text/html)
2021-04-14 07:47 PDT, cathiechen
no flags
(another)test case (464 bytes, text/html)
2021-04-14 08:20 PDT, zalan
no flags
Patch (3.81 KB, patch)
2021-04-15 03:23 PDT, zalan
ews-feeder: commit-queue-
Patch (5.45 KB, patch)
2021-04-15 09:26 PDT, zalan
no flags
zalan
Comment 1 2021-04-14 08:20:46 PDT
Created attachment 425983 [details] (another)test case
zalan
Comment 2 2021-04-14 14:36:43 PDT
Actually this is about the reserved space for always-on scrollbars (15px here in MiniBrowser -which explains the 11px diff (15px scrollbar - 4px descent))
Radar WebKit Bug Importer
Comment 3 2021-04-14 14:44:28 PDT
zalan
Comment 4 2021-04-14 20:55:25 PDT
ok, so this is broken when the padding box can't accommodate the scrollbar. this fixes the vertical aspect of it: - auto verticalSpaceReservedForScrollbar = std::min(replacedOrInlineBlock.height() - replacedOrInlineBlock.paddingBoxHeight(), LayoutUnit(replacedOrInlineBlock.horizontalScrollbarHeight())); + auto paddingBoxHeight = replacedOrInlineBlock.paddingBoxHeight(); + auto horizontalScrollbarHeight = LayoutUnit { replacedOrInlineBlock.horizontalScrollbarHeight() }; + auto verticalSpaceReservedForScrollbar = horizontalScrollbarHeight > paddingBoxHeight ? paddingBoxHeight : std::min(replacedOrInlineBlock.height() - paddingBoxHeight, horizontalScrollbarHeight); will upload the patch tomorrow morning.
zalan
Comment 5 2021-04-15 03:23:11 PDT
zalan
Comment 6 2021-04-15 09:26:32 PDT
EWS
Comment 7 2021-04-16 06:35:16 PDT
Committed r276135 (236629@main): <https://commits.webkit.org/236629@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426110 [details].
Note You need to log in before you can comment on or make changes to this bug.