← Previous Next →

Scrawl-canvas v8 - DOM test 017

Testing getCanvas(), getStack() functionality

To note: Javascript is not running in this browser environment. Our apologies, but this demo has not yet been updated to support progressive enhancement.

To note: SC stacks can be tempremental at the best of times...

Test purpose

In a React-like framework environment, it is possible for a Scrawl-canvas stack or canvas artefact to be refreshed, replaced or deleted from the DOM because of activity happening in other parts of the page.

Scrawl-canvas offers two functions - getStack and getCanvas - to find and register stack and canvas elements created dynamically after page load completes. They must do this work mindful of the need to not pollute the SC library with orphaned or duplicate objects - failure to manage this leads to memory leaks.

Touch test: not required for this test

Annotated code