Skip to content

Controller injected on <audio> is positioned at ~2× its offset, inflating page scrollHeight and adding huge empty space below the page #1570

Description

@katanumahotori

Bug Description

When VSC injects its controller onto an <audio> element that lives inside a position: relative (or otherwise positioned) container, the controller's absolute top is set to the media element's document offset again on top of the offset already contributed by the positioned ancestor. The result is the controller landing at roughly 2× the media element's Y position, far below the actual page content. This inflates document.documentElement.scrollHeight and produces a large empty/scrollable white area below the page footer.

Steps to Reproduce

  1. Install VSC, open this public page in Chrome: https://katanumahotori.com/blog/sorami-kohaku-interview
  2. The page contains two embedded podcast players, each rendered as an HTML5 <audio> element inside a position: relative card wrapper. The second one sits at about y = 26790px.
  3. Scroll to the bottom: there is ~24,000px of empty scrollable space below the footer.

Root cause (observed in DOM)

  • Clean browser (no extensions): document.documentElement.scrollHeight25,763px, footer is the last element (gap below footer = 0).
  • With VSC enabled: scrollHeight53,639px.
  • The extra height is caused by a single VSC node:
    <div id="controller" class="vsc-controller" style="top: 26789.9px; left: 616.6px; opacity: 0.3;"> whose rendered position (getBoundingClientRect().top + scrollY) is ≈ 53,608px — i.e. its CSS top (the audio's offset, 26,790px) is added on top of its positioned parent already at ~26,790px, doubling it.
  • Only the second <audio> (deeper in the page, inside the positioned wrapper) is affected. A media element near the top is fine.

Expected

The controller should be positioned relative to its media element (or appended in a way that doesn't double-count the offset), so it doesn't extend the document's scrollable height.

Environment

  • VSC: 0.10.2
  • Chrome on Windows 11
  • Reproducible on the public URL above (no login required)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions