Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2012 Google Inc. All rights reserved. | 3 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 728 // 10. For each text track cue cue in cues that has not yet had | 728 // 10. For each text track cue cue in cues that has not yet had |
| 729 // corresponding CSS boxes added to output, in text track cue order, run the | 729 // corresponding CSS boxes added to output, in text track cue order, run the |
| 730 // following substeps: | 730 // following substeps: |
| 731 for (size_t i = 0; i < activeCues.size(); ++i) { | 731 for (size_t i = 0; i < activeCues.size(); ++i) { |
| 732 TextTrackCue* cue = activeCues[i].data(); | 732 TextTrackCue* cue = activeCues[i].data(); |
| 733 | 733 |
| 734 ASSERT(cue->isActive()); | 734 ASSERT(cue->isActive()); |
| 735 if (!cue->track() || !cue->track()->isRendered() || !cue->isActive()) | 735 if (!cue->track() || !cue->track()->isRendered() || !cue->isActive()) |
| 736 continue; | 736 continue; |
| 737 | 737 |
| 738 RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisplayS ize.size()); | 738 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
| |
| 739 VTTRegion* region = 0; | 739 RefPtr<TextTrackCueBox> displayBox = cue->getDisplayTree(m_videoDisp laySize.size()); |
| 740 if (cue->track()->regions()) | 740 VTTRegion* region = 0; |
| 741 region = cue->track()->regions()->getRegionById(cue->regionId()); | 741 if (cue->track()->regions()) { |
| 742 VTTCue* vttCue = toVTTCue(cue); | |
| 743 region = cue->track()->regions()->getRegionById(vttCue->regionId ()); | |
| 744 } | |
| 742 | 745 |
| 743 if (!region) { | 746 if (!region) { |
| 744 // If cue has an empty text track cue region identifier or there is no | 747 // If cue has an empty text track cue region identifier or there is no |
| 745 // WebVTT region whose region identifier is identical to cue's text | 748 // WebVTT region whose region identifier is identical to cue's t ext |
| 746 // track cue region identifier, run the following substeps: | 749 // track cue region identifier, run the following substeps: |
| 747 if (displayBox->hasChildNodes() && !contains(displayBox.get())) | 750 if (displayBox->hasChildNodes() && !contains(displayBox.get())) { |
| 748 // Note: the display tree of a cue is removed when the active fl ag of the cue is unset. | 751 // Note: the display tree of a cue is removed when the activ e flag of the cue is unset. |
| 749 appendChild(displayBox); | 752 appendChild(displayBox); |
| 750 } else { | 753 } |
| 751 // Let region be the WebVTT region whose region identifier | 754 } else { |
| 752 // matches the text track cue region identifier of cue. | 755 // Let region be the WebVTT region whose region identifier |
| 753 RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(document( )); | 756 // matches the text track cue region identifier of cue. |
| 757 RefPtr<HTMLDivElement> regionNode = region->getDisplayTree(docum ent()); | |
| 754 | 758 |
| 755 // Append the region to the viewport, if it was not already. | 759 // Append the region to the viewport, if it was not already. |
| 756 if (!contains(regionNode.get())) | 760 if (!contains(regionNode.get())) |
| 757 appendChild(regionNode); | 761 appendChild(regionNode); |
| 758 | 762 |
| 759 region->appendTextTrackCueBox(displayBox); | 763 region->appendTextTrackCueBox(displayBox); |
| 764 } | |
| 760 } | 765 } |
| 761 } | 766 } |
| 762 | 767 |
| 763 // 11. Return output. | 768 // 11. Return output. |
| 764 if (hasChildNodes()) | 769 if (hasChildNodes()) |
| 765 show(); | 770 show(); |
| 766 else | 771 else |
| 767 hide(); | 772 hide(); |
| 768 } | 773 } |
| 769 | 774 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 791 float fontSize = smallestDimension * 0.05f; | 796 float fontSize = smallestDimension * 0.05f; |
| 792 if (fontSize != m_fontSize) { | 797 if (fontSize != m_fontSize) { |
| 793 m_fontSize = fontSize; | 798 m_fontSize = fontSize; |
| 794 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX); | 799 setInlineStyleProperty(CSSPropertyFontSize, fontSize, CSSPrimitiveValue: :CSS_PX); |
| 795 } | 800 } |
| 796 } | 801 } |
| 797 | 802 |
| 798 // ---------------------------- | 803 // ---------------------------- |
| 799 | 804 |
| 800 } // namespace WebCore | 805 } // namespace WebCore |
| OLD | NEW |