img loading eager/lazy Default

Resolves img loading keywords with eager as both missing and invalid default. This reports the hint and does not guarantee actual lazy deferral.

Description

Image loading hints allow eager retrieval or deferred lazy loading.

Image loading hints allow eager retrieval or deferred lazy loading. Missing and invalid img loading values resolve to eager.1

The tool returns state, validKeyword. The fields describe the supplied local pattern or effective state, or contain the formatted markup shown below.

When to use img loading eager/lazy Default

Use this for the following task: Resolves img loading keywords with eager as both missing and invalid default. This reports the hint and does not guarantee actual lazy deferral. Provide the requested local fields extracted from the relevant element or attribute.

How to use img loading eager/lazy Default and understand its results

  1. Prepare the parsed element names, attribute values or direct element-child lists requested below. Keep attribute presence separate from its value.
  2. Enter present, value according to the field table, then run the tool.
  3. Read state, validKeyword. Check the effective state, recognized-token flags or generated markup against the rules below.
  4. Correct any reported local mismatch and check the resulting markup in its intended document and browser context.
Input fieldMeaningValue type and boundsRequirement
presentPresentbooleanRequired
valueValuestring; maximum text length 100000Required

Supply presence and value. Resolve eager/lazy after ASCII case folding and report whether a present keyword is valid.

state=lazy only for present lazy; otherwise eager

The symbols and boundary conditions refer to the supplied fields and the implementation described above.

Output fieldMeaningValue type
stateStatestring
validKeywordValid Keywordboolean
json
{
  "input": {
    "present": true,
    "value": "LAZY"
  },
  "output": {
    "state": "lazy",
    "validKeyword": true
  }
}

Limitations and assumptions

The present flag distinguishes an absent attribute from a present empty value. Keyword matching folds ASCII uppercase without trimming. The hint does not guarantee viewport scheduling or actual network deferral.

The tool does not fetch a page, run a browser or validate an entire HTML document. Malformed tool requests produce input errors; valid requests can still report unrecognized values or failed local checks.

Alternative or Complementary methods

Choose img decoding async/sync/auto Hint when you need its operation: Resolves img decoding sync, async or auto hints with auto as missing and invalid default. Actual decoding strategy remains a user-agent decision. Choose iframe loading=lazy Support Lookup for the complementary operation: Resolves an iframe loading attribute to eager or lazy and reports whether lazy loading is eligible given caller-supplied browser support and scripting state. Actual viewport scheduling remains browser controlled.

Background reference: HTML Standard: img loading eager/lazy Default.

References

  1. HTML Standard: img loading eager/lazy Default — WHATWG

Similar or alternative tools

  • img decoding async/sync/auto Hint

    Resolves img decoding sync, async or auto hints with auto as missing and invalid default. Actual decoding strategy remains a user-agent decision.

  • iframe loading=lazy Support Lookup

    Resolves an iframe loading attribute to eager or lazy and reports whether lazy loading is eligible given caller-supplied browser support and scripting state. Actual viewport scheduling remains browser controlled.

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