Commit Graph
99 Commits
Author SHA1 Message Date
ldm0 071e553e5b refactor(dom): name atomic move semantics consistently 2026-11-13 02:01:36 +08:00
ldm0 e454dd9cc3 fix(dialog): clear modal registration on node removal and adoption
Clear native modal state and the old Document registration when connected nodes are removed or adopted. Keep validated atomic moves in their original opening and priority, including the split DOMDebugger path. Cover light and shadow subtrees, adoption and background inertness.
2026-11-13 01:42:40 +08:00
ldm0 523f0ba783 fix(dialog): bind Escape close requests to one modal opening
Capture the Document, dialog and opening generation before cancel dispatch and verify them before closure. Removing open invalidates the request without clearing modal registration. Cover close/reopen, nonmodal reopen, raw attribute toggles, no-op operations and exact queued close-event counts.
2026-11-13 01:42:40 +08:00
ldm0 454052c5a9 fix(dialog): dismiss modals in opening order per document 2026-11-13 01:42:40 +08:00
ldm0 1c00ef7443 fix(dump): strip adopted shadow stylesheets from exports 2026-11-12 23:26:36 +08:00
ldm0 db7c53eb73 fix(dump): inline live frames inside shadow roots 2026-11-12 23:26:36 +08:00
lanyue-llk d529fe2d00 fix(dump): keep child frame shadow roots and scripting flags in html dumps 2026-11-12 23:26:36 +08:00
ldm0 60324b4d4e fix(forms): use native button Auto state in validation and activation
Derive submit-button behavior from the native Auto state, command attributes and parent element. Route form ownership, intrinsic validation, activation and selector checks through the shared classification and retain the source activation regressions.

Source-commit: c9576e0fc3
2026-11-11 14:02:03 +08:00
ldm0 7dc50cf065 refactor(forms): derive button type keyword parsing
Use the existing source EnumString declaration to parse button type keywords. Preserve ASCII case-insensitivity and the Auto fallback for missing or invalid values, with the native state tests already present on main.

Source-commit: c9576e0fc3
2026-11-11 06:29:26 +08:00
ldm0 2a5339f6c2 refactor(forms): reuse native form owner classification
The renderer repeats the native DOM classifier for built-in elements with a reflected form owner. Reuse the DOM implementation and preserve the HTML namespace check and exact built-in element set, keeping custom-element handling separate at callers.
2026-11-09 18:51:47 +08:00
ldm0 223376afaa test(media): cover cold volume writes and conversion reentry 2026-11-08 02:00:43 +08:00
ldm0 6c327dd98d fix(media): preserve ownership and enable audio node constructors
Track media source ownership on native elements across wrapper worlds.
Share MediaSession state per Window and complete the action enum.
Implement GainNode and MediaElementAudioSourceNode constructors with the
existing Web IDL converters and shared factory initialization.

Cover isolated worlds, navigation, callback collection and constructor
contracts in renderer regressions. Follow up #2468.
2026-11-07 11:36:02 +08:00
ldm0 181166559f feat(dom): retain source response status on Document identities 2026-11-07 11:27:57 +08:00
ldm0 e956b0f90e perf(dom): skip shadow walks when no roots are registered 2026-11-07 11:15:32 +08:00
ldm0 20b724ba0a fix(forms): track image form owners 2026-11-06 11:45:42 +08:00
ldm0 8f4e824b3a fix(forms): reset parser-associated form owners 2026-11-06 11:45:42 +08:00
ldm0 830dbac358 fix(dom): compare foreign node trees in their own arenas 2026-11-01 18:27:24 +08:00
ldm0 15812c1d21 feat(dom): retain delivered meta referrer policy on each Document
Retain valid delivered meta referrer policies on their native owner Document. Preserve delivery ordering and independent cloned Document state.

Validation (32 build jobs / test threads, zero retries):

