https://bugs.webkit.org/show_bug.cgi?id=81148
Reviewed by Eric Carlson.
Source/WebCore:
Test: http/tests/media/media-document.html
Pass through the mime type from the DocumentLoader into the <source type=""> attribute of the
generated video element.
* html/MediaDocument.cpp:
(WebCore::MediaDocumentParser::createDocumentStructure):
LayoutTests:
* http/tests/media/media-document-expected.txt: Added.
* http/tests/media/media-document.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110754
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2012-03-14 Jer Noble <jer.noble@apple.com>
+
+ Opening a URL in a MediaDocument does not propagate MIME type info to media element
+ https://bugs.webkit.org/show_bug.cgi?id=81148
+
+ Reviewed by Eric Carlson.
+
+ * http/tests/media/media-document-expected.txt: Added.
+ * http/tests/media/media-document.html: Added.
+
2012-03-14 David Grogan <dgrogan@chromium.org>
IndexedDB layout tests: factor out prefix-handling-code
--- /dev/null
+
+Tests that a media document can open a media URL with an ambiguous extension.
+
+EXPECTED (frame.contentDocument.getElementsByTagName('video')[0].error == 'null') OK
+END OF TEST
+
--- /dev/null
+<html>
+ <head>
+ <script src=../../media-resources/video-test.js></script>
+ <script src=../../media-resources/media-file.js></script>
+ <script>
+ var frame;
+ function loadMediaFrame()
+ {
+ var movie = findMediaFile('video', 'test');
+ var type = mimeTypeForExtension(movie.split('.').pop());
+ frame = document.createElement('iframe');
+ frame.addEventListener('load', function () {
+ testExpected("frame.contentDocument.getElementsByTagName('video')[0].error", null);
+ endTest();
+ });
+ waitForEventAndFail('error');
+ waitForEventAndEnd('canplay');
+ frame.src = 'resources/video-check-useragent.php?name=' + movie + '&type=' + type;
+ document.body.appendChild(frame);
+ }
+ </script>
+ </head>
+
+ <body onload="loadMediaFrame()">
+ <br>
+ Tests that a media document can open a media URL with an ambiguous extension.
+ <br>
+ </body>
+</html>
+2012-03-14 Jer Noble <jer.noble@apple.com>
+
+ Opening a URL in a MediaDocument does not propagate MIME type info to media element
+ https://bugs.webkit.org/show_bug.cgi?id=81148
+
+ Reviewed by Eric Carlson.
+
+ Test: http/tests/media/media-document.html
+
+ Pass through the mime type from the DocumentLoader into the <source type=""> attribute of the
+ generated video element.
+
+ * html/MediaDocument.cpp:
+ (WebCore::MediaDocumentParser::createDocumentStructure):
+
2012-03-14 Stephen White <senorblanco@chromium.org>
[chromium] Fix accelerated Canvas2D with threaded compositing.
#include "HTMLEmbedElement.h"
#include "HTMLHtmlElement.h"
#include "HTMLNames.h"
+#include "HTMLSourceElement.h"
#include "HTMLVideoElement.h"
#include "KeyboardEvent.h"
#include "MainResourceLoader.h"
m_mediaElement->setAttribute(autoplayAttr, "");
m_mediaElement->setAttribute(nameAttr, "media");
- m_mediaElement->setSrc(document()->url());
-
+
+ RefPtr<Element> sourceElement = document()->createElement(sourceTag, false);
+ HTMLSourceElement* source = static_cast<HTMLSourceElement*>(sourceElement.get());
+ source->setSrc(document()->url());
+
+ if (DocumentLoader* loader = document()->loader())
+ source->setType(loader->responseMIMEType());
+
+ m_mediaElement->appendChild(sourceElement, ec);
body->appendChild(mediaElement, ec);
Frame* frame = document()->frame();