Split screenshot and screencast capture contracts, publish one shared visual resource generation, and collect CSS image references during the real layout traversal. Add asynchronous publication and multi-session screencast regressions.
A document whose only encoding declaration is `<meta charset="utf-16">`
was decoded as UTF-16, folding every byte pair into one CJK code point.
The damage was not confined to text: the tokenizer saw no markup either,
so `<title>` and `<p>` disappeared and the whole document collapsed into
a single text node inside `<body>`.
The prescan reaches a `meta` element only by reading ASCII-compatible
bytes, so a document it can see that declares UTF-16 has necessarily
mislabeled itself. The HTML Standard therefore rewrites the charset
before returning it:
If charset is UTF-16BE/LE, then set charset to UTF-8.
If charset is x-user-defined, then set charset to windows-1252.
Apply both rewrites in `moli-charset-parser`, which covers the
`meta charset` and the `http-equiv=content-type` paths at once. Keeping
them there rather than in `moli-encoding` leaves the two neighbouring
paths that legitimately select UTF-16 untouched: a UTF-16 BOM, and a
UTF-16 charset on the transport layer, which the encoding sniffing
algorithm takes with confidence certain and does not rewrite. Both are
now covered by regression tests, alongside the rewrites themselves and a
check that unrelated labels and labels outside the Encoding Standard are
still resolved exactly as before.
Verified on aarch64-darwin: `cargo test -p moli-charset-parser
-p moli-encoding` passes 55 tests, and `cargo fmt`/`cargo clippy
--all-targets` are clean for both crates.
Closes#152
Use a synchronous prepare/commit/apply boundary for connected stylesheet lifecycle authority, so DocumentRuntime no longer acquires it through raw ContextHost pointers. Keep modulepreload network fetches identity-only and publish terminal link events without a Document load-delay lease.
Every option except `--header` was long-form only, so ordinary invocations
carried a lot of typing and boolean flags could not be grouped.
Assign short flags to the options that appear most often, leaving the rest
long-form. `CommonArgs` is flattened into both subcommands, so each letter
has to be unique across the fetch union and the serve union rather than
within one struct:
fetch -d dump, -w wait-until, -s wait-selector, -t timeout,
-n noscript, -H header (unchanged)
serve -p port, -t timeout
common -l layout, -r resource, -i image, -f font, -a audio, -v video,
-m media, -T text-track, -c cookie-file, -P profile-dir,
-A user-agent, -L log-level
The whole optional-resource family gets a letter so it clusters, which is
the shape the request asked for: `moli serve --layout --resource` is now
`moli serve -lr`, and `-ifavmT` selects every optional family.
`-P` rather than `-p` for `--profile-dir` keeps `-p` for the serve port.
`-A` for `--user-agent` follows curl. `-T` and `-L` are uppercase only
because `-t` and `-l` are taken. `--host` keeps no short so `-H` is not
overloaded, since it already means `--header` under fetch.
Two call sites match flags by literal string and needed the short
spellings as well, or they would have silently ignored them:
- `normalize_dump_flag`, so a bare `-d` still defaults to `html`;
- `FETCH_INFER_FLAGS` and `SERVE_INFER_FLAGS`, so `moli -d markdown URL`
still infers the fetch subcommand. Each short is mirrored beside the
long flag it aliases, so both spellings infer identically.
Guard the letters with `Cli::command().debug_assert()`, which is clap's
own duplicate-short check and runs over each subcommand's full union.
Fixes#121
Embeds the light/dark SVGs published by lexmount/moli-metrics, which
regenerates them hourly from the stargazer timeline and commits only when
the count actually changed. Added to all six language READMEs, using the
same <picture> theme-switching pattern as the existing benchmark charts.