Repository navigation
Run upstream WPT sources directly and remove the adapted suite - #87
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
commit: |
3c336fc to
f0a04b3
Compare
## What does this PR do? See #87 for the endgame. We want to run WPT test cases directly without any changes to the upstream and without hosting hundreds approximations of those tests in our repository. Those files create additional documents and doctypes during shared setup, so the implementation needs those factories before the harness can execute them directly. Add [`DocumentType`](https://dom.spec.whatwg.org/#interface-documenttype), [`DOMImplementation.createDocumentType()`](https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype), and [`createHTMLDocument()`](https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument). HTML creation supplies a doctype, `<html>`, `<head>`, an optional `<title>`, and `<body>`. Bare documents start empty; `documentElement`, `doctype`, `head`, and `body` reflect the current tree. UI construction uses the HTML factory. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [ ] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code
f0a04b3 to
dac2035
Compare
natemoo-re
left a comment
There was a problem hiding this comment.
Would love to give the test adapter another review tomorrow!
| "format": "bsh format", | ||
| "lint": "bsh lint", | ||
| "test": "pnpm --filter @bomb.sh/web-platform-tests build && bsh test" | ||
| "test": "pnpm --filter @bomb.sh/web-platform-tests build && bsh test && wpt" |
There was a problem hiding this comment.
We could use pnpm tasks to automatically run build before test
d829470 to
6b8f53b
Compare
## What does this PR do? See #87 for the endgame. We want to run WPT test cases directly without any changes to the upstream and without hosting hundreds approximations of those tests in our repository. `Document-createAttribute.html` and `Node-textContent.html` create XML documents during shared setup, before their selected cases run. Implement [`DOMImplementation.createDocument()`](https://dom.spec.whatwg.org/#dom-domimplementation-createdocument), returning an [`XMLDocument`](https://dom.spec.whatwg.org/#xmldocument) with an optional namespaced root and doctype. Convert and validate the factory arguments so upstream setup can use the implementation directly. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [ ] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code
6b8f53b to
db70c94
Compare
## What does this PR do? See #87 for the endgame. We want to run WPT test cases directly without any changes to the upstream and without hosting hundreds approximations of those tests in our repository. The element-creation files use `document.querySelector()` to locate iframe fixtures during shared setup, even when only their HTML-document cases are selected. Add [`Document.querySelector()`](https://dom.spec.whatwg.org/#dom-parentnode-queryselector) through the css-select adapter, returning the first match or `null` and converting selector compilation errors to `SyntaxError`. The adapter is reused unchanged from the earlier selector work. See the DOM specification's [scope-matching algorithm](https://dom.spec.whatwg.org/#scope-match-a-selectors-string). ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [ ] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code
db70c94 to
f7077a8
Compare
jbolda
left a comment
There was a problem hiding this comment.
Looks good with my other than Nate's note!
dreyfus92
left a comment
There was a problem hiding this comment.
this is a big step up, running upstream files directly is way easier to trust than the adapted copies, and it's nice that a typo'd or deleted selection fails loudly. left a few questions inline, none blocking
one more that doesn't fit on a line: does anything still check the frameworks.ts profiles now that frameworks.test.ts is gone? nothing seems to call framework() anymore, so they could drift
f7077a8 to
3656a37
Compare
3656a37 to
8697662
Compare
## What does this PR do? <!-- Describe the change and why it's needed. Link to a related issue or discussion. If there is no issue, please explain why one isn't needed. --> Following up on #87 (comment) Looking to improve the DX here where `pnpm i` and `pnpm test` Just Works (tm). Both `test:unit` and `test:wpt` run in watch mode by default, but take a `--run` which is what we use in CI. ## Type of change <!-- Check one. --> - [ ] Bug fix - [ ] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [x] Chore (dependencies, CI, tooling) ## Checklist - [x] All tests pass (`pnpm test`) - [x] Files are formatted (`pnpm format`) - [ ] I have added/updated tests for my changes (if applicable) - [ ] I have added a changeset ## AI-generated code disclosure <!-- If any part of this PR was generated by AI tools (Copilot, Claude, GPT, Cursor, etc.), check the box. This is fine — we just need to know so reviewers can pay extra attention to edge cases. --> - [ ] This PR includes AI-generated code
## What does this PR do? This adds a style system that hews as closely to CSS as possible. It is not, and cannot be, CSS compliant, but where CSS styles provide an answer, it uses it. It's fair to describe it as a _subset_ of CSS. This CSS based system is completely decoupled from TTY styling and so every property is explicitly mapped over. Included in this PR are styles for display, flex direction, spacing, borders, and CSS colors. <img width="470" height="236" alt="image" src="https://github.com/user-attachments/assets/2d31eabd-cd4f-4300-a4e0-a3167cb6540d" /> Currently there are only default styles and inline styles of an element, but we can later add style rules that match. <img width="195" height="125" alt="image" src="https://github.com/user-attachments/assets/478111c4-8a52-4001-a82f-e725e55f2919" /> The existing style cases now run directly from original WPT sources on the native WPT base (#87). Relevant spec: CSSOM’s [CSSStyleDeclaration interface](https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface). This follows shared DOM lookup #70 in [the styling stack](https://github.com/bombshell-dev/ui/stack/107). The focus stack starting at #75 also depends on #70. ## Validation - 267 workspace tests and 734 upstream WPT cases pass at the styling stack tip. - Build, lint, formatting, and WPT package typecheck pass. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [x] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code I used AI to generate test cases, and occasionally suggest code snippets. Subsequent AI assistance also includes implementation, WPT adaptations, validation, and PR splitting.
## What does this PR do? Apply element declarations to terminal output: default display modes, inherited foreground colors, flex direction, gap, padding, and borders. CSS color values are converted to TTY colors; traversal remains iterative for deeply nested trees. Inline elements collect descendant text using their outer style. Restacked above the native WPT base (#87). Relevant specs: CSS Display’s [display property](https://drafts.csswg.org/css-display/#the-display-properties) and CSS Flexbox’s [flex-direction property](https://drafts.csswg.org/css-flexbox/#flex-direction-property). ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [x] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code AI disclosure: includes AI-assisted code, validation, and PR splitting.
## What does this PR do? Add a runnable basic panel built with DOM elements and inline styles. <img width="190" height="104" alt="image" src="https://github.com/user-attachments/assets/9c26840a-eb44-4925-9fe8-f6e3a02f5210" /> Restacked above the native WPT base (#87); the example now uses the required AbortSignal lifecycle. ## Type of change - [ ] Bug fix - [x] Feature - [ ] Refactor (no behavior change) - [ ] Documentation - [ ] Performance improvement - [ ] Tests - [ ] Chore (dependencies, CI, tooling) ## Checklist - [x] I have added a changeset ## AI-generated code disclosure - [x] This PR includes AI-generated code AI disclosure: includes AI-assisted code, validation, and PR splitting.
What does this PR do?
Run original Web Platform Test HTML files through Vitest file transforms, replacing the adapted TypeScript suite.
Consumers integrate through a single
wpt.config.tssupplying a document factory, globals, and case selection.Each upstream file runs in a fresh Node worker and appears as a separate test file. The worker loads the consumer configuration, then runs its DOM implementation and the upstream scripts in the same JavaScript realm, so native and implementation-thrown errors share constructors and prototypes. The harness populates HTML through parse5, executes scripts and helpers in source order, and uses upstream
testharness.jsfor assertions and scheduling. The harness supplieswindow.document, attachesdocument.defaultView, and delivers windowloadafter the scripts finish.The fixture also supplies live Window named properties through a proxy in the worker global's prototype chain. Single-element IDs and eligible HTML names resolve against the current document tree; existing globals take precedence. Multiple matches requiring live collections and child browsing-context names remain unsupported.
The runner terminates the worker after each file. Timeouts include worker startup and configuration loading; a parent watchdog allows 250 ms for ordinary timeout results before terminating an unresponsive worker. Consumer configurations do not need to override standard error constructors.
Every subtest in a selected file executes to preserve shared state; selection filters only the reported results. Browser navigation and parser-driven script timing remain unsupported. Window event delegation currently requires extensible event objects.
Type of change
Checklist
AI-generated code disclosure