Skip to content

Keep Find results current and limit page inspection - #60

Merged
rangaNP merged 1 commit into
mainfrom
fix/find-and-page-inspection
Nov 22, 2026
Merged

rangaNP merged 1 commit into
mainfrom
fix/find-and-page-inspection

Conversation

@rangaNP

@rangaNP rangaNP commented Nov 22, 2026

Copy link
Copy Markdown
Member

Summary

Find refreshes its matches on Next or Previous when a page hides or reveals text, changes a stylesheet, or edits an open shadow tree. The buttons remain available for a nonempty query with zero matches. Find keeps its place across document and shadow-tree edits and releases observers and highlights when the bar or page closes.

Language detection samples visible text within fixed node and character budgets. Reader checks document size and depth before cloning, caps Readability's element count, and checks article size before reparsing and before transferring the result. Media discovery scans overlapping additions once per mutation batch and applies the tab's mute state in the same callback.

Verification

  • All 1,041 Swift tests and eight release-script tests passed on macOS 27.2.1 with Xcode 27.2. All eight new WebKit regression tests failed against the previous implementation.
  • The Debug build for testing and the Release build passed deep, strict signature verification. The updated native Find test compiled and was discovered for CI. It reveals two matches after the bar reports no matches, then steps through both using the button.
  • In a warmed WebKit view with 12,000 paragraphs, median language collection fell from 3.68 ms to 0.02 ms with the same 2,000-character output limit. On a 24,000-paragraph page, Reader previously spent 130 ms extracting a 3.55-million-character article. The new preflight rejected it below the timer's 1 ms resolution. A 900-paragraph article produced identical HTML in 4.0 ms before and 4.5 ms after.
  • An overlapping batch with 100 audio elements reduced discovery from 126 selectors and 2,600 player visits to one selector and 100 visits. All players were muted by the next mutation observer callback, and unmuting restored their original settings.

@rangaNP
rangaNP merged commit 336e6f2 into main Nov 22, 2026
5 checks passed
@rangaNP
rangaNP deleted the fix/find-and-page-inspection branch November 22, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant