Jan-Niklas Jaeschke a70a790e2a Bug 1898321 - Text Fragments: Correctly find text fragments if there are DOM changes during page load. r=farre,dom-core
Before this patch, the first call to `Document::ScrollToRef()` would attempt to find all text directives in the document, and, if found, highlight + scroll to them. Then, it would clear the list of uninvoked directives.

However, `ScrollToRef()` is called multiple times during a page load, and the DOM can change (e.g. if `DOMContentLoaded` does some changes).

This patch fixes this by only removing the text directives which were found in the document from the list of uninvoked directives.
This way, subsequent calls to `ScrollToRef()` would ensure that all text directives are highlighted, and the first text directive is scrolled to.
Additionally, all remaining uninvoked text directives at the end of a page load (ie. text directives that are not on the page) are cleared.

A test was added as well.

Differential Revision: https://phabricator.services.mozilla.com/D211260
2024-06-14 12:20:48 +00:00

An explanation of the Firefox Source Code Directory Structure and links to
project pages with documentation can be found at:

    https://firefox-source-docs.mozilla.org/contributing/directory_structure.html

For information on how to build Firefox from the source code and create the patch see:

    https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html

If you have a question about developing Firefox, and can't find the solution
on https://firefox-source-docs.mozilla.org/, you can try asking your question on Matrix at chat.mozilla.org in `Introduction` (https://chat.mozilla.org/#/room/#introduction:mozilla.org) channel.


Nightly development builds can be downloaded from:

    https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/
            - or -
    https://www.mozilla.org/firefox/channel/desktop/#nightly

Keep in mind that nightly builds, which are used by Firefox developers for
testing, may be buggy.
Description
Preconfigured browser for YouTube's TV interface
Readme 5.5 GiB
Languages
JavaScript 32.6%
C++ 25.1%
HTML 20.9%
C 10.6%
Python 2.8%
Other 7.6%