You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf: trim redundant per-node work on the capture hot path
Five hot-path reductions, behavior-preserving:
- background.js: copy the background layout longhands (position/size/repeat/
origin/clip/...) only when the node actually has a background. They are inert
without one yet never empty, so they were written to every clone node,
bloating the foreignObject and rasterization. background-color is included in
the gate so background-clip:text still works.
- styles.js: isFlexOrGridItem uses the cached getStyle instead of a raw
getComputedStyle per node (ran even on snapshot-cache hits).
- transforms.helpers.js: hasBBoxAffectingTransform uses cached getStyle, reusing
the root style captureDOM already read (was resolved twice on Safari).
- pseudo.js: shouldProcessPseudos accepts the fingerprint preflightWithFp already
computed, instead of recomputing it (a querySelectorAll + rule scan).
- clone.js: the three identical exclude/filter 'hide' spacer blocks are one
helper that reads layout at most once instead of up to twice.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
0 commit comments