Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(WebVTT): Fix horizontal positioning with cue box size #4949

Merged
merged 4 commits into from
Jan 31, 2023

Commits on Jan 30, 2023

  1. fix(WebVTT): Fix horizontal positioning with cue box size

    When the VTT size setting is used, the horizontal positioning was
    wrong in both native and UI display.
    
    The native display is wrong on Chrome and Edge because of a layout bug
    in Chrome, where the shadow DOM for the cue box has conflicting
    (redundant) styles.  For example, these VTT settings:
    
    `line: 85% position: 50% size: 63%`
    
    result in these styles in the shadow DOM:
    
    `top: 85%; left: 18.5%; transform: translate(-18.5%, -85%)`.
    
    The `translate` style is what breaks the positioning.  Unfortunately,
    there is no way to fix that in JavaScript.
    
    The UI display, however, was buggy for different reasons and is
    fixable.  The styles `left: 0; top: 0;` were applied by default, and
    then `top: 85%;` and `width: 63%;` were set based on the cue settings.
    The default of `left: 0` was what broke the positioning.  Removing
    this leaves `left` set implicitly to `auto`, which is correct.
    
    No other test cases were broken (or fixed) by this change.
    
    Closes b/259121343
    joeyparrish committed Jan 30, 2023
    Configuration menu
    Copy the full SHA
    8498dba View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3dc0616 View commit details
    Browse the repository at this point in the history
  3. Add crbug link

    joeyparrish committed Jan 30, 2023
    Configuration menu
    Copy the full SHA
    3982de0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d1a2a56 View commit details
    Browse the repository at this point in the history