Bug 1325053 - Remove media attribute code and set the currentSrc attribute to urlString after type checking in HTMLMediaElement. r?jwwang
According to current WhatWG HTML spec, the checking of media attribute in SourceElement is removed. Fix the Gecko code to reflect current spec.
MozReview-Commit-ID: 43d9zL9Fvih
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -2158,28 +2158,19 @@ void HTMLMediaElement::LoadFromSourceChi
OwnerDoc(), type, canPlay != CANPLAY_NO, __func__);
if (canPlay == CANPLAY_NO) {
const char16_t* params[] = { type.get(), src.get() };
ReportLoadError("MediaLoadUnsupportedTypeAttribute", params, ArrayLength(params));
DealWithFailedElement(child);
return;
}
}
- nsAutoString media;
HTMLSourceElement *childSrc = HTMLSourceElement::FromContent(child);
- MOZ_ASSERT(childSrc, "Expect child to be HTMLSourceElement");
- if (childSrc && !childSrc->MatchesCurrentMedia()) {
- const char16_t* params[] = { media.get(), src.get() };
- ReportLoadError("MediaLoadSourceMediaNotMatched", params, ArrayLength(params));
- DealWithFailedElement(child);
- return;
- }
- LOG(LogLevel::Debug, ("%p Trying load from <source>=%s type=%s media=%s", this,
- NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get(),
- NS_ConvertUTF16toUTF8(media).get()));
+ LOG(LogLevel::Debug, ("%p Trying load from <source>=%s type=%s", this,
+ NS_ConvertUTF16toUTF8(src).get(), NS_ConvertUTF16toUTF8(type).get()));
nsCOMPtr<nsIURI> uri;
NewURIFromString(src, getter_AddRefs(uri));
if (!uri) {
const char16_t* params[] = { src.get() };
ReportLoadError("MediaLoadInvalidURI", params, ArrayLength(params));
DealWithFailedElement(child);
return;