[webkit-changes] [WebKit/WebKit] 4a76f5: [IFC][Partial layout] Partial layout should always...
Alan Baradlay
noreply at github.com
Wed Oct 11 07:14:54 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4a76f50075d2435edcdc89e0d2ccdfe8958e3140
https://github.com/WebKit/WebKit/commit/4a76f50075d2435edcdc89e0d2ccdfe8958e3140
Author: Alan Baradlay <zalan at apple.com>
Date: 2023-10-11 (Wed, 11 Oct 2023)
Changed paths:
A LayoutTests/fast/text/partial-line-leading-content-change-crash-expected.txt
A LayoutTests/fast/text/partial-line-leading-content-change-crash.html
M Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp
M Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp
Log Message:
-----------
[IFC][Partial layout] Partial layout should always start _before_ the damage position
https://bugs.webkit.org/show_bug.cgi?id=262995
<rdar://116714641>
Reviewed by Antti Koivisto.
1. "\nsome_text" produces 2 InlineTextItems [whitespace][some_text] (they belong to the same layout box)
2. in case of non-preserved whitespace, this produces only one display (content) box [some_text] (in addition to the root inline display box)
Now if [some_text] is deleted, we
1. run the invalidation process and find the 2nd InlineTextItem ([some_text]) as the candidate entry point for the subsequent layout.
2. run layout
2a. generate the new inline item list -> [whitespace] ([some_text] is gone)
2b. call linebuilder with the entry point of "2nd InlineItem" producing an empty layout range, which makes sense as there's nothing to lay out really.
While we should be able to handle this simple (yet very special) case by adjusting line dimensions, removing display boxes,
it's better to just fallback to force laying out this (visually empty) line by moving the candidate position _before_ the [some_text] InlineTextItem.
* LayoutTests/fast/text/partial-line-leading-content-change-crash-expected.txt: Added.
* LayoutTests/fast/text/partial-line-leading-content-change-crash.html: Added.
* Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:
(WebCore::Layout::InlineFormattingContext::layout):
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp:
(WebCore::Layout::inlineItemPositionForDamagedContentPosition):
Canonical link: https://commits.webkit.org/269199@main
More information about the webkit-changes
mailing list