OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * Copyright (C) 2011, 2012, 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2011, 2012, 2013 Apple 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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 m_trackList = trackList; | 136 m_trackList = trackList; |
137 invalidateTrackIndex(); | 137 invalidateTrackIndex(); |
138 } | 138 } |
139 | 139 |
140 bool TextTrack::isVisualKind() const | 140 bool TextTrack::isVisualKind() const |
141 { | 141 { |
142 return kind() == subtitlesKeyword() || kind() == captionsKeyword(); | 142 return kind() == subtitlesKeyword() || kind() == captionsKeyword(); |
143 } | 143 } |
144 | 144 |
145 void TextTrack::setKind(const AtomicString& newKind) | |
146 { | |
147 AtomicString oldKind = kind(); | |
148 TrackBase::setKind(newKind); | |
149 | |
150 // If kind changes from visual to non-visual and mode is 'showing', then for
ce mode to 'hidden'. | |
151 // FIXME: This is not per spec. crbug.com/460923 | |
152 if (oldKind != kind() && mode() == showingKeyword() && !isVisualKind()) | |
153 setMode(hiddenKeyword()); | |
154 } | |
155 | |
156 void TextTrack::setMode(const AtomicString& mode) | 145 void TextTrack::setMode(const AtomicString& mode) |
157 { | 146 { |
158 ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showi
ngKeyword()); | 147 ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showi
ngKeyword()); |
159 | 148 |
160 // On setting, if the new value isn't equal to what the attribute would curr
ently | 149 // On setting, if the new value isn't equal to what the attribute would curr
ently |
161 // return, the new value must be processed as follows ... | 150 // return, the new value must be processed as follows ... |
162 if (m_mode == mode) | 151 if (m_mode == mode) |
163 return; | 152 return; |
164 | 153 |
165 if (m_cues && cueTimeline()) { | 154 if (m_cues && cueTimeline()) { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 visitor->trace(m_trackList); | 468 visitor->trace(m_trackList); |
480 TrackBase::trace(visitor); | 469 TrackBase::trace(visitor); |
481 EventTargetWithInlineData::trace(visitor); | 470 EventTargetWithInlineData::trace(visitor); |
482 } | 471 } |
483 | 472 |
484 DEFINE_TRACE_WRAPPERS(TextTrack) | 473 DEFINE_TRACE_WRAPPERS(TextTrack) |
485 { | 474 { |
486 visitor->traceWrappers(m_cues); | 475 visitor->traceWrappers(m_cues); |
487 } | 476 } |
488 } // namespace blink | 477 } // namespace blink |
OLD | NEW |