Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f741c2eaf21b495f1a9455329abc8e0c8e128f8
      
https://github.com/WebKit/WebKit/commit/5f741c2eaf21b495f1a9455329abc8e0c8e128f8
  Author: Alan Baradlay <[email protected]>
  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


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to