hide-if-canvas-contains

Check that the hide-if-canvas-contains snippet is working as expected.

fillText

Test the basic usage of the snippet when fillText() is called.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

strokeText

Test the basic usage of the snippet when strokeText() is called.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

strokeText accumulates text across calls

Test that the snippet accumulates text when strokeText() is called once per character rather than in a single call.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

drawImage

Test the basic usage of the snippet when drawImage() is called.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

drawImage with toDataURL

Test the snippet when drawImage() is called with an image sourced from toDataURL().

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

clearRectBehavior always

Test that clearRectBehavior=always resets the text buffer on any clearRect() call, including partial ones. Text drawn in two separate phases separated by a partial clearRect should not combine to form a match.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters

data mode

Test that mode="data" matches the pattern against the canvas data URL (canvas.toDataURL()), which is a base64-encoded PNG. The pattern UgAAACUAAAAX is the base64 of the PNG header bytes that end the IHDR chunk name and store the image width and height, here 37 (0x25) and 23 (0x17). Every browser writes this header the same way, unlike the pixel data, so only the 37×23 canvas matches and the 20×20 ones do not.

Example Content
Failed. Element is not hidden.
Should not be hidden.
Should not be hidden.
Waiting 500ms to trigger snippet...

Steps

Filters