Canvas Fallback Content Note

Determines canvas fallback in interactive visual media from caller-supplied canvas support and scripting state. Disabled scripting or disabled canvas support displays fallback. Printing/static media and accessibility subtree behavior are outside this profile.

Description

Canvas offers bitmap drawing with fallback content.

Canvas offers bitmap drawing with fallback content. In interactive visual media, disabled scripting or unavailable canvas support can make fallback relevant.1

Determines canvas fallback in interactive visual media from caller-supplied canvas support and scripting state. Disabled scripting or disabled canvas support displays fallback. Printing/static media and accessibility subtree behavior are outside this profile.

When to use Canvas Fallback Content Note

Use this for the following task: Determines canvas fallback in interactive visual media from caller-supplied canvas support and scripting state. Disabled scripting or disabled canvas support displays fallback. Printing/static media and accessibility subtree behavior are outside this profile.

Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.

How to use Canvas Fallback Content Note and understand its results

  1. Prepare the parsed attribute values, element states or ordered local lists requested below. Keep attribute presence separate from value.
  2. Enter canvasSupported, scriptingEnabled using the field table, then run the tool.
  3. Read visualFallback, scriptsCanDraw. Interpret flags, units, ordering and placeholder values using the rules below.
  4. Review any reported issue or failed check, correct the supplied values when appropriate, and verify the result in its intended context.
Input fieldMeaningValue type and boundsRequirement
canvasSupportedCanvas SupportedbooleanRequired
scriptingEnabledScripting EnabledbooleanRequired

Supply support and scripting flags for the intended environment, then inspect fallback and drawing eligibility.2

visualFallback = !canvasSupported OR !scriptingEnabled; scriptsCanDraw = both true

This summarizes the declared operation. Units, indexing, inclusivity and exceptional cases are explained in the surrounding text.

Output fieldMeaningValue type
visualFallbackVisual Fallbackboolean
scriptsCanDrawScripts Can Drawboolean
json
{
  "input": {
    "canvasSupported": true,
    "scriptingEnabled": false
  },
  "output": {
    "visualFallback": true,
    "scriptsCanDraw": false
  }
}

Limitations and assumptions

Static/printing media and accessibility subtree behavior are excluded. Eligible drawing does not mean a script actually drew anything.

This evaluates supplied local information; it does not fetch a page or run a browser. Malformed requests produce input errors. A successfully evaluated request can still contain false flags, empty result lists or a result outside the supplied threshold; those outcomes have the meanings stated above.

Alternative or Complementary methods

Choose noscript JS-Disabled Fallback for this operation: Resolves HTML noscript fallback and parser treatment from the HTML parser scripting flag. With scripting enabled contents are text; with scripting disabled contents are markup. XML parsing and full content-model validation are outside this tool. For a complementary task, use template Inert Content Note for this operation: Classifies ordinary template DocumentFragment contents versus content already inserted into a document or a processed declarative shadow root. Only ordinary template contents remain in the inert template owner document; other reasons for inertness are not evaluated.

Further background: HTML / accessibility reference: Canvas Fallback Content Note.

References

  1. HTML / accessibility reference: Canvas Fallback Content Note — WHATWG

  2. Canvas Fallback Content Note — tool.io

Similar or alternative tools

  • noscript JS-Disabled Fallback

    Resolves HTML noscript fallback and parser treatment from the HTML parser scripting flag. With scripting enabled contents are text; with scripting disabled contents are markup. XML parsing and full content-model validation are outside this tool.

  • template Inert Content Note

    Classifies ordinary template DocumentFragment contents versus content already inserted into a document or a processed declarative shadow root. Only ordinary template contents remain in the inert template owner document; other reasons for inertness are not evaluated.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies