If the video element has a source then it delays the document's load event for about 3 seconds even though the attribute preload="none" has been set. Test case: http://steffenweber.net/chrome-video-document-load-delay/video.html Expected result: The document load event should fire without noticeable delay. What happens instead? The document load event is delayed by ~ 3 seconds. UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.43 Safari/536.11 The problem is not limited to Linux, it occurs on Windows and Mac OS X, too.
The latest Chrome Nightly for Windows (22.0.1194.1 canary) is affected, too.
Bug still exists in Chrome 26.0.1410.33 beta (WebKit 537.31)
Created attachment 204573 [details] Patch
Comment on attachment 204573 [details] Patch Attachment 204573 [details] did not pass mac-ews (mac): Output: http://webkit-queues.appspot.com/results/847142 New failing tests: media/media-preload-no-delay-loadevent.html fast/repaint/table-cell-collapsed-border-scroll.html
Created attachment 204583 [details] Archive of layout-test-results from webkit-ews-03 for mac-mountainlion The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: webkit-ews-03 Port: mac-mountainlion Platform: Mac OS X 10.8.3
Comment on attachment 204573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=204573&action=review > LayoutTests/media/media-preload-no-delay-loadevent.html:8 > +function finish(){ Nit: a function's opening brace should be on a new line. > LayoutTests/media/media-preload-no-delay-loadevent.html:12 > + } Eek, a tab! > LayoutTests/media/media-preload-no-delay-loadevent.html:22 > + document.getElementById('load-time').innerHTML = loadTime + ' PASS'; Logging the time it takes to load will make this test flakey because not all bots run at the same speed. > LayoutTests/media/media-preload-no-delay-loadevent.html:30 > + <source src="void.mp4"> This test should use a valid media file that can be loaded by the platform being tested. See how other tests use "findMediaFile" to choose a platform appropriate test file.
Created attachment 204669 [details] Patch
Comment on attachment 204669 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=204669&action=review > Source/WebCore/ChangeLog:11 > + (WebCore::HTMLMediaElement::prepareForLoad): Nit: I think it is useful to have per-method comments so it is easier to understand what changed when reading the ChangeLog later. > LayoutTests/media/media-preload-no-delay-loadevent.html:8 > + testRunner.waitUntilDone(); Nit: double indent > LayoutTests/media/media-preload-no-delay-loadevent.html:37 > + var source = document.getElementById('source'); > + source.src = findMediaFile("video", "content/test.mp4"); Nit: there is no need to use a <source> element when only one media url is used.
Created attachment 204783 [details] Patch
Created attachment 204784 [details] patch for landing
review+ by Eric Carlson
Done all the requested changes I uploaded the patch for landing please have a look.
Comment on attachment 204784 [details] patch for landing Clearing flags on attachment: 204784 Committed r151684: <http://trac.webkit.org/changeset/151684>
All reviewed patches have been landed. Closing bug.
Thanks!