Skip to content

fix(role): name <meter> and <progress> from an associated label#41911

Merged
dcrousso merged 1 commit into
microsoft:mainfrom
dcrousso:fix-41891
Jul 22, 2026
Merged

fix(role): name <meter> and <progress> from an associated label#41911
dcrousso merged 1 commit into
microsoft:mainfrom
dcrousso:fix-41891

Conversation

@dcrousso

Copy link
Copy Markdown
Contributor

<meter> and <progress> are labelable, but the html-aam per-element name step only ran the associated-labels branch for TEXTAREA/SELECT/INPUT (plus BUTTON/OUTPUT)

fixes #41891

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the CI failures here.

🔴 The failing test is caused by this PR

selector-generator.spec.ts:584 › should generate label selector fails on chromium, firefox, and webkit — and it's a direct, expected consequence of this change, not a flake. Same test, same assertion, every engine: that's the diff talking, not infra.

Details

Caused by this PR

  • [chromium/firefox/webkit-library] › library/selector-generator.spec.ts:584 › selector generator › should generate label selector — this test contains the case <label for=target4>Target4</label><progress id=target4 ...> and asserts generate(page, '#target4') returns internal:label="Target4"i. Before this PR <progress> had no accessible name from its label, so the generator fell back to a label selector. Your change adds METER/PROGRESS to the labelable branch in roleUtils.ts::getTextAlternativeInternal, so #target4 now has the accessible name Target4 and the generator emits a role selector (internal:role=progressbar[name="Target4"i]) instead — flipping the expected value. It fails identically on all three browsers because the naming change isn't engine-specific.

    Trivial fix: update the #target4 expectation in tests/library/selector-generator.spec.ts:597 to the new role selector, e.g.

    expect.soft(await generate(page, '#target4')).toBe('internal:role=progressbar[name="Target4"i]');
    

Pre-existing flake / infra

  • The 6 tests in the "flaky" section (video.spec.ts, chromium.spec.ts service worker, cli-codegen-3.spec.ts, page-emulate-media.spec.ts, page-event-request.spec.ts) all passed on retry and touch screencast, service workers, codegen, and media emulation — none of which this label-naming change reaches. Not your concern.

That one failure is real and expected; fix the assertion and CI should go green.

Triaged by the Playwright bot - agent run

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a look at the CI failures.

🟢 CI is clear — the one real failure is already fixed, the rest is a known flake

The selector-generator breakage this PR caused was fixed in your later commits, and the only failure left in the latest reports is mcp/cli-killall.spec.ts:42, a long-standing flake unrelated to this change.

Details

Fixed (was caused by this PR)

  • [chromium/firefox/webkit-library] › library/selector-generator.spec.ts:584 › should generate label selector — failed deterministically on all three engines on the first commit (fbb45d45), because adding METER/PROGRESS to the labelable branch in roleUtils.ts gives the labelled <progress> an accessible name, so the generator emits a role selector instead of the old internal:label fallback. You updated the assertion in the later commits (2545f71, 0f1f80a) and it no longer appears in the latest "tests 1" report. Nothing left to do here.

Pre-existing flake / infra

Triaged by the Playwright bot - agent run

`<meter>` and `<progress>` are labelable, but the html-aam per-element name step only ran the associated-labels branch for `TEXTAREA`/`SELECT`/`INPUT` (plus `BUTTON`/`OUTPUT`)
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

7792 passed, 1269 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

7 flaky ⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/browsercontext-page-event.spec.ts:173 › should work with Ctrl-clicking `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/har-websocket.spec.ts:231 › should embed websocket messages `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node20`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:177 › serviceWorker(), and fromServiceWorker() work `@chromium-ubuntu-22.04-node22`
⚠️ [webkit-library] › library/trace-viewer.spec.ts:2418 › should preserve custom doctype `@webkit-ubuntu-22.04-node20`

50185 passed, 1190 skipped


Merge workflow run.

@dcrousso
dcrousso merged commit 3e95c6c into microsoft:main Jul 22, 2026
50 checks passed
@dcrousso
dcrousso deleted the fix-41891 branch July 22, 2026 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: <meter>/<progress> ignore associated <label> in accessible name; getByRole({ name }) and toHaveAccessibleName fail

2 participants