Skip to content

Add controls attribute to img#12151

Open
yoelhawa wants to merge 2 commits intowhatwg:mainfrom
yoelhawa:img-controls
Open

Add controls attribute to img#12151
yoelhawa wants to merge 2 commits intowhatwg:mainfrom
yoelhawa:img-controls

Conversation

@yoelhawa
Copy link

@yoelhawa yoelhawa commented Feb 11, 2026

Add a new controls attribute to img that allows the user agent to add interactive user interface over the image.

  • At least two implementers are interested (and none opposed):
    • WebKit
  • Tests are written and can be reviewed and commented upon at:
    • Will be covered by IDL tests.
  • Implementation bugs are filed:
    • Chromium: …
    • Gecko: …
    • WebKit: …
  • Corresponding HTML AAM & ARIA in HTML issues & PRs:
  • MDN issue is filed: …
  • The top of this comment includes a clear commit message to use.

(See WHATWG Working Mode: Changes for more details.)


/acknowledgements.html ( diff )
/dom.html ( diff )
/embedded-content.html ( diff )
/indices.html ( diff )

Add a new `controls` attribute to `img` that allows the user agent to add
interactive user interface over the image.
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, nice! You also need to update img in the element index.

@annevk annevk linked an issue Feb 11, 2026 that may be closed by this pull request
@annevk annevk added addition/proposal New features or enhancements topic: img labels Feb 11, 2026
@yoelhawa yoelhawa marked this pull request as ready for review February 12, 2026 22:44
<div w-nodev>

<p>If the <code data-x="attr-img-controls">controls</code> attribute is present, the user agent
may expose controls over the image (e.g. playback controls for animated images). The specific
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
may expose controls over the image (e.g. playback controls for animated images). The specific
may expose controls over the image (e.g., playback controls for animated images). The specific

Comment on lines +30919 to +30920
controls provided are up to the user agent, and can be platform-specific or based on the user's
preferences.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
controls provided are up to the user agent, and can be platform-specific or based on the user's
preferences.</p>
controls provided are <span>implementation-defined</span>, and can be platform-specific or based
on the user's preferences.</p>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

addition/proposal New features or enhancements topic: img

Development

Successfully merging this pull request may close these issues.

controls attribute for <img> element

2 participants