C3 · back to all sections
CSSOM-only edits
snapdom 3 reuses an earlier capture when nothing in the DOM has
changed. Changes made straight to a stylesheet with
insertRule don't count as DOM changes. This box flips
between RED and BLUE every 4 seconds using only
insertRule and deleteRule; nothing else on
this page moves.
- Pin the swatch and note its colour.
- Wait for it to change, then pin it again.
- The two screenshots should show different colours.
- In MarkUp (preview, 3.0.0 via proxy)
- Probably two different colours, matching the live box each time. If the second screenshot repeats the first colour, snapdom reused a stale capture. MarkUp changes the DOM around each capture (it hides its own UI), which should clear snapdom's cache anyway.
- Raw snapdom / SDK
-
snapdom's docs say CSSOM edits need
invalidate: true, but in a local harness run (two captures 4.5s apart) 2.24.3, 3.0.0 and 3.4.0 all captured the right colour both times. The harness also changes the DOM between captures, so this isn't a clean test of the cache.
Reference: FEATURES.md, Caching & memoization