v141 · css · pseudo-elements

The `::interest-button` pseudo element

Interest invokers let a link or button show a hovercard on hover, focus or long-press — but on a phone, long-pressing a link opens the browser’s context menu first. ::interest-button is an opt-in, fully styleable pseudo-element that sits right after an interest invoker; tapping it shows interest immediately, with no delay and no context menu. It only exists on valid interest sources, is deliberately not focusable, and never enters the accessibility tree.

Behind a flag today. ChromeStatus lists this as Proposed; the Blink runtime feature HTMLInterestForInterestButtonPseudo is experimental. To run these demos for real: enable chrome://flags/#enable-experimental-web-platform-features and relaunch, or launch Chrome with --enable-blink-features=HTMLInterestForInterestButtonPseudo (or --enable-experimental-web-platform-features). There is no dedicated chrome://flags entry. Every page probes the generated box’s geometry — not CSS.supports(), which already returns true without the flag.

concepts

  1. The ⓘ opt-in

    The spec’s own example, live: a link and a button with interest targets, a content switch (none, "ⓘ" / "", a text label) and a gate switch (always, or only under @media (any-pointer: coarse)). Watch the box appear, then tap it and see interest shown at once.

  2. Originating-element inspector

    An inspection table of nine candidate hosts — enabled and disabled buttons, links with and without href, a div, input type=button, a dangling interestfor id — showing computed content versus the box that is actually generated. Includes the detection gotcha (CSS.supports lies) and the ::after → ::interest-button ordering.

  3. Touch link hovercards

    The product use case: an article whose people and project links carry hovercards. On touchscreens a ⓘ appears after each link — tap it to preview, tap the link text to navigate. A readout proves the ⓘ tap did not follow the link; an honestly-labelled toggletip fallback covers browsers without the pseudo.

  4. Activation event order

    The edges: what events the originating element receives when its ⓘ is pressed, how preventDefault() on the click or on interest cancels it, why interest-delay: 1000s doesn’t slow it down, why Tab skips it, and how removing interestfor removes the box.

  5. Anchored to the glyph

    Composition: product cards with the ⓘ absolutely positioned in each card’s corner, a popover=hint placed with position-area, and :interest-source styling. A geometry readout measures whether the card anchored to the invoker or to the ⓘ — the spec says the ⓘ.

why it shipped

Showing interest on touchscreens is cumbersome: long-pressing a link brings up the native context menu, and the user has to find a “Show details” item in it. Developers asked for a one-tap path but also said an extra button isn’t always appropriate (constrained layouts, truly secondary information), so the button is opt-in: it renders only when you give ::interest-button a content value. Because all the information it conveys is already on the originating element, it stays out of the focus order and the accessibility tree.

the API

<a href="/users/mfreed7" interestfor="profile">@mfreed7</a>
<div id="profile" popover="hint">Profile hovercard</div>

<style>
  @media (any-pointer: coarse) {
    a[interestfor]::interest-button {
      content: "ⓘ" / "";   /* opt in; empty alt text */
    }
  }
</style>

references