Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6ef7c763d18e81e3cddcf2294ee66d78fafab448
      
https://github.com/WebKit/WebKit/commit/6ef7c763d18e81e3cddcf2294ee66d78fafab448
  Author: Alan Baradlay <za...@apple.com>
  Date:   2025-08-26 (Tue, 26 Aug 2025)

  Changed paths:
    M 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-auto-text-fragment-expected.txt
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/editing/TextIterator.cpp

  Log Message:
  -----------
  REGRESSION (292919@main): String search when subject has large number (>1000) 
of hits freezes huge pages
https://bugs.webkit.org/show_bug.cgi?id=297920
<rdar://159129919>

Reviewed by Simon Fraser.

1. 292919@main added support for finding content inside 'c-v: a' subtrees. It 
initiates layout on previously "ignored" subtrees so that TextIterator can
find the content inside.
2. Since we don't keep a list of 'c-v: a' roots around, we need to traverse the 
tree to find them all.
3. It is supposed to be done only once per find-in-page session, right before 
we start searching for content.

Find-in-page (on large pages) regression is caused by running this c-v flavor 
of 'updateLayout' from TextIterator's c'tor, which is invoked more frequently 
than anticipated.

Let's move this updateLayout() call to countMatchesForText to ensure we only 
run it once.

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-auto-text-fragment-expected.txt:
* Source/WebCore/editing/Editor.cpp:
(WebCore::Editor::findString):
(WebCore::Editor::countMatchesForText):
* Source/WebCore/editing/TextIterator.cpp:
(WebCore::TextIterator::TextIterator):

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to