Skip to content

feat(style): expose resolved content provenance - #2

Open
lanyue-llk wants to merge 5 commits into
molifrom
codex/moli-style-provenance
Open

lanyue-llk wants to merge 5 commits into
molifrom
codex/moli-style-provenance

Conversation

@lanyue-llk

@lanyue-llk lanyue-llk commented Sep 29, 2026 •

Copy link
Copy Markdown

Why

Moli #919 needs style facts that only Stylo can determine after the real cascade and keyframe selection:

  • whether the winning visibility value is established on the element or inherited after variable substitution and cascade rollback;
  • whether a selected keyframes animation has no opacity effect, uses the underlying effect-stack value, explicitly replaces final opacity, or cannot be resolved.

Rewalking rule nodes or parsing stylesheet text in the consumer loses variable, layer, tree-scope, duplicate-offset, and effect-stack semantics.

Changes

  • record HAS_OWN_VISIBILITY after substitution and rollback select the winning declaration;
  • expose structured final opacity contribution as NoEffect, Underlying, Replace(value), or Unknown;
  • reuse runtime keyframe grouping, variable substitution, and computed-value conversion.

Both APIs are read-only. They add no parser, retained per-node cache, site rule, or case identifier.

Consumer

  • lexmount/moli#919 consumes both facts for reader-visible Markdown extraction.

Validation

  • cargo +1.96.1 check -p stylo --features servo passed for the implementation before the split;
  • the three affected style files are byte-identical to the previously validated combined head;
  • Chromium finish() independently confirms reveal then neutral endpoint 1, neutral endpoint then reveal 1, neutral endpoint alone 0, and reveal then a no-fill effect 1;
  • Moli integration coverage includes visibility variable outcomes, layer and source priority, duplicate final offsets, document/shadow scope isolation, animation slots, neutral endpoints, effect order, no-forward-fill effects, and paused/infinite boundaries.

This PR is based directly on lexmount/stylo:moli and contains only the resolved content provenance required by Moli #919.

@lanyue-llk

Copy link
Copy Markdown
Author

已将本 PR 的两项修改完整归并到 #1,并保留独立提交与原有验证记录。后续评审和 Moli 依赖统一以 #1 为入口,关闭此重复 PR。

@lanyue-llk lanyue-llk closed this Sep 30, 2026
@lanyue-llk lanyue-llk reopened this Sep 30, 2026
@lanyue-llk

Copy link
Copy Markdown
Author

更正此前“已归并到 #1、#2 重复”的说明:复核后确认两项 PR 解决的是不同问题。#1 是 preferred text scale 环境支持;本 PR #2 提供 Moli #919 实际需要的 resolved visibility / final opacity content provenance,不能由 #1 替代。

本 PR 已同步 Stylo moli 当前提交,最新 head 为 1032a2947ec2f7cee1027d07084203be87e17643,Linux debug/release、macOS debug、Windows debug 与汇总门禁均通过。Moli #919 已精确锁定该提交。此前评论作废,以当前 PR body 与本条更正为准。

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.

2 participants