Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 11e29ebcb6900ae431165666030a5daf157d77e3
https://github.com/WebKit/WebKit/commit/11e29ebcb6900ae431165666030a5daf157d77e3
Author: Vitor Roriz <[email protected]>
Date: 2024-06-13 (Thu, 13 Jun 2024)
Changed paths:
A
LayoutTests/fast/css3-text/css3-text-wrap/text-wrap-balance-empty-range-crash-expected.html
A
LayoutTests/fast/css3-text/css3-text-wrap/text-wrap-balance-empty-range-crash.html
M Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp
Log Message:
-----------
Guard balanceRangeWithLineRequirement against empty/invalid ranges
rdar://126011869
Reviewed by Brent Fulgham.
InlineItemRange is used for calculating the
number of line break opportunities (NLBO),
We always insert at least 1 dummy item to the Vector
tracking line break opportunities for algorithm purposes,
so NLBO is never zero. However, when initializing
SlidingWidth, balanceRangeWithLineRequirement starts
counting line break opportunities from startIndex = 1,
assuming that the received range had at least 1 item.
We should consider that an empty or invalid range
can be received and guard against it.
*
LayoutTests/fast/css3-text/css3-text-wrap/text-wrap-balance-empty-range-crash-expected.html:
Added.
*
LayoutTests/fast/css3-text/css3-text-wrap/text-wrap-balance-empty-range-crash.html:
Added.
* Source/WebCore/layout/formattingContexts/inline/InlineContentBalancer.cpp:
(WebCore::Layout::InlineContentBalancer::computeBalanceConstraints):
(WebCore::Layout::InlineContentBalancer::balanceRangeWithLineRequirement):
(WebCore::Layout::InlineContentBalancer::balanceRangeWithNoLineRequirement):
Originally-landed-as: 272448.926@safari-7618-branch (a76aaa768a18).
rdar://129792267
Canonical link: https://commits.webkit.org/279988@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes