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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 m_cueIndex = track()->cues()->getCueIndex(this); | 139 m_cueIndex = track()->cues()->getCueIndex(this); |
140 | 140 |
141 return m_cueIndex; | 141 return m_cueIndex; |
142 } | 142 } |
143 | 143 |
144 void TextTrackCue::invalidateCueIndex() | 144 void TextTrackCue::invalidateCueIndex() |
145 { | 145 { |
146 m_cueIndex = invalidCueIndex; | 146 m_cueIndex = invalidCueIndex; |
147 } | 147 } |
148 | 148 |
149 bool TextTrackCue::dispatchEvent(PassRefPtr<Event> event) | 149 bool TextTrackCue::dispatchEvent(PassRefPtrWillBeRawPtr<Event> event) |
150 { | 150 { |
151 // When a TextTrack's mode is disabled: no cues are active, no events fired. | 151 // When a TextTrack's mode is disabled: no cues are active, no events fired. |
152 if (!track() || track()->mode() == TextTrack::disabledKeyword()) | 152 if (!track() || track()->mode() == TextTrack::disabledKeyword()) |
153 return false; | 153 return false; |
154 | 154 |
155 return EventTarget::dispatchEvent(event); | 155 return EventTarget::dispatchEvent(event); |
156 } | 156 } |
157 | 157 |
158 bool TextTrackCue::isActive() | 158 bool TextTrackCue::isActive() |
159 { | 159 { |
160 return m_isActive && track() && track()->mode() != TextTrack::disabledKeywor
d(); | 160 return m_isActive && track() && track()->mode() != TextTrack::disabledKeywor
d(); |
161 } | 161 } |
162 | 162 |
163 void TextTrackCue::setIsActive(bool active) | 163 void TextTrackCue::setIsActive(bool active) |
164 { | 164 { |
165 m_isActive = active; | 165 m_isActive = active; |
166 | 166 |
167 // Remove the display tree as soon as the cue becomes inactive. | 167 // Remove the display tree as soon as the cue becomes inactive. |
168 if (!active) | 168 if (!active) |
169 removeDisplayTree(); | 169 removeDisplayTree(); |
170 } | 170 } |
171 | 171 |
172 const AtomicString& TextTrackCue::interfaceName() const | 172 const AtomicString& TextTrackCue::interfaceName() const |
173 { | 173 { |
174 return EventTargetNames::TextTrackCue; | 174 return EventTargetNames::TextTrackCue; |
175 } | 175 } |
176 | 176 |
177 } // namespace WebCore | 177 } // namespace WebCore |
OLD | NEW |