- `cargo fmt --all`
- `cargo clippy --workspace --all-targets --all-features -- -D warnings`
- `cargo nextest run --no-fail-fast`: Summary [ 133.798s] 21996 tests run: 21996 passed (9 slow), 19 skipped
2026-10-31 18:55:48 +08:00
ldm0 31e00c3feb fix(dom): record same-value namespace attribute writes
Queue observer records for every same-value attribute write, including setAttributeNS and dataset. Keep meta declaration processing independent so it does not queue a duplicate record.
2026-10-29 15:39:43 +08:00
ldm0 8cdb89fc14 fix(html): use actual attribute identities for meta refresh
Report the matched Attr local name and namespace from ordinary and namespace-aware writes, then match refresh attributes exactly. Cover unrelated uppercase/namespaced mutations and ordinary HTML case folding in both main and child Documents.
2026-10-29 15:39:43 +08:00
ldm0 7f08c25f08 fix(dom): preserve template document identity and adoption lifecycles
Share a lazy inert owner across each document's template contents and keep
HTML/XML semantics, interface identity, and template-owner state separate.
Cloning preserves interfaces while creating independent owner state.

Separate portable Document metadata from arena-local relationships. Use
one metadata-copy boundary for Document cloning and main-document
replacement, clearing template-owner and CSS-target handles while keeping
whole-DOM snapshots and copy-on-write storage relationships intact. Metadata
copies also discard base-element href/target caches while retaining about
base URLs and explicit overrides; only DOM node cloning freezes computed
base URLs. Detached Document URL readers use native metadata without JS
URL/documentURI/baseURI shadow state, including selector and bridge readers.

Apply the DOM-specific document cloning rules separately: freeze the source
computed base URL as an override, separately retain the inherited about
base URL, and rebuild base-element caches from the cloned tree. Preserve
main-document replacement metadata semantics.

Establish exact HTML template identity and associated fragment allocation
in one native entry shared by DOM and parser creation. Clone actual native
contents rather than guessing from names, preserving foreign and mixed-case
elements through serialization, deep cloning, import and adoption. Keep HTML
createElement normalization at its binding boundary; namespace-aware creation
and wrapper selection preserve the exact local name, including registry paths.

Plan per-node adoption targets across ordinary children, shadow roots and
template contents. Retarget custom-element registries and callbacks with
the actual destination documents, and clear cross-document shadow sheets
while retaining sheets within a document and its own template owner.
Avoid preparing unused inert style sources.

Cover cross-arena ID collisions, metadata preservation, snapshot isolation,
nested templates, deep adoption, iframe/detached documents, cloned
interfaces, retained sheet arrays, registry associations and URL behavior.
2026-10-29 02:54:08 +08:00
ldm0 5ea0c64479 fix(dom): expose inert template documents through Document
Track the inert template-document role separately from HTML/XML semantics.
Choose the Document wrapper for that role while preserving the source kind
for HTML name normalization and XML element creation.

Cover parser/createElement/innerHTML paths in main and child documents,
DOMParser and createHTMLDocument sources, and XHTML contents. Ordinary
Document interfaces retain their existing identity.

Validation: cargo fmt --all; strict workspace/all-targets/all-features
Clippy; 86 template-related tests across three stress iterations; full
Nextest 21,167 passed, 19 skipped, without retries.
2026-10-28 15:07:56 +08:00
ldm0 93aa0dba93 fix(dom): retain lossless DocumentType strings in native copies
Extracted from wpt-misc-fix (4ecc927d5c).

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (32 build jobs / test threads).
Summary [ 130.006s] 20886 tests run: 20886 passed (9 slow), 19 skipped
2026-10-26 18:02:49 +08:00
ldm0 b2fc3dd65c fix(html): preserve child meta refresh with shared scheduling
Process parser and script-created refresh declarations in order and retain them
on their owning Document across load callbacks and adoption. Share candidate
priority and deadline state between main and child documents, and arm child
timers after owner load completes.

Consume queued work by exact Document identity and revision, classify navigation
when it fires, and keep the registered target URL. Reprocess same-value meta
attributes using the matched Attr identity so XML case, namespaces, observer
records, and refresh deadlines remain correct.

Cover competing declarations, stale tasks, independent frames, load/adoption
boundaries, sandbox/shadow handling, saved targets, and fragment navigation.
2026-10-26 03:17:22 +08:00
ldm0 4b6a02470c fix(dom): preserve native Element identities when copying between documents 2026-10-25 03:40:03 +08:00
ldm0 e78f5a33b2 feat(layout): update Taffy and Stylo forks with current Blitz adapters
Move Taffy to 0.15 and Stylo to 0.22 using fixed fork revisions, with the
matching stylo_taffy adapter. Upgrade cssparser and the production HTML/XML
parsers while preserving the vendored XML behavior.

Adapt sizing inputs, baselines, grid positions, overflow and out-of-flow
ownership. Preserve font-stretch CSSOM compatibility and intrinsic sizing
through nested atomic inline probes.

Validation: root cargo fmt --all; strict workspace/all-target/all-feature
Clippy; Nextest 20280 passed, 18 skipped; Release build; five browser
regression rounds; RTL and nested intrinsic Chromium geometry controls.
Full WPT Cross is recorded separately with its Cases refresh.

Original-commit: 281a920d89
2026-10-21 17:55:02 +08:00
ldm0 29393a6cfb fix(dom): retain encodings in native Document state 2026-10-21 16:41:12 +08:00
ldm0 4ee081b81b fix(dom): retain default mute state until an explicit preference 2026-10-18 05:18:47 +08:00
ldm0 e0df01a2cd fix(dom): retarget adopted shadow trees before reinsertion
Retarget ShadowRoot ownership and descendants along with the adopted host,
and collect stylesheet owners from nested shadow trees. Cover closed and
nested roots, inactive documents, and deep iterative adoption.
2026-10-17 20:09:30 +08:00
ldm0 5be5f7c50d feat(pdf): preserve clickable links and internal destinations 2026-10-13 00:34:09 +08:00
ldm0 68408732cb fix(input): align mouse click targeting with Chromium
Keep press and current mouse targets in host-owned state so synchronous
DOM removals invalidate or retarget them before click dispatch. Resolve
click and auxclick targets through the flat tree, preserve captured click
targets, and dispatch mouseup before lostpointercapture.

Cover sibling targets, Shadow DOM, slots, removal and reinsertion, and
pointer capture with deterministic input regressions.
2026-10-12 18:58:56 +08:00
ldm0 e3538c8999 fix(stylesheets): honor quirks mode MIME compatibility 2026-10-12 17:17:55 +08:00
ldm0 b1d06cde76 fix(domparser): retain HTML document parse modes 2026-10-12 17:08:29 +08:00
ldm0 6e70b3f1cf perf(accessibility): keep uncommon AX fields out of line
Group ignored reasons, values and nonempty properties behind one optional box. Use nonzero backend IDs and serialize fixed role/name kinds on demand, reducing the common AX node from 296 to 96 bytes while preserving payload shape and field order.

Add reproducible CLI and native construction benchmarks. Generated 40000-row text dumps use 382.6 to 341.5 MiB peak RSS; 200000-row text dumps use 1753.5 to 1612.8 MiB. Record the roughly 5.5 percent native construction cost for dense ignored nodes alongside the memory gains.

Validation: cargo fmt --all; workspace clippy with all targets/features and warnings denied; cargo nextest run --no-fail-fast (19890 passed, 17 skipped). All 188 formal benchmark samples match their corresponding before/after outputs.
2026-10-11 17:37:40 +08:00
ldm0 1404fa344b perf(accessibility): avoid JSON intermediates in semantic dumps
Large semantic dumps retain a JSON object graph with allocated field names
and string node references for every AX node before formatting the output.

Build compact typed nodes with numeric references and pass them directly
from the renderer to the CLI. Keep one AX traversal for both typed nodes
and CDP payloads, converting protocol nodes individually as they are built.
Preserve omitted/empty fields, field insertion order, list markers, and
frame-root attachment order. Render text iteratively and trim in place.

Add compatibility coverage and a standalone benchmark that stages both
executables on the same filesystem, alternates runs, records peak RSS and
wall time, and rejects changes to dump output bytes.

Against main at 5f5e1fff3 on a generated 40,000-row list (three interleaved
runs, medians):
- semantic_tree_text: 718.42 -> 390.96 MiB; 2.919 -> 2.204 s.
- semantic_tree: 815.71 -> 483.81 MiB; 2.484 -> 2.369 s.
- markdown control: 95.52 -> 95.59 MiB; 0.895 -> 0.913 s.

A generated 200,000-row list also completes with identical bytes (one run):
- semantic_tree_text: 3473.02 -> 1775.07 MiB; 13.245 -> 10.015 s.
- semantic_tree: 3803.45 -> 2137.26 MiB; 12.626 -> 10.397 s.

JSON/text comparisons also match the baseline on a mixed fixture containing
hidden/ignored nodes, form values, list markers, shadow DOM, and child frames.
These generated fixtures are independent of the external MOL-269 evidence.

