зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1264769) for invalid-src.html wpt failures a=backout
Backed out changeset 7b9d3d0c09f5 (bug 1264769) Backed out changeset 780f7036c084 (bug 1264769)
This commit is contained in:
Родитель
fab87ed192
Коммит
e386a2bc9e
|
@ -230,15 +230,8 @@ nsImageLoadingContent::OnLoadComplete(imgIRequest* aRequest, nsresult aStatus)
|
|||
// Fire the appropriate DOM event.
|
||||
if (NS_SUCCEEDED(aStatus)) {
|
||||
FireEvent(NS_LITERAL_STRING("load"));
|
||||
|
||||
// Do not fire loadend event for multipart/x-mixed-replace image streams.
|
||||
bool isMultipart;
|
||||
if (NS_FAILED(aRequest->GetMultipart(&isMultipart)) || !isMultipart) {
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
}
|
||||
} else {
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
}
|
||||
|
||||
nsCOMPtr<nsINode> thisNode = do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
|
@ -635,9 +628,7 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,
|
|||
// know what we tried (and failed) to load.
|
||||
if (!mCurrentRequest)
|
||||
aChannel->GetURI(getter_AddRefs(mCurrentURI));
|
||||
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
aError.Throw(rv);
|
||||
}
|
||||
return listener.forget();
|
||||
|
@ -673,7 +664,7 @@ nsImageLoadingContent::ForceReload(const mozilla::dom::Optional<bool>& aNotify,
|
|||
ImageLoadType loadType = \
|
||||
(mCurrentRequestFlags & REQUEST_IS_IMAGESET) ? eImageLoadType_Imageset
|
||||
: eImageLoadType_Normal;
|
||||
nsresult rv = LoadImage(currentURI, true, notify, loadType, true, nullptr,
|
||||
nsresult rv = LoadImage(currentURI, true, notify, loadType, nullptr,
|
||||
nsIRequest::VALIDATE_ALWAYS);
|
||||
if (NS_FAILED(rv)) {
|
||||
aError.Throw(rv);
|
||||
|
@ -757,17 +748,13 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
// Fire loadstart event
|
||||
FireEvent(NS_LITERAL_STRING("loadstart"));
|
||||
|
||||
// Parse the URI string to get image URI
|
||||
// Second, parse the URI string to get image URI
|
||||
nsCOMPtr<nsIURI> imageURI;
|
||||
nsresult rv = StringToURI(aNewURI, doc, getter_AddRefs(imageURI));
|
||||
if (NS_FAILED(rv)) {
|
||||
// Cancel image requests and then fire error and loadend events per spec
|
||||
// Cancel image requests and fire error event per spec
|
||||
CancelImageRequests(aNotify);
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -791,7 +778,7 @@ nsImageLoadingContent::LoadImage(const nsAString& aNewURI,
|
|||
|
||||
NS_TryToSetImmutable(imageURI);
|
||||
|
||||
return LoadImage(imageURI, aForce, aNotify, aImageLoadType, false, doc);
|
||||
return LoadImage(imageURI, aForce, aNotify, aImageLoadType, doc);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
@ -799,20 +786,13 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
bool aForce,
|
||||
bool aNotify,
|
||||
ImageLoadType aImageLoadType,
|
||||
bool aLoadStart,
|
||||
nsIDocument* aDocument,
|
||||
nsLoadFlags aLoadFlags)
|
||||
{
|
||||
// Fire loadstart event if required
|
||||
if (aLoadStart) {
|
||||
FireEvent(NS_LITERAL_STRING("loadstart"));
|
||||
}
|
||||
|
||||
if (!mLoadingEnabled) {
|
||||
// XXX Why fire an error here? seems like the callers to SetLoadingEnabled
|
||||
// don't want/need it.
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -869,7 +849,6 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
policyType);
|
||||
if (!NS_CP_ACCEPTED(cpDecision)) {
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
SetBlockedRequest(aNewURI, cpDecision);
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -942,9 +921,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI,
|
|||
// know what we tried (and failed) to load.
|
||||
if (!mCurrentRequest)
|
||||
mCurrentURI = aNewURI;
|
||||
|
||||
FireEvent(NS_LITERAL_STRING("error"));
|
||||
FireEvent(NS_LITERAL_STRING("loadend"));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -133,15 +133,13 @@ protected:
|
|||
* @param aNotify If true, nsIDocumentObserver state change notifications
|
||||
* will be sent as needed.
|
||||
* @param aImageLoadType The ImageLoadType for this request
|
||||
* @param aLoadStart If true, dispatch "loadstart" event.
|
||||
* @param aDocument Optional parameter giving the document this node is in.
|
||||
* This is purely a performance optimization.
|
||||
* @param aLoadFlags Optional parameter specifying load flags to use for
|
||||
* the image load
|
||||
*/
|
||||
nsresult LoadImage(nsIURI* aNewURI, bool aForce, bool aNotify,
|
||||
ImageLoadType aImageLoadType, bool aLoadStart = true,
|
||||
nsIDocument* aDocument = nullptr,
|
||||
ImageLoadType aImageLoadType, nsIDocument* aDocument = nullptr,
|
||||
nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL);
|
||||
|
||||
/**
|
||||
|
@ -265,8 +263,7 @@ private:
|
|||
/**
|
||||
* Method to fire an event once we know what's going on with the image load.
|
||||
*
|
||||
* @param aEventType "loadstart", "loadend", "load", or "error" depending on
|
||||
* how things went
|
||||
* @param aEventType "load" or "error" depending on how things went
|
||||
*/
|
||||
nsresult FireEvent(const nsAString& aEventType);
|
||||
|
||||
|
@ -321,7 +318,7 @@ protected:
|
|||
|
||||
/**
|
||||
* Cancels and nulls-out the "current" and "pending" requests if they exist.
|
||||
*
|
||||
*
|
||||
* @param aNonvisibleAction An action to take if the image is no longer
|
||||
* visible as a result; see |UntrackImage|.
|
||||
*/
|
||||
|
|
|
@ -286,10 +286,6 @@ EVENT(loadedmetadata,
|
|||
eLoadedMetaData,
|
||||
EventNameType_HTML,
|
||||
eBasicEventClass)
|
||||
EVENT(loadend,
|
||||
eLoadEnd,
|
||||
EventNameType_HTML,
|
||||
eBasicEventClass)
|
||||
EVENT(loadstart,
|
||||
eLoadStart,
|
||||
EventNameType_HTML,
|
||||
|
@ -709,7 +705,7 @@ NON_IDL_EVENT(DOMFocusOut,
|
|||
eLegacyDOMFocusOut,
|
||||
EventNameType_HTMLXUL,
|
||||
eUIEventClass)
|
||||
|
||||
|
||||
NON_IDL_EVENT(DOMMouseScroll,
|
||||
eLegacyMouseLineOrPageScroll,
|
||||
EventNameType_HTMLXUL,
|
||||
|
@ -718,7 +714,7 @@ NON_IDL_EVENT(MozMousePixelScroll,
|
|||
eLegacyMousePixelScroll,
|
||||
EventNameType_HTMLXUL,
|
||||
eMouseScrollEventClass)
|
||||
|
||||
|
||||
NON_IDL_EVENT(open,
|
||||
eOpen,
|
||||
EventNameType_None,
|
||||
|
|
|
@ -60,7 +60,6 @@ interface GlobalEventHandlers {
|
|||
attribute EventHandler onload;
|
||||
attribute EventHandler onloadeddata;
|
||||
attribute EventHandler onloadedmetadata;
|
||||
attribute EventHandler onloadend;
|
||||
attribute EventHandler onloadstart;
|
||||
attribute EventHandler onmousedown;
|
||||
[LenientThis] attribute EventHandler onmouseenter;
|
||||
|
|
|
@ -113,12 +113,11 @@ NS_EVENT_MESSAGE(eUnload)
|
|||
NS_EVENT_MESSAGE(eHashChange)
|
||||
NS_EVENT_MESSAGE(eImageAbort)
|
||||
NS_EVENT_MESSAGE(eLoadError)
|
||||
NS_EVENT_MESSAGE(eLoadEnd)
|
||||
NS_EVENT_MESSAGE(ePopState)
|
||||
NS_EVENT_MESSAGE(eStorage)
|
||||
NS_EVENT_MESSAGE(eBeforeUnload)
|
||||
NS_EVENT_MESSAGE(eReadyStateChange)
|
||||
|
||||
|
||||
NS_EVENT_MESSAGE(eFormSubmit)
|
||||
NS_EVENT_MESSAGE(eFormReset)
|
||||
NS_EVENT_MESSAGE(eFormChange)
|
||||
|
@ -165,7 +164,7 @@ NS_EVENT_MESSAGE_FIRST_LAST(eLegacyMutationEvent,
|
|||
eLegacySubtreeModified, eLegacyCharacterDataModified)
|
||||
|
||||
NS_EVENT_MESSAGE(eUnidentifiedEvent)
|
||||
|
||||
|
||||
// composition events
|
||||
NS_EVENT_MESSAGE(eCompositionStart)
|
||||
// eCompositionEnd is the message for DOM compositionend event.
|
||||
|
|
Загрузка…
Ссылка в новой задаче