Commit Graph
240 Commits
Author SHA1 Message Date
ldm0 66e7c693fe fix(navigation): keep ignored response metadata on terminal gate 2026-10-08 21:42:07 +08:00
ldm0 f32553ed04 fix: clarify renderer exports and preserve allocation-free error handoffs 2026-10-08 19:56:33 +08:00
ldm0 c31404d801 refactor: use stable atomic updates and fixed-size slice chunks 2026-10-08 19:56:33 +08:00
ldm0 d63da2d76c fix(accessibility): resolve AX object IDs in their owning session 2026-10-08 19:33:01 +08:00
ldm0 0f2892533f fix(cdp): bound renderer navigation future stack usage 2026-10-07 17:53:16 +08:00
ldm0 e790a88a66 test(target): heap-allocate background navigation fixtures 2026-10-06 01:46:40 +08:00
ldm0 91aec378a4 refactor(cdp): search resource content on the renderer owner
Native CDP replies can expose resources before the protocol adapter consumes
its Page snapshot. Resolve, decode, and search sources in one renderer command
instead of refreshing a snapshot and selecting cached content in the adapter.

Pass the immutable main response body by committed loader and preserve frame
matching, decoding, byte limits, and the attachment check before settlement.
Require a single renderer turn in the held-native-publication regression.
2026-10-06 01:01:03 +08:00
ldm0 70b4b1eb15 fix(cdp): refresh resource sources before searching
Native Page replies can reach the frontend before the adapter updates the cached resource report. Capture a current renderer snapshot before selecting root frame subresources and reject completions from replaced renderer attachments.

Add regressions for resource searches before native adapter settlement and for navigation before consuming a resource snapshot.
2026-10-06 01:01:03 +08:00
ldm0 30e36e64a3 fix(cdp): preserve auxiliary Page ownership through document navigation
Create script auxiliary Pages synchronously and let their CDP targets adopt
those exact Pages. Preserve Page and WindowProxy identity through document
navigation, sharing browsing-context names, opener references, message endpoints
and close state with related windows.

Commit browser responses into the existing Page with exact document admission,
cancellation and failure disposition. Capture accepted navigation origin, base,
policy, storage and referrer, preserve auxiliary history and restore related
browsing-context groups without issuing duplicate popup requests.

Reuse the initial same-origin Window while replacing its Document, and centralize
Document owner transitions, descendant retirement and Inspector publication.
Give related Pages independent Inspector routes and shared per-Page startup
pause state, route isolate foreground work through surviving Pages, and cache
cross-origin Window functions in each accessing realm with receiver-aware access.

Cover actual popup state, navigation and parser rebinding, accepted environments,
history, cross-origin access, multiple frontends, cancellation and task retirement.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-06 01:01:03 +08:00
ldm0 f1c5bf6618 fix(cdp): separate browser window selection from document activity
Track each window's selected tab and browser focus independently of protocol
page routing. Keep window bounds, adjacent-tab close selection, discovery and
target metadata consistent with their owning windows and documents.

Queue renderer activity updates outside the CDP actor, preserve their output
fences and remember admitted activity so focus reversals survive a busy page.
Cover window selection, focus-event state and busy-context activation.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast.
2026-10-06 01:01:03 +08:00
ldm0 c345a594f4 feat(webmcp): implement document tools and CDP integration
Expose secure Document.modelContext APIs with document-owned registrations,
callback realm and input validation, task-based result delivery, and independent
caller cancellation and target completion. Preserve cancellation reasons and
emit lifecycle events only for live owners.

Register native declarative forms in light and shadow trees through indexed
mutation candidates. Track schema changes to valid forms even before a
registration succeeds, including controls associated through a form attribute.
Use changed containers only for ancestor and form-owner checks; inspect added
and removed subtrees for discovery. Retire registrations at actual removal and
owner transitions while preserving submit handling and captured pending responses. Apply validated
fill intents to current options and checkable values in control event order.

Compute tools delegation from committed security origins, ancestor header
allowlists, container declarations, redirects, and combined sandbox policies.
Carry invocation identity, original origin, and resolved target through form
navigation; accept same-origin JSON-LD results and reject cross-origin commits.

Connect typed renderer observations to CDP discovery, invocation, cancellation,
and Runtime result projection. Include renderer and protocol regression coverage
for document lifetime, reentrancy, permissions, dynamic controls, and cancellation.

