Commit Graph
85 Commits
Author SHA1 Message Date
ldm0 55e1f5c657 refactor(css): share functional pseudo argument extraction
Pseudo-element identity and computed styles duplicate extraction of a functional pseudo argument. Reuse one CSS utility, retaining literal prefix/parenthesis matching, empty-name rejection and borrowing from the original input.
2026-11-09 22:10:22 +08:00
ldm0 5716d23954 refactor(style): share canonical style invalidation and publication 2026-11-08 08:02:56 +08:00
ldm0 056508a499 perf(style): prepare ancestor inline styles once per export 2026-11-07 11:15:32 +08:00
ldm0 fececdeea0 perf(markdown): reuse Stylo context across exported nodes 2026-11-07 11:15:32 +08:00
ldm0 25fc163df4 fix(renderer): honor content visibility locks during Markdown export 2026-11-03 17:07:17 +08:00
lanyue-llk 851e619ee3 fix(renderer): preserve text flow before display blockification 2026-11-03 17:07:17 +08:00
lanyue-llk 919029e577 fix(renderer): preserve source and disclosure boundaries in one style pass 2026-11-03 17:07:17 +08:00
lanyue-llk fad2219f9b fix(renderer): export live rendered content through shared markdown conversion 2026-11-03 17:07:17 +08:00
ldm0 eac226d361 fix(stylesheets): evaluate parser media in the owning document 2026-11-03 07:53:58 +08:00
ldm0 d7d045a45a refactor(css): share native Stylo media query evaluation 2026-11-03 07:53:58 +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 fe4378d80a fix(fonts): order CSS font candidates by cascade layer
Project the document-wide layer order retained by Stylo into native font resources and connected selection priorities. Preserve public FontFaceSet iteration order, manual priority and loaded declaration identities across layer-only CSSOM edits.

Validate with real narrow/wide font bytes, source and layer order permutations, cross-sheet empty-layer edits, native selection without JS projection, and nested/unlayered/manual precedence.

Validation: cargo fmt --all; cargo clippy --workspace --all-targets --all-features -- -D warnings; cargo nextest run --no-fail-fast (20699 passed); Release layer-cssom-order-reverse.html (4/4 assertions passed).
2026-10-28 05:55:19 +08:00
ldm0 16531fca65 fix(css): restore default hyperlink colors 2026-10-25 22:26:25 +08:00
ldm0 bf3c9d1093 fix(fonts): separate declaration identity from shared sources
Independent CSS FontFace wrappers shared mutable descriptors and a registration slot, while a permanent stylesheet flag made detached faces disappear after manual re-addition. Give each native rule and JS face a distinct registration identity, share only source loading/validated data, and track native CSS and FontFaceSet membership in each Document. Native CSS cleanup revokes only its own relation; descriptor changes affect only their owning face. Explicit native layout can map a newly inserted declaration to cached source bytes without mutating the authoritative registrations or borrowing another declaration's descriptor.

Validation: cargo fmt --all; strict all-feature workspace Clippy;
cargo nextest run --no-fail-fast (20680 tests run: 20680 passed (9 slow), 19 skipped).
2026-10-24 05:03:25 +08:00
ldm0 6e6bb4e430 fix(fonts): admit local-only CSS font declarations
Pure CSS `@font-face` declarations containing only `local()` sources were omitted from the native stylesheet resource manifest because projection required finding a URL. Retain local-only declarations with no network URL and let the existing native source loader resolve them. Network admission assigns a URL only when a URL source is selected; image requests still always have one.

Validation: cargo fmt --all; strict all-feature workspace Clippy;
cargo nextest run --no-fail-fast (20628 tests run: 20628 passed (9 slow), 19 skipped).
2026-10-24 01:03:34 +08:00
ldm0 700236f029 fix(css): enable native variable font properties 2026-10-23 04:26:49 +08:00
ldm0 4ae2dabfc6 fix(fonts): publish CSS declaration order without JS projection 2026-10-23 04:07:15 +08:00
ldm0 c7130a3059 fix(fonts): share native FontFace loading across CSS and JS 2026-10-23 04:07:15 +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 f3a4e64995 fix(print): isolate PDF style and font environments from screen state 2026-10-21 02:18:52 +08:00
ldm0 3ca6888b9d perf(style): preserve unaffected styles after consuming ordinary fragments
Extract shared invalidation from realtime layout commit dfeda25e6d. Retain original source ownership, detached-subtree cleanup, real splice ordering and structural-effect limits. Add selector/cache regressions and a normal-CLI before/after benchmark.
2026-10-20 05:52:15 +08:00
ldm0 07368cea9a perf(layout): reuse prepared context for anonymous styles 2026-10-16 20:03:07 +08:00
Arjen de Vos a1e3651dff fix(fonts): accept legacy variable font format hints
`@font-face` sources declared with the pre-`tech()` variable font hints
(`woff2-variations`, `woff-`, `truetype-`, `opentype-variations`) were
treated as unsupported and never fetched, so the face fell back to a
system font. Chrome still accepts these hints, and Fontsource emits
`woff2-variations` for every face of its variable packages. Both format
filters now map them to the container format they name.
2026-10-15 19:28:24 +08:00
ldm0 1b05e14af2 fix(dom): honor computed content visibility in innerText
Use computed style facts for content-visibility locks instead of reading
inline declarations. Hidden-until-found and stylesheet-hidden contents
stay out of innerText until revealed or overridden by the CSS cascade.

Remove the obsolete inline-only readers and cover hidden-until-found,
boolean hidden, synchronous reveal, and important stylesheet overrides.

Fixes MOL-113.
2026-10-11 17:33:50 +08:00
ldm0 f70ebff0a1 fix(svg): resolve detached font lengths with initial style
Resolve em and ex SVG lengths in disconnected documents using the initial computed font style. Keep live styled elements on their existing resolved-style path. Regressions cover detached HTML and XML documents, child realms, and inherited fonts. Extract the existing context resolver for reuse by the initial-font path; preserve live-element resolution unchanged. Factory-created lengths have no associated element, so their font basis remains initial when the factory is styled or removed.
2026-10-11 06:15:23 +08:00
ldm0 4997e6d0d3 fix(accessibility): project computed visibility and composed names 2026-10-10 11:53:21 +08:00
ldm0 dab1b0ed51 refactor: centralize cookie domain parsing and simplify control flow 2026-10-08 19:56:33 +08:00
ldm0 b1a1f73d90 refactor(cssom): share public computed property enumeration 2026-10-07 18:56:02 +08:00
ldm0 07276a671f perf(style): avoid allocating single-document mutation groups
Handle an ordinary single-node mutation inside the grouping function,
returning a SmallVec group that borrows the original effect slice. Keep
the entry small and inline, and use a batch helper for owned groups and
subtree splitting across documents. Iterate groups by reference.

The invalidation caller consumes one uniform grouping result; a single
node mutation avoids cloning effects and allocating grouping containers.

Record the isolated borrowing A/B conditions, timings, and confidence
intervals beside the single-effect fast path.

Validation of the resulting branch:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast (19,490 passed, 16 skipped)
2026-10-07 03:28:07 +08:00
ldm0 3e3d4d3e5e perf(style): inline single effects during DOM mutation conversion
Return SmallVec<[StyleMutationEffect; 1]> from from_dom_mutation_effects.
Handle a pure single character-data update inside the converter before
constructing the deduplication set. Keep the notification call uniform;
batches preserve their existing order and deduplication.

Cover repeated text updates, :empty styles, and MutationObserver old values
in live and windowless documents.

Validation of the resulting branch:
- cargo fmt --all
- cargo clippy --workspace --all-targets --all-features -- -D warnings
- cargo nextest run --no-fail-fast (19,490 passed, 16 skipped)

Performance vs parent b75de5c66f (fixed local WeChat HTML, release,
JS/CSS/subframes disabled, 100 balanced randomized pairs):
Wall median 180.575 -> 165.316 ms (-8.45%). Paired median saving
13.885 ms; bootstrap 95% CI [12.364, 19.486] ms. The code tree matches
the previously validated and measured SmallVec version 84c5a81cca.
2026-10-07 03:28:07 +08:00
ldm0 a2febfc69c fix(layout): preserve bidi contexts across forced line breaks 2026-10-03 18:32:34 +08:00
ldm0 b8fb80345e perf(fonts): skip pristine style materialization without sources
Avoid materializing a document style world during font reconciliation when no font state, style state or active author stylesheet exists. Keep document and connected shadow-root adopted sheets observable, and retain reconciliation after any state has been published. Tests cover the lazy path and shadow adopted-sheet sources.

Validation: all branch checks passed. Summary [ 104.769s] 18923 tests run: 18923 passed (9 slow), 16 skipped
2026-09-29 16:22:43 +08:00
ldm0 f06370a4b7 feat(cssom): expose native font palette value rules
Expose CSSFontPaletteValuesRule with native parsing and read-only name, fontFamily, basePalette, and overrideColors descriptors. Attached rules read Stylo state; removed rules retain their descriptors through the existing native snapshot parser.

Regression coverage checks valid/invalid insertion, serialization, rule removal, native receiver brands, cross-realm access, and intrinsic constructor lookup.

Validation: fmt, strict workspace clippy, full nextest. Summary [ 104.120s] 18906 tests run: 18906 passed (9 slow), 16 skipped
2026-09-29 07:25:05 +08:00
ldm0 381c1c6a50 Split style invalidator tests by concern 2026-09-28 18:40:05 +08:00
ldm0 6708044876 Split subtree cache tests by concern 2026-09-28 18:40:05 +08:00
ldm0 511c8a2341 refactor(parser): centralize element construction lifecycles
Separate parser provenance from active child construction. Share one
construction session across HTML/XML parsers and runtime adapters, with
completion ownership, normal-EOF checks, and cancellation that does not
publish incomplete styles.

Use ordinary creation for generated document shells and remove obsolete
per-element completion forwarding. Cover parser ownership, adoption,
duplicate completion, missing callbacks, and cancellation in tests.
2026-09-26 07:01:12 +08:00
ldm0 83e0afd1a1 fix(css): avoid reparsing incomplete inline styles
Process parser-created style sources after their closing tag or EOF, and
prepare later source changes through the stylesheet owner lifecycle.
Keep synchronization and CSSOM reads on prepared sources so CSSOM edits
survive reads and document initialization.

Complete styles in inert XML parsing and build the XML viewer through
ordinary DOM creation. Cover streaming, EOF, child documents, fragments,
and XML stylesheet behavior in regression tests.
2026-09-26 07:01:12 +08:00
lanyue-llk bcf420f622 revert: undo split PR 640 merges (#734-#740) 2026-09-22 20:02:07 +08:00
mini llk c5ac254058 fix(layout): refresh geometry and preserve inline fragments (#735) 2026-09-22 19:42:55 +08:00
ldm0 10a78042fe fix(cssom): append computed custom properties 2026-09-16 13:31:16 +08:00
ldm0 01f5ee6e46 fix(dialog): apply modal UA styles and top-layer state
Source: 639cb1916b, f57c3dd731, cac97d8b9a
2026-09-16 01:54:38 +08:00
ldm0 284667a01a feat(emulation): apply native screen geometry and resolution 2026-09-15 14:46:31 +08:00
ldm0 4a0a8304a7 feat(emulation): support reduced transparency preferences 2026-09-15 14:46:31 +08:00
ldm0 6c6886e585 test(css): cover registered relative currentcolor values
Source: 329918b754
2026-09-14 21:55:24 +08:00
ldm0 8371d328dd fix(css): enable starting-style parsing 2026-09-14 05:55:33 +08:00
ldm0 0e3227fecc fix(marquee): enforce hidden UA overflow 2026-09-14 05:53:07 +08:00
ldm0 8b13f372d8 fix(style): reject stale sibling topology during deferred invalidation
Check retained child-list relations when draining structural mutation batches. Fall back to lazy source-scope invalidation when removed nodes or old neighbors have moved, covering both old and new scopes without mixing historical and live sibling links.

Keep safe insertion batches precise, defer disconnected child-list effects consistently, and cover reorder, reinsert, moved-neighbor, relative-selector, and cross-shadow regressions.
2026-09-09 04:32:04 +08:00
ldm0 acf1eb859a perf(style): reuse cached owner import metadata 2026-09-06 01:36:17 +08:00
ldm0 db38025ff1 fix(css): disable presentation hints with author styles 2026-09-04 03:46:02 +08:00
ldm0 2cba5a7aeb feat(fetch): add disable-css mode 2026-09-04 03:46:02 +08:00