State diagram showing how an HTML popover enters the top layer after validation and returns to the hidden state when dismissed.

A Popover Opened. Which Element Actually Entered the Top Layer?

Mon, Nov 23, 2026

A non-throwing showPopover() call is a weak success signal. MDN’s showPopover() reference says showPopover() returns undefined, while the HTML Living Standard defines the meaningful transition deeper in the algorithm: validate the exact element, add that element to the document’s top layer, set its popover visibility state to showing, run popover focus steps, and later queue the toggle event. The same standard defines light dismiss for auto and hint popovers around trusted pointer events, not arbitrary JavaScript-dispatched lookalikes.

That distinction changes release validation. The question is not “did a popover appear?” It is: which element changed state, what evidence connects that identity to the normative top-layer transition, what dismissal route occurred, and where did focus belong before and after it? The browser does not expose a normal JavaScript collection that lets application code enumerate the top layer, so this playbook deliberately builds a state-and-identity proof from independent signals rather than pretending there is a direct document.topLayer probe. The proof uses :popover-open, exact event targets, a rendering-order comparison, trusted automation input, focus snapshots, and a negative control.

No browser fixture described below was executed as part of this research. Every proposed runtime outcome is therefore EXPECTED / NOT EXECUTED. The release decision is consequently HOLD, not because the documented behavior is uncertain, but because documentation and expectations are not substitutes for case evidence from the pinned runtime.

Define the operational contract

The contract starts with four independent dimensions: element identity, popover state, top-layer consequence, and interaction boundary. The HTML Standard, last updated November 22, 2026, says showPopover() shows the popover by adding it to the top layer. In the normative “show popover” algorithm, the exact element supplied to that operation is added to the top layer before its popover visibility state becomes showing; focus processing follows. The standard later derives showing auto/hint popover lists by iterating the document’s top layer and selecting elements with the corresponding opened mode and showing state.

That gives us a falsifiable contract, but not a direct inspection API. Acceptance therefore requires agreement among signals that answer different questions:

Contract dimension

Required evidence

Rejection condition

Status

Identity

Stable DOM id, event target.id, fixture case ID

Event/state belongs to another element

EXPECTED / NOT EXECUTED

Showing state

element.matches(":popover-open") === true after show

False after completed show step

EXPECTED / NOT EXECUTED

Top-layer consequence

Exact popover wins controlled hit-test against ordinary extreme-z-index sentinel

Ordinary sentinel still wins while popover claims open

EXPECTED / NOT EXECUTED

Light dismiss

pointerdown and pointerup captured with isTrusted === true, same outside relationship, auto popover closes

Synthetic DOM event is treated as qualifying proof, or auto stays open

EXPECTED / NOT EXECUTED

Focus boundary

document.activeElement captured before show, after show, after dismissal/hide

Focus outcome contradicts the case’s specified route

EXPECTED / NOT EXECUTED

MDN’s July 17, 2026 showPopover() page explicitly states that the method returns undefined, so a successful function return cannot itself tell us which popover is showing. By contrast, current MDN documents togglePopover() as returning true when open and false when closed, with undefined possible on older browser versions. That contrast is useful diagnostically: do not retrofit Boolean semantics onto showPopover().

The same validation discipline appears in the CSS @starting-style lifecycle playbook: visible final state is not accepted when the lifecycle evidence is missing. This article keeps that evidence-gate method but applies it to a different object: popover identity, showing state, trusted dismissal and focus.

Capture a versioned baseline

A reproducible result needs a dated browser runtime, not “latest Chrome.” The fixture pins Node.js 26.13.1 LTS, whose official release page dates that version to November 11, 2026, and Playwright 1.65.1, whose November 13 release lists its bundled Chromium as 159.0.8154.6. The version pin applies specifically to Playwright-bundled Chromium.

The documentation baseline is separately pinned. WHATWG HTML is a Living Standard and showed a last update of November 22, 2026 when checked on November 23. MDN’s showPopover() and togglePopover() pages were last modified July 17, 2026; the ::backdrop reference was last modified May 21, 2026. Those different dates are not a defect, but they are a reason to prefer the current normative algorithm when details matter.

The baseline file should be committed before test logic:

{
  "name": "popover-top-layer-fixture",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "engines": {
    "node": "26.13.1"
  },
  "scripts": {
    "test": "playwright test --project=chromium --reporter=line"
  },
  "devDependencies": {
    "@playwright/test": "1.65.1"
  }
}

And .nvmrc:

26.13.1

The reproducible shell sequence is:

mkdir popover-top-layer-fixture
cd popover-top-layer-fixture

printf '26.13.1\n' > .nvmrc
# Activate Node 26.13.1 with your organization-approved version manager.

npm init -y
npm install --save-dev --save-exact @playwright/[email protected]
npx playwright install chromium

node --version
# EXPECTED / NOT EXECUTED: v26.13.1

npx playwright --version
# EXPECTED / NOT EXECUTED: Version 1.65.1

npx playwright test --project=chromium --reporter=line
# EXPECTED / NOT EXECUTED: test execution produces per-case artifacts.

Version mismatch is not a cosmetic warning. It changes the evidence population. A run on another browser build may be valuable, but it is a RERUN candidate against a newly declared baseline rather than evidence for this one.

Pin fixture identity

The measurable assertion is: the manifest hash, fixture file hash, package-lock hash, Node version, Playwright version and browser version recorded with every case must equal the values declared for that run.

Add a preflight record:

sha256sum package.json package-lock.json fixture.html tests/popover.spec.mjs \
  > artifacts/input-sha256.txt

node --version > artifacts/node-version.txt
npx playwright --version > artifacts/playwright-version.txt

Reject the evidence set if any case lacks those identifiers, if files change between cases, or if the test report does not identify Chromium 159.0.8154.6. Such a set is HOLD until provenance is restored, or RERUN if the drift was intentional. All values above remain EXPECTED / NOT EXECUTED.

Build the isolated test environment

The fixture is disposable by design: one document, no framework, no application CSS, no network dependency and no production data. It contains two auto popovers, one manual popover, one ordinary overlay for the negative control, one outside target, and a high-z-index sentinel that can be enabled only for layering comparisons.

fixture.html:

<!doctype html>
<meta charset="utf-8">
<title>Popover top-layer fixture</title>

<style>
  html, body {
    margin: 0;
    min-height: 100%;
    font: 16px system-ui, sans-serif;
  }

  body {
    min-height: 100vh;
    padding: 24px;
  }

  #outside {
    position: fixed;
    right: 24px;
    bottom: 24px;
  }

  [popover],
  #plainOverlay {
    position: fixed;
    inset: 120px auto auto 120px;
    width: 260px;
    min-height: 120px;
    box-sizing: border-box;
    padding: 20px;
    border: 4px solid;
    background: white;
  }

  #plainOverlay {
    display: none;
    z-index: 1;
  }

  #plainOverlay.visible {
    display: block;
  }

  #zSentinel {
    display: none;
    position: fixed;
    inset: 100px auto auto 100px;
    width: 320px;
    height: 180px;
    z-index: 2147483647;
    background: rgba(255, 0, 0, 0.15);
  }

  #zSentinel.enabled {
    display: block;
  }

  #autoA::backdrop,
  #autoB::backdrop,
  #manualA::backdrop {
    background: rgba(0, 0, 0, 0.04);
  }
</style>

<button id="sourceA">Source A</button>
<button id="sourceB">Source B</button>
<button id="outside">Outside target</button>

<div id="plainOverlay">
  <button id="plainInside">Plain overlay</button>
</div>

<div id="zSentinel">ordinary z-index sentinel</div>

<div id="autoA" popover="auto">
  <button id="insideA" autofocus>Inside A</button>
</div>

<div id="autoB" popover="auto">
  <button id="insideB">Inside B</button>
</div>

<div id="manualA" popover="manual">
  <button id="insideManual">Inside manual</button>
</div>

After the markup in fixture.html, add a script element with its type set to module. Place the following JavaScript inside that element.

const ids = ["autoA", "autoB", "manualA"];
const ledger = [];
window.__ledger = ledger;

const $ = (id) => document.getElementById(id);
const idOf = (node) => node?.id || null;

function snapshot(label, id = null) {
  const element = id ? $(id) : null;
  const record = {
    kind: "snapshot",
    label,
    elementId: id,
    open: element ? element.matches(":popover-open") : null,
    display: element ? getComputedStyle(element).display : null,
    activeId: idOf(document.activeElement),
    ts: performance.now()
  };
  ledger.push(record);
  return record;
}

for (const id of ids) {
  const el = $(id);

  for (const type of ["beforetoggle", "toggle"]) {
    el.addEventListener(type, (event) => {
      ledger.push({
        kind: "toggle-event",
        type,
        targetId: idOf(event.target),
        oldState: event.oldState,
        newState: event.newState,
        sourceId: idOf(event.source),
        openAtEvent: el.matches(":popover-open"),
        activeId: idOf(document.activeElement),
        ts: performance.now()
      });
    });
  }
}

for (const type of ["pointerdown", "pointerup", "click"]) {
  document.addEventListener(type, (event) => {
    ledger.push({
      kind: "pointer-event",
      type,
      targetId: idOf(event.target),
      isTrusted: event.isTrusted,
      activeId: idOf(document.activeElement),
      ts: performance.now()
    });
  }, true);
}

window.fixture = {
  reset() {
    for (const id of ids) {
      const el = $(id);
      if (el.matches(":popover-open")) el.hidePopover();
    }
    $("plainOverlay").classList.remove("visible");
    $("zSentinel").classList.remove("enabled");
    ledger.length = 0;
    $("sourceA").focus();
    return snapshot("reset");
  },

  show(id, sourceId = "sourceA") {
    const result = $(id).showPopover({ source: $(sourceId) });
    return {
      returnValue: result,
      snapshot: snapshotafter-show:${id}, id)
    };
  },

  hide(id) {
    $(id).hidePopover();
    return snapshotafter-hide:${id}, id);
  },

  enableSentinel() {
    $("zSentinel").classList.add("enabled");
  },

  disableSentinel() {
    $("zSentinel").classList.remove("enabled");
  },

  showPlain() {
    $("plainOverlay").classList.add("visible");
  },

  hitAt(id) {
    const r = $(id).getBoundingClientRect();
    const node = document.elementFromPoint(
      r.left + r.width / 2,
      r.top + r.height / 2
    );
    return idOf(node);
  },

  state(id) {
    return snapshotstate:${id}, id);
  }
};

The HTML dialog focus lifecycle playbook is a useful adjacent reference, but its subject is modal <dialog> behavior. Popover API content is non-modal; MDN explicitly distinguishes popovers from modal dialogs. Do not copy dialog focus expectations into this fixture.

Author the expected-case manifest

The manifest must be written before runtime output exists. Otherwise the “expected” column can become a transcription of whatever the browser happened to do.

The current standard’s focus steps are narrower than many engineers intuit. For a non-dialog popover, the algorithm looks for autofocus on the subject or an autofocus delegate; if no control results, the focus steps return. Therefore “opening a popover focuses its first button” is not an acceptable general rule.

The independent manifest is:

Case

Setup and action

Expected identity/state evidence

Expected focus/dismissal evidence

Status

P1

Focus sourceA; autoA.showPopover({source: sourceA})

autoA gets beforetoggle closed→open; autoA.matches(":popover-open") true; call returns undefined

insideA receives focus because it has autofocus

EXPECTED / NOT EXECUTED

P2

P1 plus enable high-z sentinel

Exact open popover remains the candidate rendering above ordinary document stacking

Hit-test at insideA region resolves inside autoA, not sentinel

EXPECTED / NOT EXECUTED

N1

Show ordinary plainOverlay; enable sentinel

Plain element is not :popover-open; sentinel wins hit-test

No popover lifecycle events

EXPECTED / NOT EXECUTED

N2

Call showPopover() on element with no popover state

Operation rejects rather than creating a valid popover

NotSupportedError expected from normative validity check

EXPECTED / NOT EXECUTED

D1

Show autoA; real automated pointer click on outside

autoA transitions open→closed

Captured pointer events must have isTrusted=true; clicked outside target may own focus

EXPECTED / NOT EXECUTED

D2

Show manualA; click outside

manualA remains showing

Outside click does not light-dismiss manual popover

EXPECTED / NOT EXECUTED

F1

Focus sourceA; show autoB with no autofocus descendant

autoB shows

Focus need not move to insideB; record exact active element

EXPECTED / NOT EXECUTED

F2

Focus sourceA; show autoA; call hidePopover() while focus remains inside

autoA closes

Previous focus may be restored under the standard’s restoration preconditions

EXPECTED / NOT EXECUTED

S1

Show unrelated autoA, then show autoB

autoA closes as autoB opens

Ledger proves identities separately; no inference from appearance

EXPECTED / NOT EXECUTED

The N2 expectation comes directly from the standard’s popover validity algorithm: if an element’s popover attribute is in the No Popover state, the algorithm throws NotSupportedError.

Prove the negative control

The measurable assertion is: with no popover state involved, the ordinary #plainOverlay must lose a same-coordinate hit-test to #zSentinel, while the controlled popover case is expected to reverse that ordering.

The rejection condition is any of the following: plainOverlay.matches(":popover-open") becomes true; the ordinary overlay wins despite the sentinel; or the positive comparison and negative control produce the same unexplained hit-test result. In those states, the rendering witness is not discriminating enough to support a top-layer inference. Decision: REPAIR the fixture if the control is malformed; HOLD if the cause cannot be established. Current result: EXPECTED / NOT EXECUTED.

Reproduce the misleading success

The misleading pattern is deliberately simple:

const result = autoA.showPopover({ source: sourceA });

console.log(result);
// EXPECTED / NOT EXECUTED: undefined

console.log("opened");

The log line can execute after a non-throwing call, but it proves almost nothing about identity beyond the variable the caller thinks it used. MDN defines the return value of showPopover() as undefined; it is not an “opened” token. The actual browser state must be interrogated independently.

The corrected probe is:

sourceA.focus();

const before = {
  activeId: document.activeElement?.id ?? null,
  autoAOpen: autoA.matches(":popover-open"),
  autoBOpen: autoB.matches(":popover-open")
};

const returnValue = autoA.showPopover({ source: sourceA });

const after = {
  returnValue,
  activeId: document.activeElement?.id ?? null,
  autoAOpen: autoA.matches(":popover-open"),
  autoBOpen: autoB.matches(":popover-open")
};

Expected record:

{
  "before": {
    "activeId": "sourceA",
    "autoAOpen": false,
    "autoBOpen": false
  },
  "after": {
    "returnValue": null,
    "activeId": "insideA",
    "autoAOpen": true,
    "autoBOpen": false
  },
  "status": "EXPECTED / NOT EXECUTED"
}

In JSON, JavaScript undefined fields disappear unless normalized; the harness should therefore serialize the return separately as a string or explicit diagnostic field rather than quietly turning “no value” into ambiguous evidence.

The key release habit is to capture state on the exact node referenced by the case manifest. A generic selector such as document.querySelector("[popover]:popover-open") can tell you that something is open while still hiding an identity bug. If autoB opened instead of autoA, a generic success probe can be green while the contract is false.

The state transition can be modeled as follows:

second-img-popover

The diagram is a model of the documented algorithm, not evidence that Chromium executed those steps in this fixture. EXPECTED / NOT EXECUTED.

Run a controlled positive comparison

Top-layer membership is the hardest part of this problem because application JavaScript does not get a simple authoritative top-layer enumeration. The defensible approach is to combine normative state knowledge with a rendering consequence that would be difficult for ordinary stacking to imitate in the same fixture.

MDN describes ::backdrop as a viewport-sized box rendered immediately beneath an element presented in the top layer and explicitly includes popovers shown through showPopover() among the cases that receive it. That makes backdrop behavior useful corroboration, but it does not provide a direct membership API.

A stronger controlled comparison uses ordinary stacking. Enable #zSentinel at z-index: 2147483647, positioned over both the ordinary overlay and popover geometry. For the negative control, the sentinel should win over #plainOverlay. For P2, autoA is expected to participate in top-layer painting and win the same-coordinate hit test despite the ordinary sentinel.

Playwright test fragment:

import { test, expect } from "@playwright/test";
import path from "node:path";
import { pathToFileURL } from "node:url";

const fixtureURL =
  pathToFileURL(path.resolve("fixture.html")).href;

test("P2 controlled positive comparison", async ({ page, browserName }) => {
  await page.goto(fixtureURL);

  await page.evaluate(() => {
    fixture.reset();
    fixture.enableSentinel();
    fixture.show("autoA", "sourceA");
  });

  const evidence = await page.evaluate(() => ({
    open: autoA.matches(":popover-open"),
    hit: fixture.hitAt("insideA"),
    activeId: document.activeElement?.id ?? null,
    ledger: structuredClone(window.__ledger)
  }));

  expect(evidence.open).toBe(true);
  expect(["insideA", "autoA"]).toContain(evidence.hit);

  console.log(JSON.stringify({
    caseId: "P2",
    browserName,
    evidence
  }, null, 2));
});

Expected: autoA is open and the hit resolves to insideA or another node belonging to autoA, not zSentinel. EXPECTED / NOT EXECUTED.

This is a comparison, not a logical proof in isolation. Its value comes from N1 establishing that the same sentinel defeats ordinary content. That two-case structure is the difference between “the popover looked on top” and a falsifiable rendering-order witness.

The CSS transition cancellation lifecycle playbook uses the same operational principle: distinguish lifecycle branches explicitly instead of allowing one final visual state to erase how it was reached.

Retain failed case artifacts

The measurable assertion is: every failing case must preserve the input identity, raw browser event ledger, Playwright trace or equivalent deterministic execution artifact, runtime versions and failure assertion before any repair is attempted.

Recommended invocation:

mkdir -p artifacts

npx playwright test \
  --project=chromium \
  --reporter=json \
  > artifacts/playwright-report.json
# EXPECTED / NOT EXECUTED

For a failed case, retain the unedited window.__ledger JSON and version/hash files. Reject any failure analysis based only on a screenshot, console paraphrase, or rerun that overwrote the original evidence. Missing original artifacts turns a potentially REPAIR diagnosis into HOLD.

Test negative and boundary cases

Light dismiss requires special care because the standard explicitly begins its light-dismiss algorithm by asserting that the incoming PointerEvent has isTrusted === true. It stores the topmost clicked popover relationship on pointerdown, checks the relationship again on pointerup, and returns without dismissing if the two do not match.

That means this is not a qualifying light-dismiss test:

outside.dispatchEvent(new PointerEvent("pointerdown", { bubbles: true }));
outside.dispatchEvent(new PointerEvent("pointerup", { bubbles: true }));

Those events are application-created. The fixture should instead use browser automation input and record isTrusted rather than assuming the automation route qualifies:

test("D1 auto light dismiss", async ({ page }) => {
  await page.goto(fixtureURL);

  await page.evaluate(() => {
    fixture.reset();
    fixture.show("autoA", "sourceA");
  });

  await page.locator("#outside").click();

  const evidence = await page.evaluate(() => ({
    autoAOpen: autoA.matches(":popover-open"),
    activeId: document.activeElement?.id ?? null,
    pointerEvents: window.__ledger.filter(
      x => x.kind === "pointer-event"
    ),
    ledger: structuredClone(window.__ledger)
  }));

  expect(evidence.pointerEvents.some(
    x => x.type === "pointerdown" && x.isTrusted === true
  )).toBe(true);

  expect(evidence.pointerEvents.some(
    x => x.type === "pointerup" && x.isTrusted === true
  )).toBe(true);

  expect(evidence.autoAOpen).toBe(false);
});

Expected D1: trusted pointer evidence is present and autoA is closed after an outside click. EXPECTED / NOT EXECUTED.

Then run D2 unchanged except for the target:

fixture.show("manualA", "sourceA");

Expected D2: after the same outside automation click, manualA.matches(":popover-open") === true. The standard defines light dismiss for auto and hint popovers; MDN separately describes manual popovers as not light-dismissible. EXPECTED / NOT EXECUTED.

Focus boundaries need two distinct routes. Showing autoA is expected to focus insideA because of its autofocus. Showing autoB has no equivalent autofocus target, so the fixture must not invent a “first button” rule. For recovery, the hide algorithm restores the previously focused element only under conditions that include focusPreviousElement being true and focus still being a shadow-including descendant of the popover.

Light dismiss is different again: the standard’s light-dismiss path invokes “hide popovers until” with focus restoration disabled in that path. An outside click also naturally places focus according to normal pointer activation behavior. Therefore D1 should capture where focus actually lands rather than assert that the opener must regain it.

Capture a complete evidence ledger

Record the evidence in a machine-readable ledger before summarizing it in prose. Every case needs the same schema so missing facts are detectable mechanically.

Field

Purpose

Example expected value

Status

caseId

Stable join key to manifest

D1

EXPECTED / NOT EXECUTED

fixtureSha256

Proves tested source identity

64-char digest

EXPECTED / NOT EXECUTED

nodeVersion

Runtime provenance

v26.13.1

EXPECTED / NOT EXECUTED

playwrightVersion

Harness provenance

1.65.1

EXPECTED / NOT EXECUTED

browserVersion

Browser pin

159.0.8154.6

EXPECTED / NOT EXECUTED

targetId

Popover identity

autoA

EXPECTED / NOT EXECUTED

returnKind

Avoids treating undefined as success

undefined

EXPECTED / NOT EXECUTED

beforeOpen

Initial state

false

EXPECTED / NOT EXECUTED

afterOpen

Showing-state witness

true

EXPECTED / NOT EXECUTED

hitTargetId

Layering comparison

insideA or autoA

EXPECTED / NOT EXECUTED

pointerTrusted

Light-dismiss admissibility

true for down/up

EXPECTED / NOT EXECUTED

activeBefore

Focus baseline

sourceA

EXPECTED / NOT EXECUTED

activeAfterShow

Focus result

case-specific

EXPECTED / NOT EXECUTED

activeAfterClose

Focus boundary result

case-specific

EXPECTED / NOT EXECUTED

eventSequence

Lifecycle identity

target + old/new state

EXPECTED / NOT EXECUTED

verdict

Case reconciliation

pass/fail/incomplete

EXPECTED / NOT EXECUTED

A proposed evidence object:

{
  caseId: "D1",
  manifestVersion: "2026-11-23.1",
  fixtureSha256: "<recorded at run>",
  runtime: {
    node: "26.13.1",
    playwright: "1.65.1",
    chromium: "159.0.8154.6"
  },
  targetId: "autoA",
  before: {
    open: false,
    activeId: "sourceA"
  },
  afterShow: {
    open: true,
    activeId: "insideA"
  },
  afterInput: {
    open: false,
    activeId: "outside"
  },
  pointer: {
    downTrusted: true,
    upTrusted: true
  },
  verdict: "EXPECTED / NOT EXECUTED"
}

The values shown are manifest expectations, not observations.

Detect missing evidence

The measurable assertion is: each manifest case must produce exactly one reconciled ledger row containing all fields marked mandatory for that case; no mandatory field may be inferred from another case.

A minimal checker can be independent of the browser test:

const required = {
  P1: ["targetId", "before", "afterShow", "eventSequence"],
  P2: ["targetId", "afterShow", "hitTargetId"],
  N1: ["targetId", "hitTargetId"],
  N2: ["targetId", "exceptionName"],
  D1: ["targetId", "pointer", "afterInput", "eventSequence"],
  D2: ["targetId", "pointer", "afterInput"],
  F1: ["targetId", "afterShow"],
  F2: ["targetId", "afterClose"],
  S1: ["targetId", "eventSequence", "afterShow"]
};

Withhold release acceptance if a row is absent, duplicated without an explicit rerun ID, missing provenance, or missing a field required by its manifest case. The correct decision for incomplete evidence is HOLD, not “probably pass.” Current ledger: EXPECTED / NOT EXECUTED.

Reconcile identity and state

Reconciliation asks whether the evidence forms one coherent story about the same element.

For P1, a valid chain would be: manifest says targetId=autoA; beforetoggle.target.id is autoA; its transition is closed→open; autoA.matches(":popover-open") becomes true; autoB remains false; the positive layering witness belongs to the geometry of autoA; focus moves to insideA, which is a descendant of autoA. Every link retains identity.

S1 catches the bug class that a single open selector cannot. The standard says showing an unrelated auto popover can close other auto popovers unless the relationship makes one an ancestor. The expected ledger should therefore distinguish:

autoA: closed -> open
autoA: open   -> closed
autoB: closed -> open

EXPECTED / NOT EXECUTED.

If the application later reads only:

document.querySelector(":popover-open")

it may find autoB and conclude “the popover is open.” That statement loses the exact property under test: which element entered the showing/top-layer lifecycle.

ARIA-disabled command-admission validation makes a similar distinction. The disabled state, keyboard focus, and whether the command actually runs each need their own check.

The distinction also explains why ::backdrop alone is insufficient. MDN says each top-layer element has its own backdrop, but a visual or computed pseudo-element property does not hand application code the browser’s internal top-layer stack. Treat the backdrop as corroboration; treat exact state/event identity plus controlled stacking behavior as the operational evidence bundle.

Separate guarantees from observations

Three kinds of evidence matter when making this release decision.

Documented behavior. The current WHATWG algorithm adds the element being shown to the top layer, sets its popover visibility state to showing, performs focus steps and queues the toggle event. It defines light dismiss around trusted pointer input for auto/hint popovers. MDN documents showPopover() as returning undefined, identifies ::backdrop as associated with top-layer presentation, and documents togglePopover()’s current Boolean result.

Expectation. In the pinned Chromium 159.0.8154.6 fixture, P1 is expected to show autoA, P2 is expected to beat the ordinary stacking sentinel, D1 is expected to light-dismiss through trusted pointer input, D2 is expected to stay open, F1 is expected not to acquire arbitrary first-control focus, and F2 is expected to exercise conditional programmatic focus restoration. All of these are EXPECTED / NOT EXECUTED.

Observation. There are no browser observations in this article. No test output, trace, screenshot, event sequence or runtime ledger was generated during the research. Therefore there is no defensible observed pass.

There is also a documentation-timing boundary. WHATWG is a Living Standard updated November 22, while the MDN pages cited here carry May or July modification dates. The sources align on the core behavior used in this playbook, but those dates reflect separate documentation updates.

Bound the repair

The measurable assertion is: a repair may change only the smallest layer demonstrated faulty by evidence (fixture construction, application target selection, popover mode, focus policy, or evidence collection) and must not rewrite the pre-authored expectation to make a failed observation pass.

Reject any repair that changes both product behavior and oracle in one unreviewed patch, removes the negative control, replaces trusted input with dispatchEvent(), broadens selectors until “some popover” passes, or silently changes the pinned browser. Such changes destroy causal isolation. Current repair status: EXPECTED / NOT EXECUTED.

Apply a bounded repair

A useful repair taxonomy begins with the failing evidence boundary.

If the intended autoA never becomes :popover-open and showPopover() throws NotSupportedError, inspect the target’s popover state and element identity; do not add retries. The standard’s validity check makes that exception meaningful.

If autoB opened instead, repair the reference path:

const popover = document.getElementById(expectedPopoverId);

if (!popover || popover.id !== expectedPopoverId) {
  throw new Errorpopover identity mismatch: ${expectedPopoverId});
}

popover.showPopover({ source });

If D1 fails because pointer ledger entries have isTrusted: false, repair the harness input route. Do not weaken the expected manifest to accept artificial DOM events, because the normative light-dismiss algorithm explicitly assumes trusted input.

If P2 and N1 both lose to the sentinel, repair the fixture geometry before diagnosing the browser. The positive and negative probes must hit equivalent overlap regions. If P2 wins but N1 also wins, the negative control is invalid and the top-layer rendering inference cannot be accepted.

If F1 unexpectedly moves focus, first capture the target and autofocus state rather than adding sourceA.focus() after every show. That post-hoc focus write would mask the browser behavior being measured. The standard’s popover focus procedure is explicit about autofocus delegation; the repair must respect the intended product focus contract rather than force a test outcome.

Every repair produces a new artifact identity. The original failed ledger remains immutable. The new test run receives a distinct runId and, where source changed, a new fixture hash. The old result does not disappear merely because a later patch passes.

Test rollback and recovery

Recovery is not “close whatever is open and continue.” It is a deterministic return to the pre-case baseline.

The fixture recovery protocol is:

async function recover(page) {
  return page.evaluate(() => {
    for (const id of ["autoA", "autoB", "manualA"]) {
      const el = document.getElementById(id);
      if (el.matches(":popover-open")) {
        el.hidePopover();
      }
    }

    plainOverlay.classList.remove("visible");
    zSentinel.classList.remove("enabled");
    sourceA.focus();

    return {
      autoA: autoA.matches(":popover-open"),
      autoB: autoB.matches(":popover-open"),
      manualA: manualA.matches(":popover-open"),
      activeId: document.activeElement?.id ?? null
    };
  });
}

Recovery acceptance is:

{
  "autoA": false,
  "autoB": false,
  "manualA": false,
  "activeId": "sourceA",
  "status": "EXPECTED / NOT EXECUTED"
}

Do not use page reload as the only cleanup mechanism. A reload may be useful between cases, but a recovery assertion verifies that your own hide path can restore the declared baseline. That matters because the standard’s hide algorithm removes the popover from the top-layer lifecycle, sets visibility hidden, clears trigger/anchor state and conditionally handles previous focus.

Rollback also needs a damaged-state case. For example, after P1, intentionally call recovery while focus is still in insideA; separately run it after the outside target has taken focus. These are distinct focus situations. The hide algorithm does not promise unconditional focus restoration, so the ledger must preserve which precondition existed.

CSS anchor positioning addresses placement and fallback geometry. In this rollback test, geometry serves one purpose: the controlled hit-test helps identify which element is showing.

The intended test timeline is:

third-img-popover

Every timeline outcome is EXPECTED / NOT EXECUTED.

Assign rerun ownership

The measurable assertion is: each RERUN record names the reason, exact target baseline, artifact set and accountable engineering role before execution. A reasonable role is “frontend release-validation owner” or the owning component team.

Reject a rerun request phrased only as “try again,” “test latest,” or “see whether it flakes.” A rerun must state whether it addresses version drift, repaired fixture code, browser-engine comparison or missing evidence. Otherwise repeated execution risks laundering uncertainty into apparent confidence. Current rerun assignment: EXPECTED / NOT EXECUTED.

Decide ACCEPT, REPAIR, RERUN or HOLD

The gate is intentionally stricter than “tests green.” Each decision says what kind of evidence exists and what action follows.

Decision

Required condition

Release action

ACCEPT

Every required case executed on the exact pinned runtime; negative control discriminates correctly; exact target identity reconciles with state, events, layering witness, dismissal and focus; recovery passes; artifacts complete

Admit this runtime/fixture contract

REPAIR

Evidence identifies a bounded defect in fixture or application behavior and the expected manifest remains valid

Patch only the demonstrated boundary; preserve failure artifacts; run a new case set

RERUN

Evidence is structurally sound but belongs to a changed runtime, or a declared repair creates a new artifact identity requiring validation

Execute the full affected manifest under the newly declared baseline

HOLD

No execution, incomplete artifacts, contradictory signals, broken negative control, unqualified pointer input, unknown versions or unresolved source/fixture ambiguity

Do not claim release acceptance

The release decision is HOLD. The fixture, manifest, controls and ledger are defined, but no run was executed on the pinned Chromium build. Every runtime result in the article is therefore EXPECTED / NOT EXECUTED. Documentation proves what the platform specifies; it does not prove that this particular fixture produced those observations.

The full acceptance reconciliation should read case by case:

Case

Required gate evidence

Current status

Decision if unchanged

P1 exact show

Correct target/event identity, :popover-open, focus

EXPECTED / NOT EXECUTED

HOLD

P2 layering comparison

Popover wins while N1 loses

EXPECTED / NOT EXECUTED

HOLD

N1 ordinary negative

Sentinel beats ordinary overlay

EXPECTED / NOT EXECUTED

HOLD

N2 invalid element

Expected exception captured

EXPECTED / NOT EXECUTED

HOLD

D1 auto dismiss

Trusted down/up plus closed state

EXPECTED / NOT EXECUTED

HOLD

D2 manual boundary

Trusted outside click plus still-open state

EXPECTED / NOT EXECUTED

HOLD

F1 no-autofocus

Exact active-element snapshot

EXPECTED / NOT EXECUTED

HOLD

F2 hide recovery

Precondition plus post-hide focus

EXPECTED / NOT EXECUTED

HOLD

S1 sibling auto

Separate close/open identity events

EXPECTED / NOT EXECUTED

HOLD

Recovery

All popovers hidden, baseline restored

EXPECTED / NOT EXECUTED

HOLD

That gate is the central operational answer to “a popover opened. What actually entered the top layer?” Do not answer from a non-throwing function call. Answer from a reconciled evidence set in which the same element identity appears in the pre-authored case, the lifecycle events, the :popover-open state, the controlled layering comparison and the applicable dismissal/focus boundary.

Develop related skills with Refonte Learning

Refonte Learning’s Frontend Development program lists a four-month schedule at 10–12 hours per week. It covers HTML5/CSS3, JavaScript ES6+, responsive design, React, Redux, APIs/AJAX, Git, accessibility and performance optimization. Its FAQ also names Git, npm, React and Visual Studio Code, and the page lists Frontend Developer, UI Developer and Web Developer among career directions.

The page states that successful completion offers a Training Certificate and a Certificate of Internship, while other page language refers to “Potential Internship”/future opportunities. The program describes internship and placement opportunities as conditional. The page lists several entry requirements. One section says basic programming understanding is expected and HTML/CSS familiarity is a plus. Its FAQ says prior coding experience is helpful but not required, while the Admission Prerequisites section says applicants must be working toward a bachelor’s or higher-level degree. Prospective learners should verify current cohort eligibility rather than treating those different statements as interchangeable.

For structured practice in the HTML, CSS, JavaScript, accessibility and tooling skills used here, review the current curriculum and entry requirements. The curriculum does not list this popover fixture as a named module.