(element: Element, fallback = 0)
| 495 | }; |
| 496 | |
| 497 | const resolveMediaStartSeconds = (element: Element, fallback = 0): number => { |
| 498 | if (!element.hasAttribute("data-hf-auto-start") && element.hasAttribute("data-start")) { |
| 499 | // `data-start` is authored relative to the media element's OWN sub- |
| 500 | // composition, not the root timeline — `fallback` carries the host |
| 501 | // composition's resolved absolute start (see syncMediaForCurrentState's |
| 502 | // inheritedStart), so it must be added, not discarded. Skipping it made |
| 503 | // a nested video play from root t=0 instead of holding until its |
| 504 | // parent scene began (issue #1838) — resolveStartForElement's own |
| 505 | // absolute-expression branch already adds this same host offset, this |
| 506 | // fast literal-value path just didn't. |
| 507 | const own = Math.max(0, Number(element.getAttribute("data-start") ?? 0) || 0); |
| 508 | return own + fallback; |
| 509 | } |
| 510 | return resolveStartForElement(element, fallback); |
| 511 | }; |
| 512 | |
| 513 | const isTimedElementVisibleAt = (rawNode: HTMLElement, currentTime: number): boolean => { |
| 514 | const tag = rawNode.tagName.toLowerCase(); |
no test coverage detected