[webkit-changes] [WebKit/WebKit] 3c7d37: [IFC][Partial layout] InlineInvalidation::textInse...

Alan Baradlay noreply at github.com
Sat Feb 25 09:57:32 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 3c7d37eae4c7692b94429cf3b610ec5863409864
      https://github.com/WebKit/WebKit/commit/3c7d37eae4c7692b94429cf3b610ec5863409864
  Author: Alan Baradlay <zalan at apple.com>
  Date:   2023-02-25 (Sat, 25 Feb 2023)

  Changed paths:
    M Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp
    M Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h
    M Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp
    M Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h
    M Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp

  Log Message:
  -----------
  [IFC][Partial layout] InlineInvalidation::textInserted should be able to handle exiting content mutation
https://bugs.webkit.org/show_bug.cgi?id=252848

Reviewed by Antti Koivisto.

This (mostly refactoring) patch is in preparation for supporting existing content mutation where an InlineTextBox content gets expanded (as opposed to new "renderer" gets added to the tree),

Finding the damaged position now has the following distinct steps:
1. Find the damaged line index (currently it's always the last line) (see damagedLineIndex)
2. Find the first _content_ display box on the line (skipping leading root and spanning inline boxes) (see leadingContentDisplayForLineIndex)
3. Find the associated InlineItem and compute the offset inside the InlineItem when applicable (see inlineItemPositionForDisplayBox)

* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.cpp:
(WebCore::Layout::leadingContentDisplayBox):
(WebCore::Layout::inlineItemPositionForDisplayBox):
(WebCore::Layout::leadingInlineItemPositionOnLastLine):
(WebCore::Layout::leadingInlineItemPositionOnByDamagedBox):
(WebCore::Layout::InlineInvalidation::textInserted):
(WebCore::Layout::leadingInlineItemPositionOnDamagedLine): Deleted.
* Source/WebCore/layout/formattingContexts/inline/invalidation/InlineInvalidation.h:
(WebCore::Layout::InlineInvalidation::textInserted):
* Source/WebCore/layout/integration/LayoutIntegrationBoxTree.cpp:
(WebCore::LayoutIntegration::BoxTree::updateContent):
* Source/WebCore/layout/integration/LayoutIntegrationBoxTree.h:
* Source/WebCore/layout/integration/inline/LayoutIntegrationLineLayout.cpp:
(WebCore::LayoutIntegration::LineLayout::insertedIntoTree):
(WebCore::LayoutIntegration::LineLayout::updateTextContent):

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




More information about the webkit-changes mailing list