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

Side by Side Diff: Source/core/html/track/TextTrack.cpp

Issue 177243018: Prevent 'removetrack' events from firing when all inband text tracks are removed. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Remove console messages Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/html/track/TextTrack.h ('k') | Source/core/html/track/TextTrackList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
139 if (value == descriptionsKeyword()) 139 if (value == descriptionsKeyword())
140 return true; 140 return true;
141 if (value == chaptersKeyword()) 141 if (value == chaptersKeyword())
142 return true; 142 return true;
143 if (value == metadataKeyword()) 143 if (value == metadataKeyword())
144 return true; 144 return true;
145 145
146 return false; 146 return false;
147 } 147 }
148 148
149 void TextTrack::setTrackList(TextTrackList* trackList)
150 {
151 // NOTE: We are using m_trackList->owner() instead of m_client here because
152 // when a HTMLTrackElement is reparented, HTMLTrackElement::textTrackRemoveC ues()
153 // will forward the call to the new parent instead of the element the track is being
154 // removed from.
155 if (!trackList && m_trackList && m_trackList->owner() && m_cues)
156 m_trackList->owner()->textTrackRemoveCues(this, m_cues.get());
157 m_trackList = trackList;
158 }
159
149 void TextTrack::setKind(const AtomicString& newKind) 160 void TextTrack::setKind(const AtomicString& newKind)
150 { 161 {
151 AtomicString oldKind = kind(); 162 AtomicString oldKind = kind();
152 TrackBase::setKind(newKind); 163 TrackBase::setKind(newKind);
153 164
154 if (m_client && oldKind != kind()) 165 if (m_client && oldKind != kind())
155 m_client->textTrackKindChanged(this); 166 m_client->textTrackKindChanged(this);
156 } 167 }
157 168
158 void TextTrack::setMode(const AtomicString& mode) 169 void TextTrack::setMode(const AtomicString& mode)
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 { 427 {
417 return EventTargetNames::TextTrack; 428 return EventTargetNames::TextTrack;
418 } 429 }
419 430
420 ExecutionContext* TextTrack::executionContext() const 431 ExecutionContext* TextTrack::executionContext() const
421 { 432 {
422 return m_document; 433 return m_document;
423 } 434 }
424 435
425 } // namespace WebCore 436 } // namespace WebCore
426
OLDNEW
« no previous file with comments | « Source/core/html/track/TextTrack.h ('k') | Source/core/html/track/TextTrackList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698