Skip to content

Commit

Permalink
fix(TTML): Fix wrong writing-mode in nested cues (#5646)
Browse files Browse the repository at this point in the history
  • Loading branch information
avelad authored and joeyparrish committed Sep 13, 2023
1 parent 58298e2 commit 521c239
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/text/ttml_text_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,11 +222,12 @@ shaka.text.TtmlTextParser = class {
}
}

const parentIsContent = isContent;
if (cueNode.nodeName == 'p' || imageElement) {
isContent = true;
}

const parentIsContent = isContent;

const spaceStyle = cueElement.getAttribute('xml:space') ||
(whitespaceTrim ? 'default' : 'preserve');

Expand Down
7 changes: 3 additions & 4 deletions test/text/ttml_text_parser_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1866,9 +1866,8 @@ describe('TtmlTextParser', () => {
endTime: 60,
payload: '',
fontSize: '15px',
// Styles from regionStyle should apply only to the nested cue.
backgroundColor: '',
color: '',
backgroundColor: 'transparent',
color: 'blue',
displayAlign: Cue.displayAlign.CENTER,
textAlign: Cue.textAlign.CENTER,

Expand Down Expand Up @@ -1970,7 +1969,7 @@ describe('TtmlTextParser', () => {
startTime: 0,
endTime: 60,
payload: '',
fontSize: '',
fontSize: '16px',
nestedCues: [
{
startTime: 0,
Expand Down

0 comments on commit 521c239

Please sign in to comment.