Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1650)

Side by Side Diff: Source/core/html/track/vtt/VTTCue.cpp

Issue 276183002: Tighten the asserts in VTTCue::calculateDisplayParameters() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 m_displayPosition.first = m_textPosition - m_displaySize; 619 m_displayPosition.first = m_textPosition - m_displaySize;
620 else 620 else
621 m_displayPosition.first = 100 - m_textPosition - m_displaySize; 621 m_displayPosition.first = 100 - m_textPosition - m_displaySize;
622 break; 622 break;
623 case Middle: 623 case Middle:
624 if (m_displayDirection == CSSValueLtr) 624 if (m_displayDirection == CSSValueLtr)
625 m_displayPosition.first = m_textPosition - m_displaySize / 2; 625 m_displayPosition.first = m_textPosition - m_displaySize / 2;
626 else 626 else
627 m_displayPosition.first = 100 - m_textPosition - m_displaySize / 2; 627 m_displayPosition.first = 100 - m_textPosition - m_displaySize / 2;
628 break; 628 break;
629 case NumberOfAlignments: 629 default:
630 ASSERT_NOT_REACHED(); 630 ASSERT_NOT_REACHED();
631 } 631 }
632 } else { 632 } else {
633 // Cases for m_writingDirection being VerticalGrowing{Left|Right} 633 // Cases for m_writingDirection being VerticalGrowing{Left|Right}
634 switch (m_cueAlignment) { 634 switch (m_cueAlignment) {
635 case Start: 635 case Start:
636 case Left: 636 case Left:
637 m_displayPosition.second = m_textPosition; 637 m_displayPosition.second = m_textPosition;
638 break; 638 break;
639 case End: 639 case End:
640 case Right: 640 case Right:
641 m_displayPosition.second = m_textPosition - m_displaySize; 641 m_displayPosition.second = m_textPosition - m_displaySize;
642 break; 642 break;
643 case Middle: 643 case Middle:
644 m_displayPosition.second = m_textPosition - m_displaySize / 2; 644 m_displayPosition.second = m_textPosition - m_displaySize / 2;
645 break; 645 break;
646 case NumberOfAlignments: 646 default:
647 ASSERT_NOT_REACHED(); 647 ASSERT_NOT_REACHED();
648 } 648 }
649 } 649 }
650 650
651 // A text track cue has a text track cue computed line position whose value 651 // A text track cue has a text track cue computed line position whose value
652 // is defined in terms of the other aspects of the cue. 652 // is defined in terms of the other aspects of the cue.
653 m_computedLinePosition = calculateComputedLinePosition(); 653 m_computedLinePosition = calculateComputedLinePosition();
654 654
655 // 10.9 Determine the value of whichever of x-position or y-position is not 655 // 10.9 Determine the value of whichever of x-position or y-position is not
656 // yet calculated for cue as per the appropriate rules from the following 656 // yet calculated for cue as per the appropriate rules from the following
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1096 1096
1097 void VTTCue::trace(Visitor* visitor) 1097 void VTTCue::trace(Visitor* visitor)
1098 { 1098 {
1099 visitor->trace(m_vttNodeTree); 1099 visitor->trace(m_vttNodeTree);
1100 visitor->trace(m_cueBackgroundBox); 1100 visitor->trace(m_cueBackgroundBox);
1101 visitor->trace(m_displayTree); 1101 visitor->trace(m_displayTree);
1102 TextTrackCue::trace(visitor); 1102 TextTrackCue::trace(visitor);
1103 } 1103 }
1104 1104
1105 } // namespace WebCore 1105 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698