Bug 1550633 - part8 : no need to reload if the new url is the same. r=jya
Accoding to spec [1], after loading finished, the start the track processing model would stop at step12 and wait until the track URL changes to the URL which is not equal to the URL we have loaded before. That means, if we change track URL to the same URL we loaded before, we won't have to reload the resource. [1] https://html.spec.whatwg.org/multipage/media.html#sourcing-out-of-band-text-tracks:track-url-5 Differential Revision: https://phabricator.services.mozilla.com/D31557
This commit is contained in:
@@ -213,6 +213,15 @@ bool HTMLTrackElement::ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute,
|
||||
}
|
||||
|
||||
void HTMLTrackElement::SetSrc(const nsAString& aSrc, ErrorResult& aError) {
|
||||
LOG(LogLevel::Info,
|
||||
("%p Set src=%s", this, NS_ConvertUTF16toUTF8(aSrc).get()));
|
||||
|
||||
nsAutoString src;
|
||||
if (GetAttr(kNameSpaceID_None, nsGkAtoms::src, src) && src == aSrc) {
|
||||
LOG(LogLevel::Info, ("%p No need to reload for same src url", this));
|
||||
return;
|
||||
}
|
||||
|
||||
SetHTMLAttr(nsGkAtoms::src, aSrc, aError);
|
||||
SetReadyState(TextTrackReadyState::NotLoaded);
|
||||
if (!mMediaParent) {
|
||||
|
||||
Reference in New Issue
Block a user