| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : HTMLElement(trackTag, document) | 54 : HTMLElement(trackTag, document) |
| 55 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) | 55 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) |
| 56 { | 56 { |
| 57 WTF_LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); | 57 WTF_LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); |
| 58 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
| 59 } | 59 } |
| 60 | 60 |
| 61 HTMLTrackElement::~HTMLTrackElement() | 61 HTMLTrackElement::~HTMLTrackElement() |
| 62 { | 62 { |
| 63 if (m_track) | 63 if (m_track) |
| 64 m_track->clearClient(); | 64 m_track->clearTrackElement(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(Document& document) | 67 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(Document& document) |
| 68 { | 68 { |
| 69 return adoptRef(new HTMLTrackElement(document)); | 69 return adoptRef(new HTMLTrackElement(document)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode*
insertionPoint) | 72 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode*
insertionPoint) |
| 73 { | 73 { |
| 74 WTF_LOG(Media, "HTMLTrackElement::insertedInto"); | 74 WTF_LOG(Media, "HTMLTrackElement::insertedInto"); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 const AtomicString& HTMLTrackElement::mediaElementCrossOriginAttribute() const | 259 const AtomicString& HTMLTrackElement::mediaElementCrossOriginAttribute() const |
| 260 { | 260 { |
| 261 if (HTMLMediaElement* parent = mediaElement()) | 261 if (HTMLMediaElement* parent = mediaElement()) |
| 262 return parent->fastGetAttribute(HTMLNames::crossoriginAttr); | 262 return parent->fastGetAttribute(HTMLNames::crossoriginAttr); |
| 263 | 263 |
| 264 return nullAtom; | 264 return nullAtom; |
| 265 } | 265 } |
| 266 | 266 |
| 267 void HTMLTrackElement::textTrackKindChanged(TextTrack* track) | |
| 268 { | |
| 269 if (HTMLMediaElement* parent = mediaElement()) | |
| 270 return parent->textTrackKindChanged(track); | |
| 271 } | |
| 272 | |
| 273 void HTMLTrackElement::textTrackModeChanged(TextTrack* track) | |
| 274 { | |
| 275 // Since we've moved to a new parent, we may now be able to load. | |
| 276 if (readyState() == HTMLTrackElement::NONE) | |
| 277 scheduleLoad(); | |
| 278 | |
| 279 if (HTMLMediaElement* parent = mediaElement()) | |
| 280 return parent->textTrackModeChanged(track); | |
| 281 } | |
| 282 | |
| 283 void HTMLTrackElement::textTrackAddCues(TextTrack* track, const TextTrackCueList
* cues) | |
| 284 { | |
| 285 if (HTMLMediaElement* parent = mediaElement()) | |
| 286 return parent->textTrackAddCues(track, cues); | |
| 287 } | |
| 288 | |
| 289 void HTMLTrackElement::textTrackRemoveCues(TextTrack* track, const TextTrackCueL
ist* cues) | |
| 290 { | |
| 291 if (HTMLMediaElement* parent = mediaElement()) | |
| 292 return parent->textTrackRemoveCues(track, cues); | |
| 293 } | |
| 294 | |
| 295 void HTMLTrackElement::textTrackAddCue(TextTrack* track, PassRefPtr<TextTrackCue
> cue) | |
| 296 { | |
| 297 if (HTMLMediaElement* parent = mediaElement()) | |
| 298 return parent->textTrackAddCue(track, cue); | |
| 299 } | |
| 300 | |
| 301 void HTMLTrackElement::textTrackRemoveCue(TextTrack* track, PassRefPtr<TextTrack
Cue> cue) | |
| 302 { | |
| 303 if (HTMLMediaElement* parent = mediaElement()) | |
| 304 return parent->textTrackRemoveCue(track, cue); | |
| 305 } | |
| 306 | |
| 307 HTMLMediaElement* HTMLTrackElement::mediaElement() const | 267 HTMLMediaElement* HTMLTrackElement::mediaElement() const |
| 308 { | 268 { |
| 309 Element* parent = parentElement(); | 269 Element* parent = parentElement(); |
| 310 if (parent && parent->isMediaElement()) | 270 if (parent && parent->isMediaElement()) |
| 311 return toHTMLMediaElement(parentNode()); | 271 return toHTMLMediaElement(parentNode()); |
| 312 return 0; | 272 return 0; |
| 313 } | 273 } |
| 314 | 274 |
| 315 } | 275 } |
| OLD | NEW |