| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. | 2 * Copyright (c) 2013, Opera Software ASA. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); | 185 setInlineStyleProperty(CSSPropertyWidth, CSSValueAuto); |
| 186 setInlineStyleProperty(CSSPropertyHeight, displayParameters.size, CSSPr
imitiveValue::UnitType::Percentage); | 186 setInlineStyleProperty(CSSPropertyHeight, displayParameters.size, CSSPr
imitiveValue::UnitType::Percentage); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // The 'text-align' property on the (root) List of WebVTT Node Objects must | 189 // The 'text-align' property on the (root) List of WebVTT Node Objects must |
| 190 // be set to the value in the second cell of the row of the table below | 190 // be set to the value in the second cell of the row of the table below |
| 191 // whose first cell is the value of the corresponding cue's WebVTT cue | 191 // whose first cell is the value of the corresponding cue's WebVTT cue |
| 192 // text alignment: | 192 // text alignment: |
| 193 setInlineStyleProperty(CSSPropertyTextAlign, displayParameters.textAlign); | 193 setInlineStyleProperty(CSSPropertyTextAlign, displayParameters.textAlign); |
| 194 | 194 |
| 195 // TODO(philipj): The position adjustment for non-snap-to-lines cues has | 195 // TODO(foolip): The position adjustment for non-snap-to-lines cues has |
| 196 // been removed from the spec: | 196 // been removed from the spec: |
| 197 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19178 | 197 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=19178 |
| 198 if (std::isnan(displayParameters.snapToLinesPosition)) { | 198 if (std::isnan(displayParameters.snapToLinesPosition)) { |
| 199 // 10.13.1 Set up x and y: | 199 // 10.13.1 Set up x and y: |
| 200 // Note: x and y are set through the CSS left and top above. | 200 // Note: x and y are set through the CSS left and top above. |
| 201 | 201 |
| 202 // 10.13.2 Position the boxes in boxes such that the point x% along the | 202 // 10.13.2 Position the boxes in boxes such that the point x% along the |
| 203 // width of the bounding box of the boxes in boxes is x% of the way | 203 // width of the bounding box of the boxes in boxes is x% of the way |
| 204 // across the width of the video's rendering area, and the point y% | 204 // across the width of the video's rendering area, and the point y% |
| 205 // along the height of the bounding box of the boxes in boxes is y% | 205 // along the height of the bounding box of the boxes in boxes is y% |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 // replayed or when the user slides back to an already rendered track. | 813 // replayed or when the user slides back to an already rendered track. |
| 814 applyUserOverrideCSSProperties(); | 814 applyUserOverrideCSSProperties(); |
| 815 return m_displayTree; | 815 return m_displayTree; |
| 816 } | 816 } |
| 817 | 817 |
| 818 createVTTNodeTree(); | 818 createVTTNodeTree(); |
| 819 | 819 |
| 820 m_cueBackgroundBox->removeChildren(); | 820 m_cueBackgroundBox->removeChildren(); |
| 821 m_vttNodeTree->cloneChildNodes(m_cueBackgroundBox.get()); | 821 m_vttNodeTree->cloneChildNodes(m_cueBackgroundBox.get()); |
| 822 | 822 |
| 823 // TODO(philipj): The region identifier may be non-empty without there being | 823 // TODO(foolip): The region identifier may be non-empty without there being |
| 824 // a corresponding region, in which case this VTTCueBox will be added | 824 // a corresponding region, in which case this VTTCueBox will be added |
| 825 // directly to the text track container in updateDisplay(). | 825 // directly to the text track container in updateDisplay(). |
| 826 if (regionId().isEmpty()) { | 826 if (regionId().isEmpty()) { |
| 827 VTTDisplayParameters displayParameters = calculateDisplayParameters(); | 827 VTTDisplayParameters displayParameters = calculateDisplayParameters(); |
| 828 m_displayTree->applyCSSProperties(displayParameters); | 828 m_displayTree->applyCSSProperties(displayParameters); |
| 829 } else { | 829 } else { |
| 830 m_displayTree->setInlineStyleProperty(CSSPropertyPosition, CSSValueRelat
ive); | 830 m_displayTree->setInlineStyleProperty(CSSPropertyPosition, CSSValueRelat
ive); |
| 831 } | 831 } |
| 832 | 832 |
| 833 // Apply user override settings for text tracks | 833 // Apply user override settings for text tracks |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 | 1141 |
| 1142 DEFINE_TRACE(VTTCue) | 1142 DEFINE_TRACE(VTTCue) |
| 1143 { | 1143 { |
| 1144 visitor->trace(m_vttNodeTree); | 1144 visitor->trace(m_vttNodeTree); |
| 1145 visitor->trace(m_cueBackgroundBox); | 1145 visitor->trace(m_cueBackgroundBox); |
| 1146 visitor->trace(m_displayTree); | 1146 visitor->trace(m_displayTree); |
| 1147 TextTrackCue::trace(visitor); | 1147 TextTrackCue::trace(visitor); |
| 1148 } | 1148 } |
| 1149 | 1149 |
| 1150 } // namespace blink | 1150 } // namespace blink |
| OLD | NEW |