Skip to content

Add WPT lifecycle and URL variants to unlock focus navigation tests - #112

Open
cowboyd wants to merge 1 commit into
dom-event-capturefrom
wpt-document-lifecycle
Open

cowboyd wants to merge 1 commit into
dom-event-capturefrom
wpt-document-lifecycle

Conversation

@cowboyd

@cowboyd cowboyd commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

In some cases, WPT tests select scenarios through document.location.search and register cases from a Window DOMContentLoaded listener.

This supports such such test cases by having each declared URL variant runs in a fresh worker with its own document .
The harness delivers readiness changes, bubbling DOMContentLoaded, and Window load through the consumer's DOM event path.

Most of this change is limited to the harness itself, but it does require a small connectWindow() hook to make sure that window is on the bubble path.

Focus and input tests this enables

  1. Tab and Shift+Tab focus movement around tables: html/interaction/focus/tab-table-caption.html registers its cases in a Window DOMContentLoaded listener and reads two caption-side URL variants. Together with the serialization and keyboard rungs, all 12 cases now reach their focus-navigation assertions.
  2. Typing and Backspace under different whitespace rules: editing/run/typing-text-in-direct-child-of-editing-host.html registers four cases in DOMContentLoaded for each of four URL variants (normal, pre, pre-line, and pre-wrap): 16 cases covering spaces, nonbreaking spaces, and repeated spaces.
  3. beforeinput/input target ranges: input-events/input-events-get-target-ranges-non-collapsed-selection.tentative.html selects Backspace, Delete, or typing “a” through URL variants. input-events/input-events-get-target-ranges-deleting-in-list-items.tentative.html selects Backspace/Delete across ordered and unordered lists through four variants.
  4. Input into controls that are also editing hosts: editing/other/input-in-text-control-which-is-also-editing-host.tentative.html uses three URL variants for text inputs, password inputs, and textareas. It checks value updates when typing, including controls that become editable while focused.

Type of change

  • Bug fix
  • Feature
  • Refactor (no behavior change)
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • All tests pass (pnpm test)
  • Files are formatted (pnpm format)
  • I have added/updated tests for my changes (if applicable)
  • I have added a changeset

AI-generated code disclosure

  • This PR includes AI-generated code

@pkg-pr-new

pkg-pr-new Bot commented Nov 30, 2026

Copy link
Copy Markdown

commit: 9943043

@cowboyd
cowboyd added this pull request to stack #114 November 30, 2026 15:21
@cowboyd
cowboyd marked this pull request as ready for review November 30, 2026 15:35
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.

1 participant