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

Conversation

joeyparrish
Copy link
Member

@joeyparrish joeyparrish commented Jan 30, 2023

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.

This also adds a filter parameter to the lab workflow to run a subset of tests for quicker results. This is useful for updating screenshots.

Closes b/259121343

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
avelad
avelad previously approved these changes Jan 30, 2023
theodab
theodab previously approved these changes Jan 30, 2023
@github-actions
Copy link
Contributor

Incremental code coverage: No instrumented code was changed.

@joeyparrish joeyparrish dismissed stale reviews from theodab and avelad via d1a2a56 January 30, 2023 23:24
@joeyparrish
Copy link
Member Author

Screenshots updated, crbug link added. Re-review is required to merge. Thanks!

@joeyparrish joeyparrish merged commit f456318 into shaka-project:main Jan 31, 2023
@joeyparrish joeyparrish deleted the fix-vtt-sizing branch January 31, 2023 00:01
joeyparrish added a commit that referenced this pull request Jan 31, 2023
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.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
joeyparrish added a commit that referenced this pull request Jan 31, 2023
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.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
joeyparrish added a commit that referenced this pull request Jan 31, 2023
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.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
joeyparrish added a commit that referenced this pull request Jan 31, 2023
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.

This also adds a filter parameter to the lab workflow to run a subset of
tests for quicker results. This is useful for updating screenshots.

Closes b/259121343
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants