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 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 { | 772 { |
773 RefPtr<VTTCueBox> displayBox = getDisplayTree(videoSize); | 773 RefPtr<VTTCueBox> displayBox = getDisplayTree(videoSize); |
774 VTTRegion* region = 0; | 774 VTTRegion* region = 0; |
775 if (track()->regions()) | 775 if (track()->regions()) |
776 region = track()->regions()->getRegionById(regionId()); | 776 region = track()->regions()->getRegionById(regionId()); |
777 | 777 |
778 if (!region) { | 778 if (!region) { |
779 // If cue has an empty text track cue region identifier or there is no | 779 // If cue has an empty text track cue region identifier or there is no |
780 // WebVTT region whose region identifier is identical to cue's text | 780 // WebVTT region whose region identifier is identical to cue's text |
781 // track cue region identifier, run the following substeps: | 781 // track cue region identifier, run the following substeps: |
782 if (displayBox->hasChildNodes() && !container.contains(displayBox.get())
) { | 782 if (displayBox->hasChildren() && !container.contains(displayBox.get()))
{ |
783 // Note: the display tree of a cue is removed when the active flag o
f the cue is unset. | 783 // Note: the display tree of a cue is removed when the active flag o
f the cue is unset. |
784 container.appendChild(displayBox); | 784 container.appendChild(displayBox); |
785 } | 785 } |
786 } else { | 786 } else { |
787 // Let region be the WebVTT region whose region identifier | 787 // Let region be the WebVTT region whose region identifier |
788 // matches the text track cue region identifier of cue. | 788 // matches the text track cue region identifier of cue. |
789 RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document()); | 789 RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document()); |
790 | 790 |
791 // Append the region to the viewport, if it was not already. | 791 // Append the region to the viewport, if it was not already. |
792 if (!container.contains(regionNode.get())) | 792 if (!container.contains(regionNode.get())) |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 return m_cueBackgroundBox->executionContext(); | 1065 return m_cueBackgroundBox->executionContext(); |
1066 } | 1066 } |
1067 | 1067 |
1068 Document& VTTCue::document() const | 1068 Document& VTTCue::document() const |
1069 { | 1069 { |
1070 ASSERT(m_cueBackgroundBox); | 1070 ASSERT(m_cueBackgroundBox); |
1071 return m_cueBackgroundBox->document(); | 1071 return m_cueBackgroundBox->document(); |
1072 } | 1072 } |
1073 | 1073 |
1074 } // namespace WebCore | 1074 } // namespace WebCore |
OLD | NEW |