Skip to content

Fix render blank output when <html dir="rtl"> changes capture behavior #1934

Description

@miguel-heygen

Two independent reports showed hyperframes render can output a blank/black MP4 when the composition sets dir="rtl" (or another non-ltr value) on the top-level <html> element, while preview/snapshot render correctly.

PR #1893 adds an advisory lint rule because the workaround is confirmed: keep lang on <html>, remove dir from <html>, and scope direction: rtl to text-containing elements instead.

This issue tracks the root render-pipeline fix. The leading hypothesis from #1893 is that packages/engine/src/services/screenshotService.ts clips Page.captureScreenshot to a fixed { x: 0, y: 0, width, height } region and assumes content sits at the document top-left. RTL document direction may shift scroll-origin/viewport semantics so the fixed clip captures blank space in headless render.

Minimal repro direction:

  • Create a small composition with <html dir="rtl"> and visible absolutely-positioned text/content.
  • Verify preview/snapshot are correct.
  • Run hyperframes render and compare output frames/video against the same composition with the dir removed and direction: rtl applied to the text element.
  • Inspect Page.captureScreenshot clip behavior in screenshotService.ts against the page's layout/visual viewport metrics.

Acceptance criteria:

  • Render no longer produces blank/black output for top-level RTL document direction, or the runtime emits a precise render-time diagnostic if Chromium/CDP cannot support the case.
  • Regression coverage exercises the actual render/capture path, not only the lint advisory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions