Changeset 136131 in webkit
- Timestamp:
- Nov 29, 2012, 7:33:03 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/media/track/track-node-add-remove-expected.txt (added)
-
LayoutTests/media/track/track-node-add-remove.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLMediaElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLMediaElement.h (modified) (1 diff)
-
Source/WebCore/html/HTMLTrackElement.cpp (modified) (2 diffs)
-
Source/WebCore/html/track/LoadableTextTrack.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136130 r136131 1 2012-11-29 Hajime Morrita <morrita@google.com> 2 3 HTMLMediaElement's .textTracks property does not reflect <track> element 4 https://bugs.webkit.org/show_bug.cgi?id=103420 5 6 Reviewed by Eric Carlson. 7 8 * media/track/track-node-add-remove-expected.txt: Added. 9 * media/track/track-node-add-remove.html: Added. 10 1 11 2012-11-29 Alexander Pavlov <apavlov@chromium.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r136125 r136131 1 2012-11-29 Hajime Morrita <morrita@google.com> 2 3 HTMLMediaElement's .textTracks property does not reflect <track> element 4 https://bugs.webkit.org/show_bug.cgi?id=103420 5 6 Reviewed by Eric Carlson. 7 8 There were some assumptions that <track> elements are valid only 9 if the parent <media> is in document. This change relaxes this 10 assumption so that <track> is valid when it has <media> as a 11 parent regardless whether the <media> is in the document or not. 12 13 HTMLMediaElement::didAddTrack and didRemoveTrack are now called 14 when the <track> is inserted to or removed from the parent <media> 15 element. 16 17 Test: media/track/track-node-add-remove.html 18 19 * html/HTMLMediaElement.cpp: 20 (WebCore::HTMLMediaElement::didRemoveTrack): 21 Renamed from willRemoveTrack() to reflect the timing. This was once called from 22 Node::willRemove(), which was removed a while ago. 23 * html/HTMLMediaElement.h: 24 (HTMLMediaElement): 25 * html/HTMLTrackElement.cpp: 26 (WebCore::HTMLTrackElement::insertedInto): 27 The old code notified parent <media> only if the subtree became a part of the document. 28 Now it notifies the <media> when this <track> becomes a child of that <media>. 29 30 (WebCore::HTMLTrackElement::removedFrom): 31 The old code notifies the parent <media> every time as long as the parent is available. 32 Now it notifies the <media> only if this <track> is removed from the parent <media>. 33 This matches how corresponding notification is done in insertedInto(). 34 35 * html/track/LoadableTextTrack.cpp: 36 (WebCore::LoadableTextTrack::trackElementIndex): 37 1 38 2012-11-29 Florin Malita <fmalita@chromium.org> 2 39 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r135934 r136131 2842 2842 } 2843 2843 2844 void HTMLMediaElement:: willRemoveTrack(HTMLTrackElement* trackElement)2844 void HTMLMediaElement::didRemoveTrack(HTMLTrackElement* trackElement) 2845 2845 { 2846 2846 ASSERT(trackElement->hasTagName(trackTag)); … … 2852 2852 if (trackElement->hasTagName(trackTag)) { 2853 2853 KURL url = trackElement->getNonEmptyURLAttribute(srcAttr); 2854 LOG(Media, "HTMLMediaElement:: willRemoveTrack - 'src' is %s", urlForLogging(url).utf8().data());2854 LOG(Media, "HTMLMediaElement::didRemoveTrack - 'src' is %s", urlForLogging(url).utf8().data()); 2855 2855 } 2856 2856 #endif -
trunk/Source/WebCore/html/HTMLMediaElement.h
r135934 r136131 222 222 223 223 virtual void didAddTrack(HTMLTrackElement*); 224 virtual void willRemoveTrack(HTMLTrackElement*);224 virtual void didRemoveTrack(HTMLTrackElement*); 225 225 226 226 struct TrackGroup { -
trunk/Source/WebCore/html/HTMLTrackElement.cpp
r135202 r136131 76 76 { 77 77 HTMLElement::insertedInto(insertionPoint); 78 if (insertionPoint->inDocument()) { 79 if (HTMLMediaElement* parent = mediaElement()) 80 parent->didAddTrack(this); 81 } 82 78 HTMLMediaElement* parent = mediaElement(); 79 if (insertionPoint == parent) 80 parent->didAddTrack(this); 83 81 return InsertionDone; 84 82 } … … 86 84 void HTMLTrackElement::removedFrom(ContainerNode* insertionPoint) 87 85 { 88 HTMLMediaElement* parent = mediaElement(); 89 if (!parent && WebCore::isMediaElement(insertionPoint)) 90 parent = toMediaElement(insertionPoint); 91 if (parent) 92 parent->willRemoveTrack(this); 93 86 if (!parentNode() && WebCore::isMediaElement(insertionPoint)) 87 toMediaElement(insertionPoint)->didRemoveTrack(this); 94 88 HTMLElement::removedFrom(insertionPoint); 95 89 } -
trunk/Source/WebCore/html/track/LoadableTextTrack.cpp
r135202 r136131 131 131 size_t index = 0; 132 132 for (Node* node = m_trackElement->parentNode()->firstChild(); node; node = node->nextSibling()) { 133 if (!node->hasTagName(trackTag) || !node-> inDocument())133 if (!node->hasTagName(trackTag) || !node->parentNode()) 134 134 continue; 135 135 if (node == m_trackElement)
Note:
See TracChangeset
for help on using the changeset viewer.