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

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

Issue 853933002: VTTCue: Don't compare m_displayPosition against undefinedPosition (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 } 657 }
658 } 658 }
659 659
660 // A text track cue has a text track cue computed line position whose value 660 // A text track cue has a text track cue computed line position whose value
661 // is defined in terms of the other aspects of the cue. 661 // is defined in terms of the other aspects of the cue.
662 m_computedLinePosition = calculateComputedLinePosition(); 662 m_computedLinePosition = calculateComputedLinePosition();
663 663
664 // 10.9 Determine the value of whichever of x-position or y-position is not 664 // 10.9 Determine the value of whichever of x-position or y-position is not
665 // yet calculated for cue as per the appropriate rules from the following 665 // yet calculated for cue as per the appropriate rules from the following
666 // list: 666 // list:
667 if (m_snapToLines && m_displayPosition.second == undefinedPosition && m_writ ingDirection == Horizontal) 667 if (m_snapToLines && m_writingDirection == Horizontal)
668 m_displayPosition.second = 0; 668 m_displayPosition.second = 0;
669 669
670 if (!m_snapToLines && m_displayPosition.second == undefinedPosition && m_wri tingDirection == Horizontal) 670 if (!m_snapToLines && m_writingDirection == Horizontal)
671 m_displayPosition.second = m_computedLinePosition; 671 m_displayPosition.second = m_computedLinePosition;
672 672
673 if (m_snapToLines && m_displayPosition.first == undefinedPosition 673 if (m_snapToLines && (m_writingDirection == VerticalGrowingLeft || m_writing Direction == VerticalGrowingRight))
674 && (m_writingDirection == VerticalGrowingLeft || m_writingDirection == V erticalGrowingRight))
675 m_displayPosition.first = 0; 674 m_displayPosition.first = 0;
676 675
677 if (!m_snapToLines && (m_writingDirection == VerticalGrowingLeft || m_writin gDirection == VerticalGrowingRight)) 676 if (!m_snapToLines && (m_writingDirection == VerticalGrowingLeft || m_writin gDirection == VerticalGrowingRight))
678 m_displayPosition.first = m_computedLinePosition; 677 m_displayPosition.first = m_computedLinePosition;
679 } 678 }
680 679
681 void VTTCue::markFutureAndPastNodes(ContainerNode* root, double previousTimestam p, double movieTime) 680 void VTTCue::markFutureAndPastNodes(ContainerNode* root, double previousTimestam p, double movieTime)
682 { 681 {
683 DEFINE_STATIC_LOCAL(const String, timestampTag, ("timestamp")); 682 DEFINE_STATIC_LOCAL(const String, timestampTag, ("timestamp"));
684 683
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 1104
1106 void VTTCue::trace(Visitor* visitor) 1105 void VTTCue::trace(Visitor* visitor)
1107 { 1106 {
1108 visitor->trace(m_vttNodeTree); 1107 visitor->trace(m_vttNodeTree);
1109 visitor->trace(m_cueBackgroundBox); 1108 visitor->trace(m_cueBackgroundBox);
1110 visitor->trace(m_displayTree); 1109 visitor->trace(m_displayTree);
1111 TextTrackCue::trace(visitor); 1110 TextTrackCue::trace(visitor);
1112 } 1111 }
1113 1112
1114 } // namespace blink 1113 } // namespace blink
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