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

separation of (bg)color from other defaults #3713

Conversation

david-hm-morgan
Copy link
Contributor

Description

Solution to loss of (bg)color for nested captions via simpler CSS (.less file) update:

  • separation of default subtitle settings into colors and sizing/display properties.
  • unchanged application of the latter (NOT for shaka-text-wrapper classed spans)
  • change of application of the colors to be NOT for shaka-text-wrapper classed spans OR descendents of shaka-text-wrapper classed spans.
    Fixes XML text subtitles (bg)color not applied to doubly nested cues #3521

Screenshots (optional)

Screenshot 2021-10-24 at 14 32 52

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

@@ -303,12 +303,15 @@
transition-delay: 500ms;

/* These are defaults which are overridden by JS or cue styles. */
span:not(.shaka-text-wrapper, .shaka-text-wrapper span) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This selector will match nothing since the second not group will match any <span> elements. So this is effectively removing those defaults. I'll take a look at this issue since I'm working on a similar bug.

@shaka-bot shaka-bot closed this in cdeffbb Nov 3, 2021
joeyparrish pushed a commit that referenced this pull request Jan 5, 2022
First, the positioning of cues was incorrect.  We need to explicitly
set all the position attributes when we position elements with the
"absolute" position.

Second, if we position a text <span> manually, the background will fill
the whole region.  So to keep the background wrapping the text, we need
to add another <span> for the text.

Third, the background and font color should not be set on every <span>
element since it won't allow parent cues to set the inherited value.
So this moves the defaults to the top-level text element and allows
parent cue elements to override this.  It also would make app CSS
easier to override.  Because background color isn't inherited through
CSS, the default is set in JavaScript instead.

Fixes #3521
Fixes #3600
Closes #3713

Backported to v3.1.x

Change-Id: I45fc88dcac4a0a062e1474087f24c80d98eef619
joeyparrish pushed a commit that referenced this pull request Jan 5, 2022
First, the positioning of cues was incorrect.  We need to explicitly
set all the position attributes when we position elements with the
"absolute" position.

Second, if we position a text <span> manually, the background will fill
the whole region.  So to keep the background wrapping the text, we need
to add another <span> for the text.

Third, the background and font color should not be set on every <span>
element since it won't allow parent cues to set the inherited value.
So this moves the defaults to the top-level text element and allows
parent cue elements to override this.  It also would make app CSS
easier to override.  Because background color isn't inherited through
CSS, the default is set in JavaScript instead.

Fixes #3521
Fixes #3600
Closes #3713

Backported to v3.2.x

Change-Id: I45fc88dcac4a0a062e1474087f24c80d98eef619
@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
2 participants