← Chrome 160 reference · All APIs
v160 · html · enabled by default
Capability Elements Icon-only mode
Adds icon-only rendering to the <camera>, <microphone>, and <geolocation> capability elements via the displayhint="icon-only" HTML attribute. Setting it hides the browser-controlled text label and switches the control to compact symmetric icon padding for space-constrained UI (such as map toolbars or floating video trays), while keeping the browser’s anti-clickjacking validation and exposing the full localized label to screen readers.
Two things to verify before shipping to users:
- Attribute value divergence: Chromium’s implementation in
html_capability_element_base.ccchecks fordisplayhint="icon-only"(ASCII case-insensitive) as an HTML content attribute with no reflected IDL property yet. The open draft spec PR w3c/mediacapture-extensions#184 instead proposesenum MediaElementDisplayHint { "icon", "text", "icon+text" }and a reflected IDL attribute. Watch that PR for potential value alignment. - Flag status on trunk: ChromeStatus files this feature under “Enabled by default” in milestone=160 (Finch name
CapabilityElementIconOnlyMode), while trunkruntime_enabled_features.json5still marksCapabilityElementIconOnlyModeasstatus: "experimental"(checked 2026-11-24). To force-enable in prerelease Chromium builds, launch with--enable-blink-features=CapabilityElementIconOnlyMode.
at a glance
| Shipped in | Chrome 160 (desktop, Android), listed under “Enabled by default” in the milestone=160 listing; Android WebView and iOS are null (unconfirmed) in the ChromeStatus API record |
|---|---|
| Runtime flag / Finch | CapabilityElementIconOnlyMode (status: "experimental" in runtime_enabled_features.json5 on main as of 2026-11-24; test via --enable-blink-features=CapabilityElementIconOnlyMode) |
| Supported elements | <camera> (HTMLCameraElement), <microphone> (HTMLMicrophoneElement), and <geolocation> (HTMLGeolocationElement); explicitly excluded on <install> and <usermedia> |
| Specification PR | w3c/mediacapture-extensions PR #184 (open; PR preview) |
| Explainer | Media Capture Elements Explainer |
| Intent | blink-dev Intent to Ship |
| TAG review | w3ctag/design-reviews#1218 (Issues addressed) |
| Tracking bugs | g-issues.chromium.org/583741580 (ChromeStatus); issues.chromium.org/514564817 (runtime_enabled_features.json5) |
| ChromeStatus | 5107682460696576 — Capability Elements Icon-only mode |
why it exists
Capability elements — <camera>, <microphone> (Chrome 153 reference), and <geolocation> — default to a horizontal button showing both a browser-rendered icon and mandatory localized text (such as “Use camera” or “Use location”) that authors cannot edit or strip. While that prevents misleading copy, it prevents capability elements from fitting into compact spatial interfaces like map-corner locate buttons or floating video-call trays where icons sit alone. Adding the declarative displayhint="icon-only" attribute lets pages opt into an icon-only presentation without weakening the browser’s trusted permission flow, style bounds, or assistive-technology labeling.
Syntax
In Chromium 160, icon-only mode is controlled by the HTML content attribute displayhint on <camera>, <microphone>, and <geolocation>:
<!-- HTML content attribute (Chromium 160 implementation) -->
<camera displayhint="icon-only">Fallback camera control</camera>
<microphone displayhint="icon-only">Fallback microphone control</microphone>
<geolocation displayhint="icon-only">Fallback location control</geolocation>
<!-- Dynamic toggle via DOM attribute methods (no reflected IDL property in Blink yet) -->
element.setAttribute("displayhint", "icon-only");
element.removeAttribute("displayhint");
This reference documents three parts of the Chrome 160 contract: the displayhint attribute & accepted values, icon-only UA rendering & styling rules, and screen-reader accessible name synchronization.
displayhint content attribute — inputs and outputs
Inputs. Set displayhint="icon-only" on a <camera>, <microphone>, or <geolocation> element. Matching is ASCII case-insensitive ("icon-only", "ICON-ONLY", and "iCoN-oNlY" all activate icon-only mode in Blink’s HTMLCapabilityElementBase::IsIconOnly()). Any other string value, an empty attribute, or omission of the attribute keeps the default icon-plus-text presentation.
| Element / input | Icon-only active? | Observed behavior |
|---|---|---|
<camera displayhint="icon-only"> | Yes | Renders camera icon only; retains localized camera accessible name |
<microphone displayhint="icon-only"> | Yes | Renders microphone icon only; retains localized microphone accessible name |
<geolocation displayhint="icon-only"> | Yes | Renders location icon only; retains localized geolocation accessible name |
<usermedia displayhint="icon-only"> or <install displayhint="icon-only"> | No (excluded) | IsHTMLUserMediaElement() and IsHTMLInstallElement() return false in IsIconOnly(); full label stays visible |
displaymode="icon-only" (legacy alias) | Yes (Blink compat alias) | Accepted alongside displayhint in Blink’s current parser/UA stylesheet; authors should use displayhint="icon-only" |
Any other value (e.g. "text", "icon", "") or omitted | No | Falls back to default icon + localized text button without throwing |
Outputs & IDL status. Toggling displayhint between "icon-only" and any other value (or removing the attribute) synchronously runs UpdateAppearance() inside HTMLCapabilityElementBase::ParseAttribute(), immediately hiding or restoring the visible label span. As of Blink trunk on 2026-11-24, neither HTMLCameraElement, HTMLMicrophoneElement, nor HTMLGeolocationElement defines a reflected element.displayhint IDL property; authors must use getAttribute("displayhint"), setAttribute("displayhint", "icon-only"), and removeAttribute("displayhint"). Note that the open W3C PR w3c/mediacapture-extensions#184 proposes a reflected [Reflect] attribute MediaElementDisplayHint? displayhint with enum values "icon", "text", and "icon+text" — those enum values are not what Chromium 160 checks today.
IsIconOnly, ParseAttribute); html_capability_element_base_test.cc (DisplayModeIconOnly, DisplayModeIconOnlyCaseInsensitive); w3c/mediacapture-extensions#184.
Icon-only UA rendering & styling constraints
Inputs & UA stylesheet rules. When CapabilityElementIconOnlyMode is active and displayhint="icon-only" (case-insensitive) is set on <camera>, <microphone>, or <geolocation>, Chromium’s UA stylesheet (capability_element.css) applies three targeted adjustments on top of the standard capability-element styles:
- Hidden text span:
::-internal-permission-text { display: none !important; }, andSetPermissionText()writes an empty string to the internal text span so no text box occupies layout space. - Zero icon gap:
::permission-icon { margin-inline-end: 0px !important; }, removing the default5pxspacing between icon and label. - Compact symmetric padding: the host element’s default padding changes from
8px 16pxto8px, letting authors style square or circular (border-radius: 50%) icon buttons cleanly.
Outputs & preserved author-style clamping. Authors can still customize color, background-color, border, border-radius, font-size (which scales ::permission-icon since its UA height is 1.3em), and bounded padding/dimensions. All capability-element style safeguards in HTMLCapabilityElementBase::AdjustStyle() continue to apply in icon-only mode: uniform pill/circle border-radii are preserved, minimum contrast and legibility checks remain enforced, and invalid styles or occlusion temporarily disable clicking and surface reasons via invalidReason / onvalidationstatuschange.
AdjustStyle, SetPermissionText).
Accessible name & screen-reader contract
Inputs & outputs. Even though icon-only mode clears and hides the visible text span, the browser still computes and maintains the full localized permission string (for example the camera, microphone, or location action label, updating when permission transitions to granted). HTMLCapabilityElementBase::SetPermissionText() stores the full text in accessible_label_ and triggers AXObjectCache::TextChanged() whenever the label changes. In Chromium’s accessibility tree (ax_node_object.cc):
- The element retains ARIA role
button(Role::kButton). - When
IsIconOnly()istrue,AXNodeObjectsuppliescapability_element->AccessibleLabel()as the computed accessible name (NameFrom::kContents), verified in Blink’s unit tests (EXPECT_EQ(expected_label, permission_element->computedName())). - Authors do not need to duplicate the capability label with
aria-labeljust to keep the icon button accessible; the browser supplies a localized, tamper-resistant accessible name automatically.
DisplayModeIconOnly).
Lifecycle and state transitions
Attribute changes to displayhint are handled live in ParseAttribute() without recreating the element or losing an active permission registration. When transitioning into or out of displayhint="icon-only" (such as when a responsive toolbar collapses or expands), Blink calls UpdateAppearance() to clear or repopulate the internal text span while preserving the current permission state and accessible label. When the underlying permission changes (for example from prompt to granted), SetPermissionText() updates accessible_label_ and notifies the accessibility tree while keeping visible text empty in icon-only mode. Clicking an icon-only capability element runs the exact same trusted permission-prompt and capture/location activation flow as the default mode.
ParseAttribute, SetPermissionText, UpdateAppearance).
Errors, unsupported browsers, and progressive enhancement
Setting displayhint never throws an exception. Graceful degradation happens in two tiers:
- Browser supports capability elements, not icon-only mode (for example Chrome 153–159, or when
CapabilityElementIconOnlyModeis disabled): the unknowndisplayhintattribute is ignored and the element renders as the standard icon + localized text button (verified by Blink’sDisplayModeIconOnlyDisabledtest). Design toolbars withflex-wrap: wrapor flexible containers so the wider fallback button does not clip or overflow. - Browser does not support
<camera>,<microphone>, or<geolocation>at all (Firefox, Safari, older Chromium): the tag parses as anHTMLUnknownElementand renders its light-DOM fallback children. Place an accessible<button>wired tonavigator.mediaDevices.getUserMedia()ornavigator.geolocation.getCurrentPosition()inside the element tags. - Feature detection: Check element support via
"HTMLCameraElement" in window/"HTMLGeolocationElement" in window. Because Blink does not expose a reflecteddisplayhintIDL property yet, there is no synchronous IDL property probe for icon-only mode; if layout must branch on whether icon-only mode took effect, compare the rendered element width (or aspect ratio) after layout, or style the container to accommodate both compact and labelled buttons.
DisplayModeIconOnlyDisabled); Media Capture Elements explainer.
Context and exposure
displayhint="icon-only" applies only to <camera>, <microphone>, and <geolocation> elements in top-level or permitted Window documents where capability elements are active (secure contexts and allowed by the corresponding Permissions Policy: camera, microphone, or geolocation). It is not available in Web Workers, and it is explicitly ignored on <usermedia> and <install> elements in Chromium 160.
Examples
No live demo is published on the Chrome Platform Showcase for this Chrome 160 feature yet (checked 2026-11-24).
Compact video-call tray and map locate button with progressive fallback
<!-- Floating call tray: compact icon-only camera & microphone buttons -->
<div class="call-tray" role="toolbar" aria-label="Media controls">
<camera id="cam-btn" displayhint="icon-only">
<!-- Light-DOM fallback for browsers without <camera> -->
<button type="button" id="cam-fallback">Enable camera</button>
</camera>
<microphone id="mic-btn" displayhint="icon-only">
<button type="button" id="mic-fallback">Enable microphone</button>
</microphone>
</div>
<!-- Compact map corner control -->
<geolocation id="loc-btn" displayhint="icon-only" accuracymode="precise">
<button type="button" id="loc-fallback">Use my location</button>
</geolocation>
<style>
.call-tray {
display: flex;
flex-wrap: wrap; /* Prevents clipping if older Chrome renders text labels */
gap: 0.5rem;
align-items: center;
}
camera[displayhint="icon-only"],
microphone[displayhint="icon-only"],
geolocation[displayhint="icon-only"] {
/* Icon scales with font-size (UA icon height is 1.3em); keep >= 44px tap target */
font-size: 1.25rem;
border-radius: 999px;
background-color: #111827;
color: #ffffff;
border: 2px solid #374151;
}
</style>
Source: Chromium capability_element.css; ChromeStatus 5107682460696576.
Toggling displayhint dynamically across viewport breakpoints
const cam = document.getElementById("cam-btn");
const compactQuery = window.matchMedia("(max-width: 480px)");
function syncDisplayHint(e) {
if (!("HTMLCameraElement" in window)) return;
if (e.matches) {
// Collapses to icon-only while preserving the browser's localized accessible name
cam.setAttribute("displayhint", "icon-only");
} else {
// Restores the default icon + localized text button
cam.removeAttribute("displayhint");
}
}
syncDisplayHint(compactQuery);
compactQuery.addEventListener("change", syncDisplayHint);
// Handle captured track / errors identically in icon-only and default modes
cam.addEventListener("track", () => {
console.log("Camera track ready:", cam.track?.label);
});
cam.addEventListener("error", () => {
console.warn("Camera capability error:", cam.error?.name);
});
Source: Chromium html_capability_element_base.cc (ParseAttribute); html_capability_element_base_test.cc.
Browser compatibility
| Browser | displayhint="icon-only" | Notes & evidence |
|---|---|---|
| Chrome (desktop, Android) | 160 | Listed under “Enabled by default” in ChromeStatus milestone=160 (Finch CapabilityElementIconOnlyMode); trunk runtime_enabled_features.json5 still shows status: "experimental" as of 2026-11-24. Android WebView and iOS are unconfirmed (null). |
| Edge | Unknown | Chromium-based; no separate public release signal recorded |
| Firefox | No | Capability elements not implemented; ChromeStatus records “No signal” |
| Safari | No | Capability elements not implemented; ChromeStatus records “No signal” |
Security and privacy
Icon-only mode preserves the full security and anti-clickjacking architecture of Capability Elements:
- No spoofable copy or iconography: Authors cannot replace the browser-rendered camera, microphone, or location glyph, nor inject custom visible label text into the internal shadow tree.
- Preserved anti-clickjacking checks: Clicking still requires a trusted user gesture on an unobstructed, legible, properly contrasted control passing Blink’s intersection, opacity, transform, and minimum-size validation checks; attribute mutations still keep existing validation safeguards active.
- Assistive-technology integrity: Because Chromium exposes the browser-owned localized
AccessibleLabel()to the accessibility tree even when visible text is hidden, screen-reader users still hear the true permission action rather than a silent or author-spoofed icon button. - No new privilege surface:
displayhint="icon-only"does not expand permission grants, add new sensor access, or introduce cross-origin information channels.
Specifications
| Specification / artifact | Status & scope |
|---|---|
| Media Capture and Streams Extensions — PR #184 (PR preview) | Open draft PR specifying displayhint for media capture elements (note draft enum divergence from Chromium’s "icon-only" value) |
| Media Capture and Streams Extensions — Media capture HTML elements | W3C Working Draft defining base <camera>, <microphone>, and <usermedia> elements |
WICG Permission Elements — <geolocation> element | Community Group draft defining HTMLGeolocationElement |
see also
- gendn Chrome 153 — Capability elements: <camera> and <microphone>
- gendn Chrome 151 — Capability elements: <usermedia> MVP
- MDN —
<geolocation>element - Media Capture Elements explainer
- ChromeStatus — Base Capability Elements (<camera> and <microphone>, 5153829504024576)
- ChromeStatus — Capability Elements Icon-only mode (5107682460696576)