Validation on this commit tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast.
Summary [ 100.619s] 19320 tests run: 19320 passed, 16 skipped
2026-10-05 15:25:06 +08:00
ldm0 3063134daf test(cdp): enable Runtime before replaying child navigation bindings 2026-10-05 05:20:01 +08:00
ldm0 5b7984973f fix(cdp): abort no-content navigations before document preparation 2026-10-04 15:34:09 +08:00
ldm0 7106a4e4b6 fix(cdp): initialize scrollbar overrides before navigation scripts 2026-10-04 05:20:17 +08:00
ldm0 674a2fd9df refactor(renderer): unify document settings application 2026-10-04 05:20:17 +08:00
ldm0 ff70590d7f refactor(runtime): share document settings snapshots 2026-10-04 05:20:17 +08:00
ldm0 a789da8a0d feat(cdp): support Emulation.setScrollbarsHidden
Apply scrollbar hiding to the live Page before acknowledging the command, preserve the startup flag, and replay the target setting before navigation scripts. Validate the required boolean and layout mode, track per-session state, and clear overrides on detach.

Refs #1081
2026-10-04 05:20:17 +08:00
ldm0 df410aeeb7 feat(layout): add --hide-scrollbars for fetch and serve
Hide native scrollbars and automatic gutters while preserving scrolling and explicit stable gutters. Require layout mode and retain the setting across navigation, frames, and protocol sessions.

Refs #1081
2026-10-04 05:20:17 +08:00
ldm0 32de272640 fix(cdp): keep current renderer notifications live during navigation 2026-10-04 03:12:50 +08:00
ldm0 059cc9d04e test(cdp): wait for fulfilled Fetch body consumption 2026-10-04 02:37:24 +08:00
ldm0 9cbdd35da5 refactor(emulation): apply navigator and activity policy together 2026-10-03 03:30:39 +08:00
ldm0 828658d9d4 refactor(renderer): resolve scoped nodes within owner-only DOM operations 2026-10-03 03:30:39 +08:00
ldm0 330b8c6381 refactor(renderer): resolve scoped nodes within read operations 2026-10-03 03:30:39 +08:00
ldm0 04d465959f refactor(cdp): simplify renderer call envelopes and unit replies 2026-10-03 03:30:39 +08:00
ldm0 3fb36899cd refactor(cdp): project ordered output from canonical slots 2026-10-03 03:30:39 +08:00
ldm0 86f5f3d6ff test(cdp): bind failed navigation lifecycle to its document commit 2026-10-01 22:48:27 +08:00
ldm0 5c19ed1006 refactor(dom): resolve attribute references in the renderer handler 2026-10-01 16:51:46 +08:00
ldm0 eb2d679e44 refactor(automation): name semantic commands and renderer CDP calls 2026-10-01 16:51:46 +08:00
ldm0 f2cd0fd488 refactor(cdp): pass preload commands directly between phases 2026-10-01 16:51:46 +08:00
ldm0 4a5e28d119 refactor(test): share CDP completion with renderer events 2026-10-01 16:51:46 +08:00
ldm0 cb28d957e1 refactor(cdp): share CSS inventory notification payloads 2026-10-01 16:51:46 +08:00
ldm0 30b7d61eb4 refactor(cdp): project native terminals with other renderer records 2026-10-01 16:51:46 +08:00
ldm0 0b892ccb59 refactor(cdp): reuse Emulation admission and transient failures 2026-10-01 16:51:46 +08:00
ldm0 e36271e0d0 refactor(cdp): let preparation select supported native commands 2026-10-01 16:51:46 +08:00
ldm0 7cef1b4e51 refactor(cdp): remove single-variant DOM and AX work wrappers 2026-10-01 16:51:46 +08:00
ldm0 117dce412b refactor(cdp): share node lookups with explicit chain execution 2026-10-01 16:51:46 +08:00
ldm0 6e30806c72 refactor(cdp): register remote objects from the terminal payload 2026-10-01 16:51:46 +08:00
ldm0 0c3b9cd6d3 refactor(cdp): format native replies without adapter output plans 2026-10-01 16:51:46 +08:00
ldm0 75b191092d fix(cdp): keep DOM agent commands available while paused 2026-10-01 03:33:13 +08:00
ldm0 f62894ec3c refactor(cdp): publish Emulation replies with exact replay ownership
Use the shared frontend admission and native terminal path for renderer
configuration. Keep Browser replay policy on its captured owner, record
admitted idle state, and project a fallback only if publication lost.

Verify mixed native replies precede later Inspector replay and that
isolate-entering configuration waits for the suspended owner to resume.
2026-10-01 03:33:13 +08:00
ldm0 69b3f96239 refactor(cdp): publish DOM and debugger replies with ordered state updates
Migrate node queries, edits, focus, files, remote objects, DOMDebugger and
Autofill to renderer-owned terminals. Freeze document notifications and
object registry updates at the producer boundary, preserve object aliases,
and keep isolate-entering lookup chains on the owner turn.
2026-10-01 03:33:13 +08:00
ldm0 44011a899c refactor(cdp): publish CSS and accessibility replies at the renderer
Run native lookups and bounded continuations through the shared terminal
path. Publish stylesheet inventory notifications before ready responses,
and preserve exact owner routing in direct Page test fixtures.

