Changeset 138766 in webkit
- Timestamp:
- Jan 3, 2013, 4:33:32 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138764 r138766 1 2013-01-03 Antoine Quint <graouts@apple.com> 2 3 onload callback for <track> element attached to <video> does not fire 4 https://bugs.webkit.org/show_bug.cgi?id=103258 5 6 Reviewed by Eric Carlson. 7 8 As a result of fixing this bug, a few new failures were uncovered and TestExpectations 9 needed to be updated to take this into account. Additionally, some existing tests were 10 incorrect or outdated and were fixed as well. Finally, a new test was added to thoroughly 11 test the various conditions required for a <track> element to successfully load. 12 13 * fast/events/constructors/track-event-constructor.html: Update the test to correctly set 14 a non-disabled mode on the text track such that it may load per the rules enforced with this patch. 15 * http/tests/security/text-track-crossorigin.html: Update the test to correctly set a non-disabled 16 mode on the text track such that it may load per the rules enforced with this patch. 17 * media/track/track-add-track-expected.txt: Update the output to match changes made to test. 18 * media/track/track-add-track.html: Update the test to correctly set a non-disabled mode on 19 the text track such that it may load per the rules enforced with this patch. Also, ensure 20 the .readyState of the text track is correctly assumed to be NONE vs. LOADING as it would 21 have to wait until the next run loop to be changed to anything but NONE. 22 * media/track/track-element-load-event-expected.txt: Added. 23 * media/track/track-element-load-event.html: Added. 24 * media/track/track-load-from-src-readyState.html: Update the test to correctly set a 25 non-disabled mode on the text track such that it may load per the rules enforced with 26 this patch. 27 * platform/chromium/TestExpectations: Skip tests that now fail instead of timing out. 28 * platform/efl/TestExpectations: Skip tests that now fail instead of timing out. 29 * platform/gtk/TestExpectations: Skip tests that now fail instead of timing out. 30 * platform/mac/TestExpectations: Skip tests that now fail instead of timing out. 31 * platform/qt/TestExpectations: Skip tests that now fail instead of timing out. 32 * platform/win/TestExpectations: Skip tests that now fail instead of timing out. 33 1 34 2013-01-03 Jon Lee <jonlee@apple.com> 2 35 -
trunk/LayoutTests/fast/events/constructors/track-event-constructor.html
r138320 r138766 56 56 trackElement = document.createElement('track'); 57 57 video.appendChild(trackElement); 58 trackElement.track.mode = "hidden"; 58 59 trackElement.addEventListener('load', test); 59 60 trackElement.src='data:text/vtt,WEBVTT FILE \r\r1\r00:00:00.000 --> 00:00:30.500\ronly one caption'; -
trunk/LayoutTests/http/tests/security/text-track-crossorigin.html
r138320 r138766 80 80 { 81 81 trackElement = document.querySelectorAll('track')[0]; 82 trackElement.track.mode = "hidden"; 82 83 log('Loading <b>without</b> Access-Control-Allow-Origin header, no "crossorigin" attribute on <video>'); 83 84 var url = "http://localhost:8000/security/resources/captions-with-access-control-headers.php" -
trunk/LayoutTests/media/track/track-add-track-expected.txt
r138320 r138766 5 5 RUN(video.appendChild(trackElement)) 6 6 RUN(trackElement.src = 'captions-webvtt/tc004-webvtt-file.vtt') 7 RUN(trackElement.track.mode = 'hidden') 7 8 EXPECTED (video.textTracks.length == '1') OK 8 EXPECTED (trackElement.readyState == ' 1') OK9 EXPECTED (trackElement.readyState == '0') OK 9 10 EVENT(addtrack) 10 11 EXPECTED (event.target == '[object TextTrackList]') OK -
trunk/LayoutTests/media/track/track-add-track.html
r138320 r138766 42 42 43 43 run("trackElement.src = 'captions-webvtt/tc004-webvtt-file.vtt'"); 44 run("trackElement.track.mode = 'hidden'"); 44 45 testExpected("video.textTracks.length", 1); 45 testExpected("trackElement.readyState", HTMLTrackElement. LOADING);46 testExpected("trackElement.readyState", HTMLTrackElement.NONE); 46 47 } 47 48 -
trunk/LayoutTests/media/track/track-load-from-src-readyState.html
r138320 r138766 25 25 track.addEventListener("load", function () { trackLoaded(); }, true); 26 26 track.src = "captions-webvtt/tc004-webvtt-file.vtt"; 27 track. mode = "hidden";27 track.track.mode = "hidden"; 28 28 29 29 </script> -
trunk/LayoutTests/platform/chromium/TestExpectations
r138761 r138766 3018 3018 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 3019 3019 3020 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 3021 # At any rate, there is no regression, just a different type of failure. 3022 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 3023 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 3024 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 3025 3020 3026 webkit.org/b/72271 [ SnowLeopard Debug ] fast/dom/node-iterator-reference-node-moved-crash.html [ Crash Pass ] 3021 3027 -
trunk/LayoutTests/platform/efl/TestExpectations
r138746 r138766 796 796 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/cue_font_size_transition.html [ Skip ] 797 797 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 798 799 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 800 # At any rate, there is no regression, just a different type of failure. 801 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 802 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 803 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 798 804 799 805 webkit.org/b/100636 [ Debug ] jquery/traversing.html [ Failure Crash Pass ] -
trunk/LayoutTests/platform/gtk/TestExpectations
r138746 r138766 459 459 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 460 460 461 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 462 # At any rate, there is no regression, just a different type of failure. 463 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 464 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 465 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 466 461 467 # No support for exposing in-band text tracks 462 468 webkit.org/b/103771 media/track/track-in-band.html [ Failure ] -
trunk/LayoutTests/platform/mac/TestExpectations
r138761 r138766 472 472 media/track/track-webvtt-tc028-unsupported-markup.html 473 473 474 # Opera-submitted tests to W3C for <track>, a lot of failures still.475 474 # Opera-submitted tests to W3C for <track>, a lot of failures still. 476 475 webkit.org/b/103926 media/track/opera/idl/media-idl-tests.html [ Skip ] … … 507 506 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 508 507 508 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 509 # At any rate, there is no regression, just a different type of failure. 510 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 511 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 512 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 513 509 514 # Tests for MediaSource API. Feature is not yet functional. 510 515 # https://bugs.webkit.org/show_bug.cgi?id=64731 -
trunk/LayoutTests/platform/qt/TestExpectations
r138746 r138766 927 927 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/cue_font_size_transition.html [ Skip ] 928 928 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 929 930 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 931 # At any rate, there is no regression, just a different type of failure. 932 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 933 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 934 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 929 935 930 936 # https://bugs.webkit.org/show_bug.cgi?id=38376 -
trunk/LayoutTests/platform/win/TestExpectations
r138732 r138766 1586 1586 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/cue_font_size_transition.html [ Skip ] 1587 1587 webkit.org/b/103926 media/track/opera/track/webvtt/rendering/adhoc/voice_with_evil_timestamp.html [ Skip ] 1588 1589 # After fixing webkit.org/b/103258, these tests fail when they used to simply timeout. 1590 # At any rate, there is no regression, just a different type of failure. 1591 webkit.org/b/105536 media/track/opera/interfaces/TextTrack/addCue.html [ Failure ] 1592 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/endTime.html [ Failure ] 1593 webkit.org/b/105536 media/track/opera/interfaces/TextTrackCue/startTime.html [ Failure ] 1588 1594 1589 1595 # Tests for MediaSource API. Feature is not yet functional. -
trunk/Source/WebCore/ChangeLog
r138758 r138766 1 2013-01-03 Antoine Quint <graouts@apple.com> 2 3 onload callback for <track> element attached to <video> does not fire 4 https://bugs.webkit.org/show_bug.cgi?id=103258 5 6 Reviewed by Eric Carlson. 7 8 We now correctly implement the track processing model per the latest spec at 9 http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#start-the-track-processing-model. 10 11 For a <track> to load, three conditions must be met: 12 13 1. it must have a non-empty src 14 2. it must have a mode other than "disabled" (the default) 15 3. it must have a parent media element 16 17 We used to only check if we were able to load upon setting the track's src, 18 whereas a change of any of those conditions should have done this, which this 19 patch now correctly implements. 20 21 We also correctly implement the load model asynchronously after step 4, per 22 the spec, hence the split of the code previously entirely contained in 23 HTMLTrackElement::scheduleLoad() in another method fired on a timer. 24 25 Test: media/track/track-element-load-event.html 26 27 * html/HTMLMediaElement.cpp: 28 (WebCore::HTMLMediaElement::textTrackModeChanged): 29 * html/HTMLTrackElement.cpp: 30 (WebCore::HTMLTrackElement::HTMLTrackElement): 31 (WebCore::HTMLTrackElement::insertedInto): 32 (WebCore::HTMLTrackElement::parseAttribute): 33 (WebCore::HTMLTrackElement::scheduleLoad): 34 (WebCore): 35 (WebCore::HTMLTrackElement::loadTimerFired): 36 (WebCore::HTMLTrackElement::textTrackModeChanged): 37 * html/HTMLTrackElement.h: 38 * html/track/TextTrack.cpp: 39 (WebCore::TextTrack::removeAllCues): 40 (WebCore): 41 * html/track/TextTrack.h: 42 (TextTrack): 43 1 44 2013-01-03 Beth Dakin <bdakin@apple.com> 2 45 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r138561 r138766 1352 1352 if (trackElement->readyState() == HTMLTrackElement::LOADED) 1353 1353 textTrackAddCues(track, track->cues()); 1354 else if (trackElement->readyState() == HTMLTrackElement::NONE)1355 trackElement->scheduleLoad();1356 1354 1357 1355 // If this is the first added track, create the list of text tracks. -
trunk/Source/WebCore/html/HTMLTrackElement.cpp
r138320 r138766 57 57 inline HTMLTrackElement::HTMLTrackElement(const QualifiedName& tagName, Document* document) 58 58 : HTMLElement(tagName, document) 59 , m_loadTimer(this, &HTMLTrackElement::loadTimerFired) 59 60 { 60 61 LOG(Media, "HTMLTrackElement::HTMLTrackElement - %p", this); … … 75 76 Node::InsertionNotificationRequest HTMLTrackElement::insertedInto(ContainerNode* insertionPoint) 76 77 { 78 // Since we've moved to a new parent, we may now be able to load. 79 scheduleLoad(); 80 77 81 HTMLElement::insertedInto(insertionPoint); 78 82 HTMLMediaElement* parent = mediaElement(); … … 93 97 if (RuntimeEnabledFeatures::webkitVideoTrackEnabled()) { 94 98 if (name == srcAttr) { 95 if (!value.isEmpty() && mediaElement())99 if (!value.isEmpty()) 96 100 scheduleLoad(); 97 // 4.8.10.12.3 Sourcing out-of-band text tracks 98 // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly... 101 else if (m_track) 102 m_track->removeAllCues(); 103 104 // 4.8.10.12.3 Sourcing out-of-band text tracks 105 // As the kind, label, and srclang attributes are set, changed, or removed, the text track must update accordingly... 99 106 } else if (name == kindAttr) 100 107 track()->setKind(value.lower()); … … 189 196 void HTMLTrackElement::scheduleLoad() 190 197 { 198 // 1. If another occurrence of this algorithm is already running for this text track and its track element, 199 // abort these steps, letting that other algorithm take care of this element. 200 if (m_loadTimer.isActive()) 201 return; 202 191 203 if (!RuntimeEnabledFeatures::webkitVideoTrackEnabled()) 192 204 return; 193 205 206 // 2. If the text track's text track mode is not set to one of hidden or showing, abort these steps. 207 if (ensureTrack()->mode() != TextTrack::hiddenKeyword() && ensureTrack()->mode() != TextTrack::showingKeyword()) 208 return; 209 210 // 3. If the text track's track element does not have a media element as a parent, abort these steps. 194 211 if (!mediaElement()) 195 212 return; 196 213 214 // 4. Run the remainder of these steps asynchronously, allowing whatever caused these steps to run to continue. 215 m_loadTimer.startOneShot(0); 216 } 217 218 void HTMLTrackElement::loadTimerFired(Timer<HTMLTrackElement>*) 219 { 197 220 if (!fastHasAttribute(srcAttr)) 198 221 return; 199 222 200 // 4.8.10.12.3 Sourcing out-of-band text tracks 201 202 // 1. Set the text track readiness state to loading. 223 // 6. Set the text track readiness state to loading. 203 224 setReadyState(HTMLTrackElement::LOADING); 204 225 226 // 7. Let URL be the track URL of the track element. 205 227 KURL url = getNonEmptyURLAttribute(srcAttr); 228 229 // 8. If the track element's parent is a media element then let CORS mode be the state of the parent media 230 // element's crossorigin content attribute. Otherwise, let CORS mode be No CORS. 206 231 if (!canLoadUrl(url)) { 207 232 didCompleteLoad(ensureTrack(), HTMLTrackElement::Failure); … … 303 328 void HTMLTrackElement::textTrackModeChanged(TextTrack* track) 304 329 { 330 // Since we've moved to a new parent, we may now be able to load. 331 if (readyState() == HTMLTrackElement::NONE) 332 scheduleLoad(); 333 305 334 if (HTMLMediaElement* parent = mediaElement()) 306 335 return parent->textTrackModeChanged(track); -
trunk/Source/WebCore/html/HTMLTrackElement.h
r138320 r138766 80 80 virtual bool isURLAttribute(const Attribute&) const OVERRIDE; 81 81 82 void loadTimerFired(Timer<HTMLTrackElement>*); 83 82 84 #if ENABLE(MICRODATA) 83 85 virtual String itemValueText() const OVERRIDE; … … 99 101 100 102 RefPtr<LoadableTextTrack> m_track; 103 Timer<HTMLTrackElement> m_loadTimer; 101 104 }; 102 105 -
trunk/Source/WebCore/html/track/TextTrack.cpp
r138320 r138766 202 202 } 203 203 204 void TextTrack::removeAllCues() 205 { 206 if (!m_cues) 207 return; 208 209 if (m_client) 210 m_client->textTrackRemoveCues(this, m_cues.get()); 211 212 for (size_t i = 0; i < m_cues->length(); ++i) 213 m_cues->item(i)->setTrack(0); 214 215 m_cues = 0; 216 } 217 204 218 TextTrackCueList* TextTrack::activeCues() const 205 219 { -
trunk/Source/WebCore/html/track/TextTrack.h
r138320 r138766 124 124 virtual void setIsDefault(bool) { } 125 125 126 void removeAllCues(); 127 126 128 protected: 127 129 TextTrack(ScriptExecutionContext*, TextTrackClient*, const AtomicString& kind, const AtomicString& label, const AtomicString& language, TextTrackType);
Note:
See TracChangeset
for help on using the changeset viewer.