Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scanner: discard Form instances with no classified inputs #574

Merged
merged 1 commit into from
Jul 2, 2024

Commits on May 23, 2024

  1. scanner: discard Form instances with no classified inputs

    When encountering <form/>s with no fillable inputs, the Scanner and Form
    classes previously maintained MutationObservers for each <form/>. This
    allowed the global MutationObserver to detect newly-added <input/>s and
    attribute them to existing Form instances without having to create a new
    Form, but also meant we maintained observers and listeners that often
    went unused. For performance reasons, we stop processing <form/> elements
    once 30 Form instances have been created. This allowed a large number of
    unfillable <form/>s could consume the entire Form pool before an
    actually-fillable <form/> is encountered.
    
    Immediately `destroy()` a Form instance that contains no fillable
    <input/>s, and avoid adding that instance to a Scanner's set of known
    Form instances. This ensures form-scoped listeners and observers are only
    maintained when a fillable field is present. When a new <input/> is
    added the global MutationObserver and Scanner create a new Form instance
    to manage it, enabling slightly lazier listener/observer initialization.
    sjbarag committed May 23, 2024
    Configuration menu
    Copy the full SHA
    b9c8959 View commit details
    Browse the repository at this point in the history