perf: improve attribute selectors by adding single listeners (#10384)

This commit is contained in:
Eduardo Speroni
2024-06-28 18:55:12 -03:00
committed by GitHub
parent b8fff3833e
commit bb83addb5c
3 changed files with 19 additions and 7 deletions

View File

@@ -5,6 +5,7 @@ import { Trace } from '../../trace';
import { isNullOrUndefined } from '../../utils/types';
import * as ReworkCSS from '../../css';
import { CSSUtils } from '../../css/system-classes';
/**
* An interface describing the shape of a type on which the selectors may apply.
@@ -1014,6 +1015,9 @@ export class SelectorsMatch<T extends Node> implements ChangeAccumulator {
public selectors: SelectorCore[];
public addAttribute(node: T, attribute: string): void {
if (CSSUtils.IgnoredCssDynamicAttributeTracking.has(attribute)) {
return;
}
const deps: Changes = this.properties(node);
if (!deps.attributes) {
deps.attributes = new Set();