| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 static_assert(HTMLTrackElement::LOADED == static_cast<HTMLTrackElement::ReadySta
te>(TextTrack::Loaded), "HTMLTrackElement::LOADED should be in sync with TextTra
ck::Loaded"); | 300 static_assert(HTMLTrackElement::LOADED == static_cast<HTMLTrackElement::ReadySta
te>(TextTrack::Loaded), "HTMLTrackElement::LOADED should be in sync with TextTra
ck::Loaded"); |
| 301 static_assert(HTMLTrackElement::TRACK_ERROR == static_cast<HTMLTrackElement::Rea
dyState>(TextTrack::FailedToLoad), "HTMLTrackElement::TRACK_ERROR should be in s
ync with TextTrack::FailedToLoad"); | 301 static_assert(HTMLTrackElement::TRACK_ERROR == static_cast<HTMLTrackElement::Rea
dyState>(TextTrack::FailedToLoad), "HTMLTrackElement::TRACK_ERROR should be in s
ync with TextTrack::FailedToLoad"); |
| 302 | 302 |
| 303 void HTMLTrackElement::setReadyState(ReadyState state) | 303 void HTMLTrackElement::setReadyState(ReadyState state) |
| 304 { | 304 { |
| 305 ensureTrack()->setReadinessState(static_cast<TextTrack::ReadinessState>(stat
e)); | 305 ensureTrack()->setReadinessState(static_cast<TextTrack::ReadinessState>(stat
e)); |
| 306 if (HTMLMediaElement* parent = mediaElement()) | 306 if (HTMLMediaElement* parent = mediaElement()) |
| 307 return parent->textTrackReadyStateChanged(m_track.get()); | 307 return parent->textTrackReadyStateChanged(m_track.get()); |
| 308 } | 308 } |
| 309 | 309 |
| 310 HTMLTrackElement::ReadyState HTMLTrackElement::readyState() | 310 HTMLTrackElement::ReadyState HTMLTrackElement::getReadyState() |
| 311 { | 311 { |
| 312 return static_cast<ReadyState>(ensureTrack()->readinessState()); | 312 return static_cast<ReadyState>(ensureTrack()->getReadinessState()); |
| 313 } | 313 } |
| 314 | 314 |
| 315 const AtomicString& HTMLTrackElement::mediaElementCrossOriginAttribute() const | 315 const AtomicString& HTMLTrackElement::mediaElementCrossOriginAttribute() const |
| 316 { | 316 { |
| 317 if (HTMLMediaElement* parent = mediaElement()) | 317 if (HTMLMediaElement* parent = mediaElement()) |
| 318 return parent->fastGetAttribute(HTMLNames::crossoriginAttr); | 318 return parent->fastGetAttribute(HTMLNames::crossoriginAttr); |
| 319 | 319 |
| 320 return nullAtom; | 320 return nullAtom; |
| 321 } | 321 } |
| 322 | 322 |
| 323 HTMLMediaElement* HTMLTrackElement::mediaElement() const | 323 HTMLMediaElement* HTMLTrackElement::mediaElement() const |
| 324 { | 324 { |
| 325 Element* parent = parentElement(); | 325 Element* parent = parentElement(); |
| 326 if (isHTMLMediaElement(parent)) | 326 if (isHTMLMediaElement(parent)) |
| 327 return toHTMLMediaElement(parent); | 327 return toHTMLMediaElement(parent); |
| 328 return nullptr; | 328 return nullptr; |
| 329 } | 329 } |
| 330 | 330 |
| 331 DEFINE_TRACE(HTMLTrackElement) | 331 DEFINE_TRACE(HTMLTrackElement) |
| 332 { | 332 { |
| 333 visitor->trace(m_track); | 333 visitor->trace(m_track); |
| 334 visitor->trace(m_loader); | 334 visitor->trace(m_loader); |
| 335 HTMLElement::trace(visitor); | 335 HTMLElement::trace(visitor); |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace blink | 338 } // namespace blink |
| OLD | NEW |