Skip to content

Parse WebVTT REGION blocks into Layout objects#380

Merged
OlteanuRares merged 3 commits into
mainfrom
OCTO-11114
Jul 2, 2026
Merged

Parse WebVTT REGION blocks into Layout objects#380
OlteanuRares merged 3 commits into
mainfrom
OCTO-11114

Conversation

@OlteanuRares

Copy link
Copy Markdown
Contributor

Implement region parsing in the WebVTT reader so that cues referencing
a region get proper origin/extent geometry (using W3C TTML-WebVTT
mapping formulas), enabling correct cross-format conversion to DFXP
and other positioned formats.

Also includes:

  • Fix .x/.y typo in geometry.py fit_to_screen() safety guard
  • Fix _remove_noon_off_on_italics typo in SCC specialized_collections
  • Add empty-collection guard in _remove_spaces_at_end_of_the_line
  • Replace magic numbers with _InstructionNode constants
  • Remove dead _remove_styles() method from WebVTT reader
  • Remove redundant if-guard and unused class attributes in WebVTT writer

What changes for production

WebVTT files with REGION blocks: Previously region references were stored as raw passthrough only (no geometry). Now they produce Layout objects with computed origin/extent.
This is additive — cues without regions are unaffected.
VTT→VTT round-trip**: Preserved via webvtt_positioning passthrough (writer still outputs the raw cue settings string).
SCC→all formats: No behavior change. The SCC fixes are pure renames/guards with identical runtime behavior.
geometry.py fix: Affects a safety guard for absolute-unit clamping. Currently unexploitable (all callers pass percent values), but now correctly checks both axes.

  Implement region parsing in the WebVTT reader so that cues referencing
  a region get proper origin/extent geometry (using W3C TTML-WebVTT
  mapping formulas), enabling correct cross-format conversion to DFXP
  and other positioned formats.

  Also includes:
  - Fix .x/.y typo in geometry.py fit_to_screen() safety guard
  - Fix _remove_noon_off_on_italics typo in SCC specialized_collections
  - Add empty-collection guard in _remove_spaces_at_end_of_the_line
  - Replace magic numbers with _InstructionNode constants
  - Remove dead _remove_styles() method from WebVTT reader
  - Remove redundant if-guard and unused class attributes in WebVTT writer
@OlteanuRares OlteanuRares requested a review from a team as a code owner July 2, 2026 13:37
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🟡 PR Compliance Review

Risk Level: MEDIUM

  • Compliance Issues: 1 (0 critical)
  • Regressions: 0

REVIEW REQUIRED - Address issues before merging

Full report available in workflow artifacts

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🟡 PR Compliance Review

Risk Level: MEDIUM

  • Compliance Issues: 1 (0 critical)
  • Regressions: 0

REVIEW REQUIRED - Address issues before merging

Full report available in workflow artifacts

lorandvarga
lorandvarga previously approved these changes Jul 2, 2026
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

🟡 PR Compliance Review

Risk Level: MEDIUM

  • Compliance Issues: 1 (0 critical)
  • Regressions: 0

REVIEW REQUIRED - Address issues before merging

Full report available in workflow artifacts

@OlteanuRares OlteanuRares merged commit 48af7fd into main Jul 2, 2026
4 checks passed
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