[webkit-changes] [WebKit/WebKit] d46133: [IFC][Partial layout] Inserting whitespace may not...

Alan Baradlay noreply at github.com
Sun Mar 3 14:59:27 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d461338cbd3218120b912a3556e610f2c89a2308
      https://github.com/WebKit/WebKit/commit/d461338cbd3218120b912a3556e610f2c89a2308
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2024-03-03 (Sun, 03 Mar 2024)

  Changed paths:
    A LayoutTests/fast/editing/partial-layout-when-inserting-content-expected.html
    A LayoutTests/fast/editing/partial-layout-when-inserting-content.html
    M Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp

  Log Message:
  -----------
  [IFC][Partial layout] Inserting whitespace may not trigger line break at the correct position
https://bugs.webkit.org/show_bug.cgi?id=270388
<rdar://120751482>

Reviewed by Antti Koivisto.

A newly inserted content may introduce a new breaking opportunity on the damaged line. This breaking opportunity
may make part of the content eligible for the previous line.
(e.g. whitespace gets inserted right in the middle of a word making the left side fit on the previous line)
This change ensures that in case of content insertion, we always start layout from a line above where the actual damage happened.

(We also have to make sure that we don't bail out of partial layout too early by not seeing actual changes on the line.
This is done by storing trailing display boxes for content matching only after the _damanged_ line. see mayExitFromPartialLayout for more info)

* LayoutTests/fast/editing/partial-layout-when-inserting-content-expected.html: Added.
* LayoutTests/fast/editing/partial-layout-when-inserting-content.html: Added.
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp:
(WebCore::Layout::invalidatedLineByDamagedBox):
(WebCore::Layout::trailingDisplayBoxesAfterDamagedLine):
(WebCore::Layout::InlineInvalidation::updateInlineDamage):
(WebCore::Layout::InlineInvalidation::textInserted):
(WebCore::Layout::InlineInvalidation::inlineLevelBoxInserted):
(WebCore::Layout::trailingDisplayBoxesForInvalidatedLines): Deleted.

Canonical link: https://commits.webkit.org/275611@main



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list