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

3521 fix for double nested color subtitles #3522

Conversation

david-hm-morgan
Copy link
Contributor

@david-hm-morgan david-hm-morgan commented Jul 13, 2021

Description

TTML Parser can produce multiple depth nested cues where colors set at one level need to be applied down further.
Fixes #3521 by ensuring the parentCue is considered for bg/color in the Text Displayer passing null at the top layer and the parent down whenever processing nesting of cues.

Screenshots (optional)

Screenshot 2021-07-13 at 19 55 45

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to
    not work as expected)
  • This change requires a documentation update

Checklist:

  • I have signed the Google CLA https://cla.developers.google.com
  • My code follows the style guidelines of this project
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have verified my change on multiple browsers on different platforms
  • I have run ./build/all.py and the build passes
  • I have run ./build/test.py and all tests pass

@david-hm-morgan david-hm-morgan marked this pull request as ready for review July 13, 2021 19:07
style.backgroundColor = cue.backgroundColor;
}
if (isLeaf && parentCue && cue.backgroundColor == '') {
style.backgroundColor = parentCue.backgroundColor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This really seems like something that should be solved with style inheritance instead. Do you have any idea why the element doesn't already inherit the parent's background and color styles?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that the styles defined here (https://github.com/google/shaka-player/blob/master/ui/less/containers.less#L229-L235) overwrite those of the parent element (background-color and color)

@david-hm-morgan
Copy link
Contributor Author

Closing this as a simpler fix can be made in CSS after observations from community.

@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.

XML text subtitles (bg)color not applied to doubly nested cues
3 participants