[webkit-changes] [WebKit/WebKit] 5f741c: [IFC][Partial layout] Ensure that leading inline i...
Alan Baradlay
noreply at github.com
Thu Mar 16 19:14:44 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5f741c2eaf21b495f1a9455329abc8e0c8e128f8
https://github.com/WebKit/WebKit/commit/5f741c2eaf21b495f1a9455329abc8e0c8e128f8
Author: Alan Baradlay <zalan at apple.com>
Date: 2023-03-16 (Thu, 16 Mar 2023)
Changed paths:
M Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp
Log Message:
-----------
[IFC][Partial layout] Ensure that leading inline item position for invalidation is never after the actual damage
https://bugs.webkit.org/show_bug.cgi?id=253801
Reviewed by Antti Koivisto.
Translating a layout box based damage to a line is based on finding associated display boxes and mapping them back to display lines.
When the content at the damage position does not initiate a display box (e.g. collapsed whitespace),
the computed leading inline item position (remember, it's based on display boxes) may be _after_ the actual damage position.
This patch ensures that the InlineDamage never holds a position that's _after_ the damage.
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp:
(WebCore::Layout::inlineItemPositionForDisplayBox): This is just a refactor. Moving some logic out of the for loop.
(WebCore::Layout::inlineItemPositionForDamagedContentPosition): Check if the damage position is before/after the candidate inline item position.
(WebCore::Layout::leadingInlineItemPositionForDamage):
(WebCore::Layout::firstInlineItemIndexForLayoutBox): Deleted.
Canonical link: https://commits.webkit.org/261782@main
More information about the webkit-changes
mailing list