Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: Source/WebCore/html/HTMLTrackElement.cpp

Issue 7497054: Merge 92347 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 } 50 }
51 51
52 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagNa me, Document* document) 52 PassRefPtr<HTMLTrackElement> HTMLTrackElement::create(const QualifiedName& tagNa me, Document* document)
53 { 53 {
54 return adoptRef(new HTMLTrackElement(tagName, document)); 54 return adoptRef(new HTMLTrackElement(tagName, document));
55 } 55 }
56 56
57 void HTMLTrackElement::insertedIntoTree(bool deep) 57 void HTMLTrackElement::insertedIntoTree(bool deep)
58 { 58 {
59 HTMLElement::insertedIntoTree(deep); 59 HTMLElement::insertedIntoTree(deep);
60 if (parentNode() && (parentNode()->hasTagName(audioTag) || parentNode()->has TagName(videoTag))) { 60 Element* parent = parentElement();
61 if (parent && parent->isMediaElement()) {
61 // TODO(annacc): 62 // TODO(annacc):
62 // static_cast<HTMLMediaElement*>(parentNode())->trackWasAdded(this); 63 // static_cast<HTMLMediaElement*>(parentNode())->trackWasAdded(this);
63 } 64 }
64 } 65 }
65 66
66 void HTMLTrackElement::willRemove() 67 void HTMLTrackElement::willRemove()
67 { 68 {
68 if (parentNode() && (parentNode()->hasTagName(audioTag) || parentNode()->has TagName(videoTag))) { 69 Element* parent = parentElement();
70 if (parent && parent->isMediaElement()) {
69 // TODO(annacc): 71 // TODO(annacc):
70 // static_cast<HTMLMediaElement*>(parentNode())->trackWillBeRemoved(this ); 72 // static_cast<HTMLMediaElement*>(parentNode())->trackWillBeRemoved(this );
71 } 73 }
72 HTMLElement::willRemove(); 74 HTMLElement::willRemove();
73 } 75 }
74 76
75 KURL HTMLTrackElement::src() const 77 KURL HTMLTrackElement::src() const
76 { 78 {
77 return document()->completeURL(getAttribute(srcAttr)); 79 return document()->completeURL(getAttribute(srcAttr));
78 } 80 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 { 133 {
132 m_track = LoadableTextTrack::create(kind(), label(), srclang(), isDefault()) ; 134 m_track = LoadableTextTrack::create(kind(), label(), srclang(), isDefault()) ;
133 135
134 if (hasAttribute(srcAttr)) 136 if (hasAttribute(srcAttr))
135 m_track->load(getNonEmptyURLAttribute(srcAttr), context); 137 m_track->load(getNonEmptyURLAttribute(srcAttr), context);
136 } 138 }
137 139
138 } 140 }
139 141
140 #endif 142 #endif
OLDNEW
« no previous file with comments | « Source/WebCore/html/HTMLSourceElement.cpp ('k') | Source/WebCore/html/shadow/MediaControlElements.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698