| 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 m_kind = kind; | 155 m_kind = kind; |
| 156 else | 156 else |
| 157 m_kind = subtitlesKeyword(); | 157 m_kind = subtitlesKeyword(); |
| 158 | 158 |
| 159 if (m_client && oldKind != m_kind) | 159 if (m_client && oldKind != m_kind) |
| 160 m_client->textTrackKindChanged(this); | 160 m_client->textTrackKindChanged(this); |
| 161 } | 161 } |
| 162 | 162 |
| 163 void TextTrack::setMode(const AtomicString& mode) | 163 void TextTrack::setMode(const AtomicString& mode) |
| 164 { | 164 { |
| 165 ASSERT(mode == disabledKeyword() || mode == hiddenKeyword() || mode == showi
ngKeyword()); |
| 166 |
| 165 // On setting, if the new value isn't equal to what the attribute would curr
ently | 167 // On setting, if the new value isn't equal to what the attribute would curr
ently |
| 166 // return, the new value must be processed as follows ... | 168 // return, the new value must be processed as follows ... |
| 167 if (mode != disabledKeyword() && mode != hiddenKeyword() && mode != showingK
eyword()) | |
| 168 return; | |
| 169 | |
| 170 if (m_mode == mode) | 169 if (m_mode == mode) |
| 171 return; | 170 return; |
| 172 | 171 |
| 173 // If mode changes to disabled, remove this track's cues from the client | 172 // If mode changes to disabled, remove this track's cues from the client |
| 174 // because they will no longer be accessible from the cues() function. | 173 // because they will no longer be accessible from the cues() function. |
| 175 if (mode == disabledKeyword() && m_client && m_cues) | 174 if (mode == disabledKeyword() && m_client && m_cues) |
| 176 m_client->textTrackRemoveCues(this, m_cues.get()); | 175 m_client->textTrackRemoveCues(this, m_cues.get()); |
| 177 | 176 |
| 178 if (mode != showingKeyword() && m_cues) | 177 if (mode != showingKeyword() && m_cues) |
| 179 for (size_t i = 0; i < m_cues->length(); ++i) | 178 for (size_t i = 0; i < m_cues->length(); ++i) |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 return EventTargetNames::TextTrack; | 489 return EventTargetNames::TextTrack; |
| 491 } | 490 } |
| 492 | 491 |
| 493 ExecutionContext* TextTrack::executionContext() const | 492 ExecutionContext* TextTrack::executionContext() const |
| 494 { | 493 { |
| 495 return m_document; | 494 return m_document; |
| 496 } | 495 } |
| 497 | 496 |
| 498 } // namespace WebCore | 497 } // namespace WebCore |
| 499 | 498 |
| OLD | NEW |