Chromium Code Reviews| Index: Source/core/html/shadow/MediaControlElements.cpp |
| diff --git a/Source/core/html/shadow/MediaControlElements.cpp b/Source/core/html/shadow/MediaControlElements.cpp |
| index be6779c55324872696413abccf8029f093a151b9..a0b67fee661092e71287a6b9fb738a029bb00bbc 100644 |
| --- a/Source/core/html/shadow/MediaControlElements.cpp |
| +++ b/Source/core/html/shadow/MediaControlElements.cpp |
| @@ -735,28 +735,33 @@ void MediaControlTextTrackContainerElement::updateDisplay() |
| if (!cue->track() || !cue->track()->isRendered() || !cue->isActive()) |
| continue; |
| - RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size()); |
| - VTTRegion* region = 0; |
| - if (cue->track()->regions()) |
| - region = cue->track()->regions()->getRegionById(cue->regionId()); |
| - |
| - if (!region) { |
| - // If cue has an empty text track cue region identifier or there is no |
| - // WebVTT region whose region identifier is identical to cue's text |
| - // track cue region identifier, run the following substeps: |
| - if (displayBox->hasChildNodes() && !contains(displayBox.get())) |
| - // Note: the display tree of a cue is removed when the active flag of the cue is unset. |
| - appendChild(displayBox); |
| - } else { |
| - // Let region be the WebVTT region whose region identifier |
| - // matches the text track cue region identifier of cue. |
| - RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document()); |
| - |
| - // Append the region to the viewport, if it was not already. |
| - if (!contains(regionNode.get())) |
| - appendChild(regionNode); |
| - |
| - region->appendTextTrackCueBox(displayBox); |
| + if (cue->isVTTCue()) { |
|
acolwell GONE FROM CHROMIUM
2013/11/20 18:38:45
It feels like this logic should be inside VTTCue.
gasubic
2013/11/21 03:07:38
Done
|
| + RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplaySize.size()); |
| + VTTRegion* region = 0; |
| + if (cue->track()->regions()) { |
| + VTTCue* vttCue = toVTTCue(cue); |
| + region = cue->track()->regions()->getRegionById(vttCue->regionId()); |
| + } |
| + |
| + if (!region) { |
| + // If cue has an empty text track cue region identifier or there is no |
| + // WebVTT region whose region identifier is identical to cue's text |
| + // track cue region identifier, run the following substeps: |
| + if (displayBox->hasChildNodes() && !contains(displayBox.get())) { |
| + // Note: the display tree of a cue is removed when the active flag of the cue is unset. |
| + appendChild(displayBox); |
| + } |
| + } else { |
| + // Let region be the WebVTT region whose region identifier |
| + // matches the text track cue region identifier of cue. |
| + RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document()); |
| + |
| + // Append the region to the viewport, if it was not already. |
| + if (!contains(regionNode.get())) |
| + appendChild(regionNode); |
| + |
| + region->appendTextTrackCueBox(displayBox); |
| + } |
| } |
| } |