Skip to content

browser: instruments, the WPT core push (49.7% → 66.2%), and frames as content - #569

Merged
Koukyosyumei merged 14 commits into
mainfrom
improve-browser
Aug 28, 2026
Merged

Koukyosyumei merged 14 commits into
mainfrom
improve-browser

Conversation

@Koukyosyumei

@Koukyosyumei Koukyosyumei commented Aug 28, 2026 •

Copy link
Copy Markdown
Collaborator

The instruments, the conformance push they enabled, and two boundaries reopened on task evidence. WPT gate: 273,796 → 288,807 across the branch, no regression at any step; core tier 49.7% → 66.2%; 608 engine tests; clippy clean on both CI feature combos. ROADMAP §B19–§B21 are the full record.

1. Instruments first (§B19)

A second read of Obscura, aimed at how it measures rather than its verb surface, produced a 12-item queue. Eleven shipped, one was measured and reverted:

  • --allow-any-remote — the instrument grant the corpus and sweep were blocked on. Widens the name check only: internal addresses, the loopback document rule, and box egress are untouched.
  • harness.py — one module owning where the engine is and how instruments invoke it. The corpus had been dead since the self-exec change (three copies of a stale path); it runs again and found real work on its first pass.
  • reliability/sweep.py — crash/panic/hang classifier with a REFUSED class ours needs and Obscura's doesn't (a policy refusal is the engine working). First run: 60 URLs, 0 engine bugs.
  • wpt/tiers.list + triage rollup — §B13.3's caveat made structural: the encoding block is its own tier, exclusions are by capability with the reason on the line, and the unscoped remainder is a count, never a percentage.
  • wpt/wptserve.py — backend against WPT's real server (http-only; the CA is untrustable by design), plus capability/ (9 offline framework stages, 9/9).
  • Reverted with the numbers kept: batching WPT files per engine process — identical scores, 5× slower on dom, for a structural reason (a crashed batch must re-run file-by-file). §B15.12a's lesson, fourth arrival.

Also fixed en route: --restore had been copying a cookies.json nothing ever wrote (silent no-op → the jar now persists, 0600, written-on-change, and --restore genuinely carries a login); a resident session gained screenshot (refused during LOGIN — a password is pixels) and reload.

2. The conformance push (§B20)

Everything came from reading failure messages, not from implementing specs. The top finds, each one cause repeated across every element or call site:

cause gain
getAttribute didn't lowercase what setAttribute did (DOM §4.9, namespace-conditional — SVG keeps viewBox) +10,847
popovers and <dialog> reflected and nothing acted on either +1,803
customElements.define enforced one name rule of eight; whenDefined never settled on an invalid name +1,755
47 missing interface globals — and behind them CharacterData === Text (duplicate key), option.value silently dropped, fetch resolving a non-Response +1,664
constraint validation, text-field selection, entry-list submission — none of it existed +1,289
reflection type system: -0, 32-bit range, [LegacyNullToEmptyString], action URL default; nine element interfaces absent +839
DOMTokenList (add("a b") wrote a token you couldn't remove), createElementNS accepted anything (1/596) +607

Bugs worth reading regardless of the score: an empty <input> read as " " (so if (!input.value) was false and required could never fire), cloneNode copied only class/style, click() on a disabled control dispatched, and wrapper === was never true (proxy vs target — form.elements came back empty).

3. The boundaries, decided then half-reopened (§B20.15, §B21)

The remaining gap concentrated behind three decisions, so they were argued on the product's terms and recorded:

  • No second browsing context — kept (two origins in one realm is the hazard retain_origin bounds), with tiers.list re-scoped to say so: core 61.9% → 66.2% by counting differently, not engineering, disclosed in §B12.6's own words. The moved-out block was 4% passing.
  • Flattened shadow root — kept: 6,528 of its 7,140 subtests are one serialisation file, and flattening is what the snapshot is modeled on.
  • Synchronous fetch — reclassified as an implementation ceiling, not a boundary.

Task evidence then fired the revisit triggers, and §B21 is the narrow reopening:

  • Frames as content: a frame's document is fetched through the broker under its own frame initiator in the receipt, flattened like a shadow root — readable in the snapshot, actionable by the verbs (the payment form in an iframe mints refs). Scripts stripped, styles stripped, contentDocument null, eight-frame bound stated, refusals are notes the agent reads. The snapshot's hidden-content defence survives the styling gap (hidden/inline-display:none/aria-hidden keep their teeth inside frames, pinned by test), and the loopback document rule fired on the first test draft — a web page's frame cannot read the dev server.
  • Abort observable: the promise rejects when the page says stop; the wire request completes and its receipt stands. Real AbortError, AbortSignal.timeout() on the virtual clock, every Request mints a signal.
  • window.open → the popup-blocker answer plus the named recovery: open it in another session.

Method notes

Four wrong turns are recorded in the ROADMAP alongside the wins, because they cost real time: an instrument accusation that was actually my analysis reading one channel; a "6,908-subtest win" that was 380; a regression that was a stale baseline (a before/after needs a before from the current commit); and a name validator built from a superseded spec production.

🤖 Generated with Claude Code

Koukyosyumei and others added 13 commits August 27, 2026 21:07
… (#B19)

A second pass over Obscura, focused on how it *measures* rather than on its
verb surface — §B15 settled that half in August and almost all of it shipped.
The finding that reversed the shape of this work: the verb-line comparison is
closed and the instrument comparison is not.

Eleven of twelve queued items shipped. The twelfth was measured and reverted,
which is the one worth reading.

The engine:

* `--allow-any-remote`, the instrument grant the corpus and the sweep were both
  blocked on. It widens the *name* check only, and that took one more change
  than expected: `check_address` sends an IP-literal host back to the allowlist,
  so a blanket grant would have become a route into RFC 1918 space by spelling.
  The allowlist match is split out as `Policy::listed` and the address check
  asks that narrower question.
* A `screenshot` verb on the session — the one thing an agent driving a live
  page could not do. First user of `browser_session::artifact_path`, which was
  written for exactly this and had no caller: h5i names the file, the engine
  chooses only the bytes. Refused during LOGIN mode, because a password is
  pixels before it is anything else.
* `reload`, routed through `navigate_to` so it is policy-checked and drops the
  served refs by construction rather than by remembering to.
* The cookie jar persists when h5i passes `--cookie-jar`, written on change
  rather than at exit (a session is stopped with a signal), 0600,
  temp-then-rename. `--restore` therefore works: it had been copying a
  `cookies.json` that nothing in the workspace ever wrote, so the flag was a
  silent no-op under help text promising an inherited login. A session that
  left no jar is now refused by name.
* Import maps. The bare-specifier refusal keeps its exact target — the engine
  must not invent a CDN — because a map is the *page* naming the destination in
  markup the parser already read.

The instruments:

* `harness.py`, which is the actual fix for the corpus bug: not three wrong
  paths but three copies of the answer. `corpus/run.py` and `corpus/compare.py`
  had been pointed at `target/*/h5i-browser-light` since the engine became a
  library, so neither had run, and the hand-built allowlist they carried made a
  page pulling from an unlisted CDN look like an engine failure.
* `reliability/sweep.py`: crawl, sweep, and classify into CRASH / PANIC / HANG /
  HANG_HARD / REFUSED / THIN / OK. REFUSED is ours and is not in theirs, because
  a policy refusal is this engine working.
* `wpt/tiers.list` and `wpt/tiers.py`, which turn §B13.3's caveat from prose
  into a table: core 59,953, encoding 225,786, headline 79% encoding, said by
  construction. Plus a triage rollup that groups failure messages across a
  sweep — 8,425 subtests failing on one shape, on the first run.
* `wpt/wptserve.py`, which puts §B17's CORS, §B16.5's PSL cookies and §B17.4's
  compression under external test for the first time. The https variants are
  dropped by name: wptserve serves them under its own CA and this engine trusts
  webpki-roots with no way to add a root, so they would fail on a trust decision
  recorded as a conformance result.
* `capability/`, nine offline stages with the frameworks vendored. 9/9: React
  18, Preact, Vue 3, hydration, a fetch+pushState SPA, the modern language and
  platform surface, timer ordering, and the import map above. Timing reported,
  never gated.

And the one that did not survive: batching WPT files into one engine process
produced identical scores and was 5x slower on `dom` (75s to 392s). A batch
shares a process, so correctness requires re-running a crashed batch file by
file — and WPT is a corpus where crashing files are common, so most batches
split and most files ran twice. Reverted, with the numbers kept on `run_one`.
That is §B15.12a's lesson arriving a fourth time, and the tell was the same: a
sentence in ROADMAP.md saying a change would be fast, written before anything
was timed.

576 engine tests (from 552). WPT gate exactly at baseline, 273,796.

Co-Authored-By: Claude Opus 5 <[email protected]>
…T subtests)

`getAttribute("accessKey")` answered null for an attribute that
`getAttribute("accesskey")` returned on the very next line. DOM §4.9 says both
lowercase the qualified name for an element in the HTML namespace; `set_attr`
and `remove_attr` did, `get_attr` did not, and `hasAttribute` inherited the bug
because it routes through the same op.

Found by reading failure messages rather than by guessing, which is §B12.2's
own method and is the only reason it was found at all: the symptom was
`assert_equals: getAttribute() expected (string) "" but got (object) null`,
identical across eleven files, and the cause was invisible until the WPT
reflection harness turned out to pass the **IDL** name straight through to both
calls (`html/dom/reflection.js`: `domName = idlName`). So every camelCase
reflected attribute — `accessKey` on every element, plus `tabIndex`,
`readOnly`, `maxLength`, `dateTime`, `useMap`, `cellPadding` and the rest —
failed on every element in all eleven `reflection-*.html` files.

    html/dom   43,744 -> 54,591 of 60,514 scored   (72.3% -> 90.2%)
    gate total 273,796 -> 284,655, no regression anywhere

The fix is namespace-conditional and that is not pedantry. The HTML parser
case-corrects SVG attributes, so an `<svg>` genuinely holds one named
`viewBox`; a blanket lowercase would have traded one silent wrong answer for
another. `set_attr` and `remove_attr` lowercasing *unconditionally* was the
same bug pointing the other way — `svg.setAttribute("viewBox", …)` stored
`viewbox` and rendered nothing — so all three now share one normaliser.

One place rather than three, deliberately. `guard_mutation` a few hundred lines
below records what happened the last time a defect of this shape was fixed at
each call site as it was found: "each was fixed where it was found, which is
precisely why there was a third."

Co-Authored-By: Claude Opus 5 <[email protected]>
…em (+1,664)

Chasing WPT core toward 80%. Three items from §B19's queue, and the useful part
is what each turned out to actually cost.

**getHTML: a 6,908-subtest file that is not a 6,908-subtest win.**
`shadow-dom/declarative/gethtml.html` is the largest single file in core and was
queued as the biggest available gain. The breakdown says otherwise: 380 subtests
need only `getHTML() == innerHTML`, which is built and measures at exactly +380,
and 6,528 need a shadow root serialised as `<template shadowrootmode>` — which
this engine cannot do, because a shadow root here is a view of its host and the
component's output and the light content are siblings in one element. Emitting
the flattened content under that header would be markup describing a tree that
never existed, so it is recorded through `unsupported()` instead. §B12.8 says a
large cluster usually has one cheap structural cause; this one has a single
expensive structural cause, and the file's size said nothing about which. A
subtest count measures how much a test repeats itself, not how much work its
failure represents.

**Forty-seven interface globals, and why they are not the stubs §B8.4 deleted.**
That rule is about feature detection: a name that exists and answers wrongly
sends a page down a branch it cannot recover from. A page writing
`nodes instanceof NodeList` is not detecting a feature, it is asking what it
holds, and the honest answers are yes and no — never ReferenceError. So each
interface object carries a `Symbol.hasInstance` doing the real brand check, and
`new NodeList()` still throws as it does in a browser.

Adding them surfaced three bugs with nothing to do with WPT:

* `CharacterData` *was* `Text`. A duplicate key in the globals literal, so the
  later binding won and `comment instanceof CharacterData` was false for a class
  the comment genuinely extends.
* `option.value = x` was silently lost: the setter took the editor path, which
  an option does not have, and stashed it where the option's getter never looks
  — taking `new Option(label, value)` with it.
* `fetch` resolved an object literal with the right fields, which reads
  identically until something asks what it is. `Response` was not a global, so
  `new Response(...)` was a ReferenceError. It is a real class now, and fetch
  builds one.

Plus one that was ours all along: interface objects were **enumerable** on the
global, which WebIDL §3.7 forbids and `idlharness` checks first for every
interface — a subtest per interface across the suite, spent before anything
about the interface was examined.

**new Document(), and a score that depended on machine load.** Exposing
`Document` as non-constructible took `html/dom/idlharness.https.html` from 269
passing to reporting nothing: `new Document()` is legal (DOM §4.5) and the test
builds one in setup. That is §8.4's hazard in a new costume, introduced by the
change meant to stop names being absent. Made constructible, the file goes from
373 subtests to 6,408 with 1,896 passing — and then became unstable, because it
needs about twenty seconds of script and `SCRIPT_PHASE_BUDGET` is twenty
seconds. The guard is right; a conformance harness is just where a runaway and a
slow page are hard to tell apart. A run whose score depends on the other
processes on the box is not a measurement, so `--script-seconds` lets an
instrument say so — announced, off by default, and still under the navigation
deadline, exactly like `--allow-any-remote`.

**testdriver-vendor.js, the second empty seam.** It ships as a zero-byte file
for the same reason `testharnessreport.js` does, and unfilled it fails 633 core
files on a missing harness rather than on the engine. Filled in `serve.py` with
no engine change: `click` and `send_keys` dispatch the events the action would
produce, and `bless` (706 call sites) is built on `click` upstream, so one
function unlocks both. Anything needing authority this engine lacks keeps
testdriver's own rejection — a shim that resolved those would turn "the harness
cannot do this" into "the engine got the wrong answer".

    html/dom   54,591 -> 56,241
    gate       284,655 -> 286,319, no regression
    585 engine tests (from 578)

§B20 records the analysis, including two corrections worth more than the code:
the "instrument cannot name what is missing" claim was wrong (87% of those
subtests already carry the name; the *analysis* was reading one channel and not
joining the other), and a 192-subtest "regression" in shadow-dom was drift
between a month-old artifact and today's engine. A before/after needs a before
taken from the current commit.

Co-Authored-By: Claude Opus 5 <[email protected]>
Raised after the interface-object work and `--script-seconds`. `html/dom`
carries the change (54,591 -> 56,241), most of it `idlharness.https.html`
becoming measurable rather than landing on the script-phase ceiling.

Co-Authored-By: Claude Opus 5 <[email protected]>
Four separate defects, each of which repeated across every element or every
call site, found by reading what the failures actually said.

**The reflection type system, four bugs, all of them per-element.**

* `-0` is not a value an IDL long may report. `Number("-0")` is negative zero,
  reflections are integers, and testharness compares with `Object.is`
  semantics — so `tabindex="-0"` failed an `assert_equals(0)` on *every*
  element in every `reflection-*.html` file. `tabIndex` has its own parser, so
  it needed the same fix twice.
* Out of the 32-bit range is "not a valid integer" for a reflection rather than
  a large number: `marquee.hspace = 2147483648` read back as itself instead of
  the default.
* `[LegacyNullToEmptyString]`, which the legacy presentational colour
  attributes carry: `body.bgColor = null` writes "" and not "null". Marked per
  attribute, because everywhere else `null` really does stringify and a browser
  agrees.
* `form.action` and `input.formAction` answer with the document's address when
  the attribute is missing or empty. A form whose action reads "" submits
  somewhere different from one that reads the page's URL.

**Nine element interfaces the table never had** — meter, progress, iframe, del,
q, th, thead, tfoot, colgroup — plus a `double` reflection for meter and
progress. A missing entry there is not one attribute missing, it is every
attribute of that element failing at once; `ins` was present and `del` was not,
`td` was present and `th` was not.

`crossOrigin` is one nullable enumerated attribute and was spelled out on
`<link>` while `<img>`, `<script>`, `<video>` and `<audio>` had it as a plain
string. One definition now, and a nullable enumerated removes its attribute when
set to null or undefined. `document.dir` reflects `<html dir>` and was absent.

    html/dom  56,241 -> 57,080

**Custom element names were validated by one rule out of eight.** The dash was
checked; uppercase, the leading character, the eight reserved SVG/MathML
compound names and the local-name character rule were not — so this engine
accepted names a browser refuses, after which the page and the engine disagree
about what `<font-face>` is. It throws a `DOMException` now, which is what
`assert_throws_dom` checks and what the old unit test had pinned wrongly.

Two things this got wrong on the way, both worth recording:

* The first implementation used `PotentialCustomElementNameChar`, which is the
  *superseded* production. whatwg/html#7991 replaced it with "a valid element
  local name", which excludes rather than includes — so the old rule rejected
  names that are now legal, failing the file in the opposite direction from the
  one it was written to fix.
* `whenDefined` did not validate, so once `define` threw correctly the test
  reached `await promise_rejects_dom(t, 'SyntaxError', whenDefined(bad))` and
  hung there, taking all 5,900 subtests with it. A promise that never settles
  is the worst of the three answers: a caller cannot tell it from a component
  that has not loaded, so it waits out its own timeout instead of handling an
  error it could have handled at once.

`valid-custom-element-names.html`: 222 of 1,975 passing -> **1,975 of 1,975**.

**URL and body plumbing.** `new URLSearchParams(otherParams)` walked the
object's own keys, so it copied the internal `_pairs` field and serialised as
`_pairs=a%2Cb` — a params object emitting its own implementation. It takes any
iterable of pairs now. Added `sort()`, `size`, form-urlencoded serialisation
(`+` for space, and the escapes `encodeURIComponent` leaves alone), the
`URL.parse`/`URL.canParse` statics, and `formData`/`arrayBuffer`/`blob` on both
`Request` and `Response`.

    url  68 -> 148 of 499

585 tests, clippy clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
`html/semantics/popovers` was 3,846 unpassed against 20 passing, and the reason
was not that the feature is large: the `popover` attribute *reflected*, and
nothing anywhere did anything with it. `<dialog>` was the same shape — `open`
reflected, `show`, `showModal` and `close` all absent — so a dialog could be
described and never opened.

Both are real now as far as the DOM is concerned: the state machine, the
exceptions with the names the spec gives them, the `beforetoggle`/`toggle` pair
with its cancel-on-open-only asymmetry, auto popovers closing their peers where
manual ones do not, the `popovertarget` invoker, and `returnValue`.

**What is deliberately not real is the top layer.** This engine has no separate
paint layer, so an open popover renders where it sits in the document and a
modal dialog does not block the page behind it. That is a rendering property;
the API contract a page scripts against is not, and separating the two is worth
more than refusing the feature whole — a page can open a popover, be told why
it could not, and observe the same event sequence a browser fires.

Three things fell out of building it that the failures would not have said:

* `<div popover>` has the value `""`, which maps to the **auto** state. Without
  the alias it fell through to `invalid` and every bare popover reported
  "manual" — the one state that does not close its peers, so they stacked up.
* `popover` is **nullable**: an element without the attribute reports `null`,
  which is how a page asks "is this a popover at all". Reporting `""` made
  every element look like one.
* An invoker runs **after** the click and only if it was not cancelled, so the
  click event has to be held and asked. Dispatching and discarding it made
  `preventDefault()` in a handler do nothing, which is the one thing default
  activation behaviour has to respect.

589 tests, clippy clean. §B20.10 records the round.

Co-Authored-By: Claude Opus 5 <[email protected]>
…thing

**`classList` could hold a class a page could not remove.** `add("a b")` wrote
one token that read back as two, and `add("")` wrote a trailing space, because
neither validation existed — so the token a page added was not a token it could
later name. That is the worst shape a DOM bug takes: the write succeeds, the
read disagrees, and nothing reports either.

Also absent: `replace()`, which the corpus asked for 262 times and which is how
a component moves between states without a remove-then-add that briefly has
neither class; and indexed access, so `classList[0]` answered `undefined` for a
collection whose whole point is being indexed. The reporting had recorded that
one twice, as `DOMTokenList.0` and `DOMTokenList.-1`, because nothing
implemented either.

**`createElementNS` accepted anything and returned an element**, which is why
`dom/nodes/Document-createElementNS.html` scored **1 of 596**: the file is
almost entirely a sweep of names that must be rejected, and every one of them
succeeded. It validates the XML `Name` production now, and keeps the two errors
apart because the spec does and pages catch them separately —
`InvalidCharacterError` is "that is not a name", `NamespaceError` is "that name
and that namespace may not go together".

    dom       2,022 -> 2,629
    html/dom  57,080 -> 57,498
    gate      286,319 -> 288,183, no regression

Measured alongside: popovers and `<dialog>` took `html/semantics` from 2,839 to
**4,642**. §B20.11 and §B20.12 record the round and where core now stands —
58.5%, from 49.7%, with the remaining distance to 80% resting on two product
decisions rather than on more of this.

591 tests, clippy clean.

Co-Authored-By: Claude Opus 5 <[email protected]>
…at read as a space

§B20.11 named `html/semantics/forms` as the one large remaining block that
needed no design reversal. It was 723 passing of 4,870, and the reason was not
subtlety: **the constraint validation API did not exist at all.** Nine files
scored 1 of 920 between them, every one failing on "the validity attribute
doesn't exist" before reaching what it meant to check.

Built, in the order the failures ranked them:

* `validity`, `willValidate`, `validationMessage`, `checkValidity`,
  `reportValidity`, `setCustomValidity`, and the form-level pair. The
  barred-from-validation clause is the part worth reading: a disabled control
  that reported itself invalid would block a form the user cannot even reach,
  so barred elements are always valid *including* when a custom error was set.
  `reportValidity` is identical to `checkValidity` here and says so — the
  difference is that a browser shows the message and there is no UI to show it
  in.
* Text-field selection: `selectionStart`/`End`/`Direction`,
  `setSelectionRange`, `setRangeText` with all four select modes, `select`.
  Held on this side rather than in the layout engine, because it has to answer
  for a detached control too. `<input type=number>` reports `null` rather than
  0, which is the distinction a page tests before using it.
* `valueAsNumber`, `valueAsDate`, `stepUp`, `stepDown`, `showPicker` — all off
  one table, so a type is steppable in one place rather than four that can
  disagree. NaN rather than `undefined` for a type with no numeric form:
  `undefined` says "this engine lacks the property", NaN says "this control
  holds no number".
* `<input type=color>` sanitisation, `files` returning null off a non-file
  input, `form.autocomplete` defaulting to `on`.

**Three bugs with nothing to do with forms fell out of it.**

*An empty `<input>` read as `" "`.* blitz seeds a laid-out input's editor with
a single space, and the value getter applied its whitespace-is-unseeded rule to
`<textarea>` only. So `if (!input.value)` was **false** for an empty field —
every page and every agent testing a form for emptiness got the wrong answer,
and `required` could never fire. Found only because constraint validation asked
the question from a different direction.

*`cloneNode` copied `class` and `style` and nothing else.* A clone lost its id,
its href, its data-* and every hook a page had put on it, so a cloned
`<template>` came out stripped. The form-control cloning steps went with them.

*`click()` on a disabled control dispatched a click*, so a page that disables a
control to stop it being used still saw it used.

    html/semantics/forms  723 -> 2,012 of 4,655
    html/dom              57,498 -> 58,073
    dom                   2,629 -> 2,651
    gate                  288,183 -> 288,780, no regression

598 tests, clippy clean. §B20.12 records the round; what remains in forms is
submission, `:focus` in the selector engine, and `color()` parsing — and
submission is the one worth taking next, because it is the half of a form this
engine can observe better than anything else, being the HTTP client itself.

Co-Authored-By: Claude Opus 5 <[email protected]>
The rest of forms was submission, and §B20.12 said it was worth taking because
this engine *is* the HTTP client.

* **Form ownership is not containment.** `form=""` names no id and therefore
  has no owner, but the old code read the attribute for truthiness and fell
  through to the ancestor search — reporting the surrounding form, when taking
  a control *out* of the form it sits in is the entire purpose of the
  attribute. `form.elements` asks the same question now, so a control with
  `form="thisId"` is submitted from anywhere on the page and a descendant
  pointing elsewhere is not submitted here.
* **The entry list**, properly: the submitter is an entry (skipping every
  button meant a server could not tell which one was pressed), `_charset_` is
  supplied by the engine, a `<datalist>` descendant is a suggestion and never
  an entry, disabled and unnamed controls are out.
* **The `formdata` event**, firing with the list under construction rather than
  a copy — the documented replacement for the hidden inputs a page used to
  inject.
* **`requestSubmit` and `submit`**, which differ in the two ways that matter:
  the first validates and fires a cancelable `submit`, the second does neither.
  Implementing them as one function is the obvious shortcut and would make
  `form.submit()` called from inside a `submit` handler recurse.

Neither navigates, deliberately: this engine drives navigation through its own
verbs so an agent and a receipt both see it, and a form submitting itself out
from under that would be a request nothing decided on.

**A bug with nothing to do with forms fell out of it.** `form.elements` came
back empty because it compared `formOwnerOf(el) === this` — and `wrap()` hands
back the `observed` proxy while a getter runs with the raw *target* as `this`,
by design, since `observed` passes the target as receiver to avoid paying a
trap per field read. So a proxy and its target are two objects for one node,
and identity comparison silently answers "different" for **every element**.
Anything anywhere comparing two wrappers with `===` has the same defect; there
is a `sameNode` helper saying so now.

    html/semantics/forms  723 -> 2,051 of 4,655 across the two rounds
    gate                  288,780 -> 288,784, no regression

**The boundary.** What remains in `form-submission-0` is three enctype files at
62 subtests each plus the double-submit pair, and every one submits into an
`<iframe>` and waits for its load. That is §B6's refusal reached from a third
direction, after declarative shadow DOM and `html/browsers/origin`. The
submission algorithm is implemented and observable; being navigated by it is
what is out of reach.

602 tests, clippy clean. §B20.13 records the round.

Co-Authored-By: Claude Opus 5 <[email protected]>
… (§B20.15)

§B20.14 ended on three blocks "blocked on a product decision, not on effort".
The decision was put and made, argued on the product's terms rather than WPT's:

* **No second browsing context — kept.** Two origins in one realm is the
  hazard `retain_origin` exists to bound, and doing iframes right is site
  isolation. One carve-out queued: `window.open` maps onto h5i's own session
  model, so it should become a named refusal carrying a recovery ("open one
  with --session"), per §B15.6. Revisit trigger: corpus demand from real agent
  tasks (payments/auth), never WPT — and the first step would be same-origin
  srcdoc iframes only.
* **Flattened shadow root — kept, defended hardest.** 6,528 of the 7,140 is
  one serialisation file. The flattening is aligned, not a shortcut: it is
  what the accessibility tree does, and the snapshot is modeled on that tree.
  Revisit trigger: visible misrendering from style leakage — and the fix would
  be scoping in the cascade, not a second tree.
* **Synchronous fetch — not a boundary, reclassified.** Fail-closed requires
  decide-and-record before the bytes move; nothing forces the transport to
  block. Decision: measure first (the repaired corpus/compare.py), build
  concurrent brokered fetch with real abort only if serial fetch is where
  real-page latency actually goes. §B15.12a applied before the mistake.

tiers.list moves three entries to `exclude`, reasons on the line:
`html/browsers/origin`, `fetch/metadata` (the *feature* is still wanted — the
tests need window.open plus .py handlers), and `gethtml.html` by exact path so
the rest of shadow-dom stays measured. Two look-alikes deliberately NOT
excluded, because either would be exclusion by outcome wearing a capability's
name: the enctype files (their subject is entry-list serialisation, which we
claim) and the fetch abort timeouts (an implementation ceiling, per decision
3). Both stay in core as honest losses.

The effect, disclosed the way §B12.6 requires, since this is its third way of
moving a number:

    core, old scope   81,120 / 130,958 = 61.9%
    core, new scope   80,738 / 121,987 = 66.2%
    moved out         8,971 scored, of which only 382 passed

Nothing got better; the denominator now says what the engine is. The moved-out
block was 4% passing — exactly what a capability hole looks like, and exactly
why the exclusion had to be argued from the product rather than read off the
score. The reasons being on the line in tiers.list, where moving a line and
re-running is the audit, is the difference between this and a gamed number.

Co-Authored-By: Claude Opus 5 <[email protected]>
…(§B21)

§B20.15's revisit triggers fired the day they were written: task evidence —
real agent runs, not WPT — showed work blocked on frames and on abort. This is
the narrow reopening, and the boundary it does not cross.

**Frames as content.** A frame's document is fetched through the broker under
its own initiator — `frame` in the request log, so an auditor asking "did this
page pull in another document" gets the answer by name — and its content is
flattened into the page the way a shadow root is: readable in the snapshot,
actionable by the verbs. The payment form inside the iframe mints refs like
any other form. What deliberately does not happen: its scripts never run
(stripped after the graft; `javascript:` frames refused by name), its styles
do not apply, `contentDocument` still answers null, and the whole tree is
bounded at eight frames with the bound said rather than silent. A refused
frame is a note the agent reads, never an empty box.

Three findings from building it, each worth more than the feature:

* **Fragment parsing inside `<iframe>` is raw text** — the first graft set the
  frame's own innerHTML and produced one text node of escaped markup. The
  graft goes into a `<div>` container, which is a neutral parsing context.
* **Blitz styles nothing it will not render**, so the snapshot's
  hidden-content defence ("no styles means hidden") silently dropped every
  grafted subtree. Inside a frame that inference is wrong — no styles means
  *outside the styled tree* — so the walk carries an `in_frame` flag, and the
  hiding vectors a page actually controls there (`hidden`, inline
  display:none, `aria-hidden`) keep their teeth, pinned by test.
* **The document-origin loopback rule fired on the first test draft**,
  refusing a web page's frame from reaching the dev server. §B3.1 doing its
  job on a road that did not exist when it was written; now pinned too.

**Abort made observable.** The §B20.15 claim that fetch is synchronous
underneath was half stale — script fetches have been threaded since the ticket
queue — but abort only took effect when the network answered, which is why 260
fetch files timed out. The promise now rejects the moment the page says stop,
while the wire request runs to completion and its receipt stands: the request
*was* made, and a log that unwrote it when the page changed its mind would
record intentions rather than traffic. The reason is a DOMException named
AbortError (a plain Error sent every `e.name` branch the wrong way),
`AbortSignal.timeout()` runs on the virtual clock so a fetch-versus-timeout
race settles deterministically, and every `Request` mints a `signal` when the
caller brings none.

**window.open, the named refusal.** Returns null — the popup-blocker answer
every page already handles — and says why, naming the recovery: open the URL
in another session and drive both. Not a same-realm fake window, which would
hand the opened page's globals to the opener.

    fetch/api/abort   hanging -> 32 of 96 scored (the rest needs wptserve)
    dom               2,651 -> 2,672
    gate              288,784 -> 288,807, no regression

tiers.list is unchanged, deliberately: frames-as-content moves what an agent
can read and drive, not what the excluded tests measure — html/browsers/origin
still needs live contexts scripting each other, and the enctype files still
observe submission through a frame's *load*, which a flattened frame does not
perform.

608 tests, clippy clean. §B21 records the round.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Koukyosyumei Koukyosyumei changed the title Improve browser browser: instruments, the WPT core push (49.7% → 66.2%), and frames as content Aug 28, 2026
…false

The agent-facing reference is exactly where a stale capability claim costs the
most: an agent reading "not available: iframes" routes to Chromium for a page
this engine now reads fine. Says what frames-as-content gives (flattened,
actionable, receipted under the `frame` initiator), what it withholds (frame
scripts, styles, contentDocument), and what window.open's refusal tells you to
do instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
@Koukyosyumei
Koukyosyumei merged commit 40f3d7d into main Aug 28, 2026
9 checks passed
@Koukyosyumei
Koukyosyumei deleted the improve-browser branch August 28, 2026 15:50
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