Closed Bug 1897942 Opened 1 month ago Closed 10 days ago

Text-Fragments: Replace find algorithm with nsfind

Categories

(Core :: DOM: Core & HTML, task)

task

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: jjaschke, Assigned: jjaschke)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

nsFind is a much more robust and fast way of finding a string in a web page, which should replace the find algorithm given in the text fragments spec. Some small adjustments need to be made (nsFind only respects word boundaries on both ends, text fragments needs to set this separately).

Depends on: 1897956

This patch depends on bug 1897956, which contains some prerequisite code that needs to land to allow the tests here to pass.

Here is a try run with this patch rebased on top of the patch of bug 1897956.

nsFind is updated in this patch to allow checking for word boundaries at the beginning and the end of the match pattern instead of only allowing to specify whether a whole word should be searched (ie., word boundary at start and end), or not (ie., no word boundary required at start and end).
This change does not affect the IDL interface and is only available from C++. It is tested by the scroll-to-text-fragment WPTs.

This patch also introduces some more verbose debug logging for the algorithm to find a text directive.

Pushed by jjaschke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a239855b02ea
Text Fragments: Replace spec find-string-in-range algorithm with `nsFind`. r=emilio
https://hg.mozilla.org/integration/autoland/rev/ec3fcdcbfbd7
1897956, 1898321: apply code formatting via Lando
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46755 for changes under testing/web-platform/tests
Flags: needinfo?(jjaschke)
Upstream PR merged by moz-wptsync-bot
Pushed by jjaschke@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cc2126bec6e6
Text Fragments: Replace spec find-string-in-range algorithm with `nsFind`. r=emilio
https://hg.mozilla.org/integration/autoland/rev/95850130fec8
1897956, 1898321: apply code formatting via Lando
Status: ASSIGNED → RESOLVED
Closed: 10 days ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
Flags: needinfo?(jjaschke)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: