Skip to content

High performance option (oldValues?) #126

@LeaVerou

Description

@LeaVerou

Even though in theory, the browser caches getComputedStyle() calls, and if you don't access any properties that cause a reflow, the gCS() call should not cause one by itself, perhaps we should have an option that avoids calling it. There is precedent for MutationObserver's attributeOldValue, so perhaps we could have a propertyOldValue option or just oldValues. It should definitely default to true though, which is an antipattern for boolean options, but oh well (double negatives like noOldValues: false are an even bigger antipattern).

The downside is that with all the browser bugs, this will also create false positive calls, but if someone doesn't care about the actual values, presumably this is okay for their use case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions