Repository navigation
fix(cli): honor HTML attribute casing in frame-rate defaults - #5348
Conversation
jrusso1020
left a comment
There was a problem hiding this comment.
I checked the PR's core claim locally with linkedom: for DATA-FPS="24" data-fps="60" it keeps both attributes with their original case and getAttribute("data-fps") returns 60, while Chrome lowercases names and keeps the first duplicate (24). The new getHtmlAttribute matches names case-insensitively and takes the first duplicate. The root fallback compositions[0] is the same element as the old outermost-composition find, because the first match in document order cannot have a matching ancestor. The explicit-root value check stays case-sensitive (=== "true"), as before. Main's readCompositionFps is unchanged, and the tests exercise both the helper and resolveDefaultFpsArg/defaultCloudFps. Need: yes · Size: ok · Reuse: n/a · Simpler: already minimal.
— Rames
A root with
DATA-FPS="24"renders at 30 fps when--fpsis omitted, although Chrome reads the declaration as 24. The CLI's linkedom lookups preserve attribute spelling and also select a later duplicate lowercase attribute over an earlier uppercase one.Read composition IDs, explicit root markers, and frame rates using case-insensitive HTML attribute names, keeping the first duplicate attribute as browsers do. Root selection and frame-rate validation retain the existing precedence from #2008.
Validation:
--fps 60produces 60 frames at 60 fps.hyperframes lintandhyperframes checkwith no errors or warnings.The current-main integration retains the shared cloud-FPS defaults (24, 25, 30 and 60; unsupported declarations warn and fall back to 30). Mixed-case coverage now calls that helper. All 240 FPS/render/timeline/plan tests pass after a full workspace build. Four native Chrome cases agree with the source helper, and rebuilt CLI outputs contain 24 frames at 24 fps or, with explicit
--fps 60, 60 frames at 60 fps. Composition lint/check, CLI typecheck, lint, formatting, reachability, final comment checks and normal hooks pass. The GitHub-signed tree matches the tested merge.