Use the parsed fixture and stylesheet notification boundary to verify
Page and CSS commands preserve their independent isolate-entry requirements.
2026-10-01 03:33:13 +08:00
ldm0 a18314640a refactor(cdp): publish native terminals through the renderer journal
Share terminal authority with Inspector and publish ready native replies
after their renderer facts, independently of adapter polling. Keep typed
internal completions separate and settle caches against the exact residence.

Define exhaustive backend entry requirements for nested Main dispatch and
release Main and IO admission at backend entry. Bind native continuations
and preserve their owner lifecycle before terminal projection.

Migrate Page and DOMSnapshot through the generic operation boundary,
including live tree URLs, initial DocumentLoader identity, document capture
and isolated worlds. Cover cancellation, retirement and pause ordering,
and release held popup fixture routes before awaiting initialization.
2026-10-01 03:33:13 +08:00
ldm0 89863e976c fix(cdp): replay Runtime notifications before enable responses
Publish existing contexts, console messages and exceptions before the
Runtime.enable terminal for pages and workers. Check the enable boundary
without a compensating command, and retain deferred reply progress.
2026-10-01 03:33:13 +08:00
ldm0 ce2edbb9e1 fix(mime): unify JSON/font types and response header extraction
Accept text/json for JSON modules and use one is_json_mime classifier across
modules, documents, JSONPath, and resource inspection. Remove the module and
document aliases and recognize the seven registered application font types.

Use Fetch MIME extraction over the complete Content-Type header list for
script/style checks, workers, WebAssembly, ORB, and JSONPath. Derive classic
script charsets from the same MIME record, including charset inheritance and
resets when the MIME essence changes, while preserving BOM and fallback order.

Cover valid and invalid MIME types, header ordering, combined fields, quoted
commas, nosniff, and charset selection with regression tests.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast: 19,005 passed, 16 skipped
- Focused WPT: Moli passes 9 cases / 261 subtests, including the three JSON
  regressions and all 31 script Content-Type extraction checks.
2026-09-29 23:17:46 +08:00
ldm0 fcfc477212 fix(cdp): normalize empty target creation URLs
Normalize an empty Target.createTarget URL to about:blank before constructing the renderer command so initial target metadata and navigation state agree. Regression coverage exercises default and browser-context target creation.

Validation: all branch checks passed. Summary [ 115.491s] 18922 tests run: 18922 passed (9 slow), 16 skipped
2026-09-29 18:25:21 +08:00
ldm0 83a78cf6e3 fix(document): decode main XML responses before parsing
Keep network XML response bytes intact through the existing raw-body renderer
path. Decode both network and external XML bodies with the shared response
decoder, then install the selected encoding before document bootstrap.
Remove the obsolete ready-body capture variant used by the old XML path.

Cover matching main-document and iframe text, namespaces, and characterSet for
Atom, RSS, and text/*+xml responses with Windows-1252 headers, XML declarations,
and UTF-16LE/BE BOMs. Exercise the external input as single-byte chunks and
verify that BOMs override a conflicting transport charset.

Validation:
- Before the fix, the network regression returned caf� / UTF-8 instead of
  café / windows-1252.
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- Six focused XML tests passed.
- NEXTEST_TEST_THREADS=8 cargo nextest run --no-fail-fast:
  18,954 passed, 16 skipped.
2026-09-29 18:01:12 +08:00
ldm0 a3af75845d fix(document): preserve inherited encoding and XML MIME routing
Keep valid inherited text encodings ahead of heuristic detection while
preserving BOM, transport charset, and JSON default precedence. Share the
response decoder between streaming main documents, asynchronous child
loads, data URLs, and blocking child snapshots.

Classify navigation XML MIME types independently of DOMParser's allowlist,
including +xml subtypes in parser routing and text exclusions. Add
regressions for inherited UTF-8, literal encoding declarations, XML
namespaces, and DOMParser rejection of navigation-only XML types.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- NEXTEST_TEST_THREADS=8 cargo nextest run --no-fail-fast
  18,952 passed, 16 skipped. Two existing timing tests failed under the
  default concurrency, then passed individually and in the full run above.
2026-09-29 18:01:12 +08:00
lanyue-llk 9d236a20ef fix(parser): preserve text document MIME and encoding semantics 2026-09-29 18:01:12 +08:00
ldm0 91a4480b8a fix(protocol): retain navigation ownership during response body reads
Keep request identity and cancellation in Fetch while read tasks exclusively own response data. Match completions to the registered read instead of reinserting transfers or replying to navigations from I/O completion.

Retire superseded reads immediately, drain reads on Fetch disable, and preserve typed read errors. Cover delayed successes, failures, request reuse, cancellation, and debugger-paused supersession.
2026-09-29 02:50:43 +08:00