Validation:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast (19,885 passed, 17 skipped)
- cargo build --release -p moli

Refs: MOL-269
2026-10-11 17:37:40 +08:00
ldm0 fd2ed360cc fix(accessibility): preserve NBSP in accessible names 2026-10-11 17:34:34 +08:00
ldm0 9b726d5821 fix(accessibility): use descendant text alternatives in control names 2026-10-11 01:35:41 +08:00
ldm0 b4aa3aaea6 feat(forms): distinguish button Auto state in the core 2026-10-10 18:36:22 +08:00
ldm0 f9fd34422a feat(dom): add lossless native DOM string values
Add the native DOMString value representation that preserves unpaired UTF-16 code units and exposes a scalar projection for native consumers. Equality and hashing retain original units; parser scalar appends preserve allocation capacity. Unit coverage includes surrogate identity and append boundaries. This PR provides the native value API; migrating all DOM producers is separate work.
2026-10-10 18:30:37 +08:00
ldm0 ae20434893 perf(accessibility): build request projections on demand 2026-10-10 11:53:21 +08:00
ldm0 4997e6d0d3 fix(accessibility): project computed visibility and composed names 2026-10-10 11:53:21 +08:00
ldm0 37e8bf746c fix(accessibility): include shadow controls in AX snapshots 2026-10-10 11:53:21 +08:00
ldm0 111afae3bb feat(svg): expose native value and element interfaces
Completes native SVG value and element interface exposure in one independently mergeable PR against main, refreshing the former SVG constructor PR. Animated scalar values, angles, preserve-aspect-ratio values and live point/string/number/length/transform lists provide the shared native DOM foundation for the added elements.

Adds the remaining component-transfer, flood, image, merge, merge-node and tile filter interfaces; SVGSwitchElement and SVGMPathElement; and the animation, animate, set, animate-motion and animate-transform interfaces. Native factories, inheritance, SVGTests lists, attribute reflection, receiver validation and animation event handlers use native objects and the existing DOM backend.

Tests cover main/iframe realms, live and windowless documents, native identity, value/list mutation, units, Trusted Types, animation target resolution, handlers and timing argument validation. All internal SVG dependencies are included here, with no external PR merge order.

Filter raster rendering and SMIL scheduling remain unimplemented. Timing controls reject NotSupportedError, getStartTime reports no interval, and getCurrentTime remains zero. The separate SVG path parser changes and animated-string UTF-16 storage migration are excluded. The retained length synchronization is included; a separate ignored regression records the lone-surrogate limitation in the current DOM attribute storage.

SVG event-handler properties reuse main's existing shared event backend. Tests verify replacement, clearing, canonical event types, cancellation and realm/receiver identity; complete handler/listener registration-order semantics remain part of the separate event-handler backend migration.
2026-10-09 14:54:14 +08:00
ldm0 00e18d6aef build(deps): update indexmap to 2.14.2 2026-10-07 18:23:02 +08:00
ldm0 8bb9c18f22 fix(forms): finalize clean input values after parser attributes 2026-10-07 14:11:22 +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 19667e531a perf(dom): better inline script performance 2026-10-05 20:48:11 +08:00
ldm0 ca0a4c81a2 feat(webmcp): add native form schemas, fill intents, and activity states
Introduce moli-webmcp for native form schema synthesis, complete input validation,
numeric conversion, and JSON-LD results. Preserve requested selection values in
fill intents so the renderer can apply them to current controls after author
input events.

Add native tool activity states, selector support, control helpers, and
a namespace-aware form index that includes open and closed shadow trees.
Pin the Stylo revision providing the activity pseudo-classes.

Validation on this commit tree: cargo fmt --all;
cargo clippy --workspace --all-targets --all-features -- -D warnings;
cargo nextest run --no-fail-fast.
Summary [  98.804s] 19248 tests run: 19248 passed, 16 skipped
2026-10-05 15:25:06 +08:00
ldm0 bc116c16dc fix(dom): match class-name collections using document quirks mode 2026-10-03 17:40:52 +08:00
ldm0 0a6a6e3fa0 fix(dom): mask AX password values per UTF-16 code unit
Count UTF-16 code units when masking password values to match Chromium.
Cover initial and live values across ASCII, BMP, supplementary characters,
combining sequences, ZWJ emoji, and empty passwords, verified against
Chromium 145 in 14 cases.
2026-10-03 13:35:10 +08:00