fix(html): reject unknown scene attributes instead of dropping them - #252
Merged
Merged
Conversation
53 tasks
LeadcodeDev
force-pushed
the
fix/html-unknown-attributes
branch
2 times, most recently
from
September 22, 2026 08:35
122c9ec to
838dc53
Compare
Executed: <scene duration="2" freeze_at="1" world-position="0,0" animated- background="halo"> transpiles to a scene carrying only duration and layout — three documented scene features (CLAUDE.md documents all three) are discarded with no warning and validate exits 0. Same on the root: <rustmotion codec="prores" durationn="5"> drops both. Same on containers/text: <div gap="32" width="400" id="x"> keeps nothing but style/anim (element.rs:101-112 and :92-100 never iterate attrs). This is the exact failure mode check_component_attrs exists to prevent, but that check runs on the already-transpiled ResolvedScenario (validate_attrs.rs:79 check_component_attrs(scenario: &ResolvedScenario)) and only over scene.children — an attribute the transpiler never emitted is invisible to it, so the workspace's only unknown-attribute net has a blind spot precisely over the HTML front-end's own attribute surface. rm-* custom elements are the asymmetric exception: they forward everything and do get caught. Fix: After reading the known keys in scene_to_value and html_to_scenario_value, diff against the consumed set and return a named error (with did-you-mean, mirroring validate_attrs) for the remainder — class/id/data-* can be allowlisted as deliberately inert. Do the same for TagKind::Container/TagKind::Text. Separately, extend <scene>'s allowlist to cover freeze_at, world-position and animated-background, which are otherwise unreachable from HTML. Refs #220
LeadcodeDev
force-pushed
the
fix/html-unknown-attributes
branch
from
September 22, 2026 08:45
838dc53 to
6b6c8d9
Compare
LeadcodeDev
added a commit
that referenced
this pull request
Sep 22, 2026
…252) Executed: <scene duration="2" freeze_at="1" world-position="0,0" animated- background="halo"> transpiles to a scene carrying only duration and layout — three documented scene features (CLAUDE.md documents all three) are discarded with no warning and validate exits 0. Same on the root: <rustmotion codec="prores" durationn="5"> drops both. Same on containers/text: <div gap="32" width="400" id="x"> keeps nothing but style/anim (element.rs:101-112 and :92-100 never iterate attrs). This is the exact failure mode check_component_attrs exists to prevent, but that check runs on the already-transpiled ResolvedScenario (validate_attrs.rs:79 check_component_attrs(scenario: &ResolvedScenario)) and only over scene.children — an attribute the transpiler never emitted is invisible to it, so the workspace's only unknown-attribute net has a blind spot precisely over the HTML front-end's own attribute surface. rm-* custom elements are the asymmetric exception: they forward everything and do get caught. Fix: After reading the known keys in scene_to_value and html_to_scenario_value, diff against the consumed set and return a named error (with did-you-mean, mirroring validate_attrs) for the remainder — class/id/data-* can be allowlisted as deliberately inert. Do the same for TagKind::Container/TagKind::Text. Separately, extend <scene>'s allowlist to cover freeze_at, world-position and animated-background, which are otherwise unreachable from HTML. Refs #220
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Severity Medium, category coherence. Location:
crates/rustmotion-html/src/scene.rs:20Impact
Executed:
<scene duration="2" freeze_at="1" world-position="0,0" animated-background="halo">transpiles to a scene carrying onlydurationandlayout— three documented scene features (CLAUDE.md documents all three) are discarded with no warning andvalidateexits 0. Same on the root:<rustmotion codec="prores" durationn="5">drops both. Same on containers/text:<div gap="32" width="400" id="x">keeps nothing but style/anim (element.rs:101-112 and :92-100 never iterateattrs). This is the exact failure modecheck_component_attrsexists to prevent, but that check runs on the already-transpiledResolvedScenario(validate_attrs.rs:79check_component_attrs(scenario: &ResolvedScenario)) and only overscene.children— an attribute the transpiler never emitted is invisible to it, so the workspace's only unknown-attribute net has a blind spot precisely over the HTML front-end's own attribute surface.rm-*custom elements are the asymmetric exception: they forward everything and do get caught.Fix
After reading the known keys in
scene_to_valueandhtml_to_scenario_value, diff against the consumed set and return a named error (with did-you-mean, mirroring validate_attrs) for the remainder —class/id/data-*can be allowlisted as deliberately inert. Do the same forTagKind::Container/TagKind::Text. Separately, extend<scene>'s allowlist to coverfreeze_at,world-positionandanimated-background, which are otherwise unreachable from HTML.Evidence the audit read
Part of the September 2026 audit remediation chantier. Refs #220 (RM-03).