2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-08-14 02:04:19 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
/* A class that handles style system image loads (other image loads are handled
|
|
|
|
* by the nodes in the content tree).
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "mozilla/css/ImageLoader.h"
|
2016-06-07 23:10:18 +03:00
|
|
|
#include "nsAutoPtr.h"
|
2012-08-14 02:04:19 +04:00
|
|
|
#include "nsContentUtils.h"
|
|
|
|
#include "nsLayoutUtils.h"
|
2012-08-15 17:52:06 +04:00
|
|
|
#include "nsError.h"
|
2012-11-07 02:04:53 +04:00
|
|
|
#include "nsDisplayList.h"
|
2018-01-25 09:56:43 +03:00
|
|
|
#include "nsIFrameInlines.h"
|
2012-11-07 02:04:53 +04:00
|
|
|
#include "FrameLayerBuilder.h"
|
2017-08-30 16:14:46 +03:00
|
|
|
#include "SVGObserverUtils.h"
|
2013-10-02 01:00:38 +04:00
|
|
|
#include "imgIContainer.h"
|
2015-03-17 22:25:35 +03:00
|
|
|
#include "Image.h"
|
2018-01-18 22:02:30 +03:00
|
|
|
#include "GeckoProfiler.h"
|
2018-03-16 00:35:56 +03:00
|
|
|
#include "mozilla/layers/WebRenderUserData.h"
|
2012-08-14 02:04:19 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace css {
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::DropDocumentReference()
|
|
|
|
{
|
2014-09-05 08:27:16 +04:00
|
|
|
// It's okay if GetPresContext returns null here (due to the presshell pointer
|
|
|
|
// on the document being null) as that means the presshell has already
|
|
|
|
// been destroyed, and it also calls ClearFrames when it is destroyed.
|
|
|
|
ClearFrames(GetPresContext());
|
2015-07-14 03:13:32 +03:00
|
|
|
|
|
|
|
for (auto it = mImages.Iter(); !it.Done(); it.Next()) {
|
|
|
|
ImageLoader::Image* image = it.Get()->GetKey();
|
|
|
|
imgIRequest* request = image->mRequests.GetWeak(mDocument);
|
|
|
|
if (request) {
|
|
|
|
request->CancelAndForgetObserver(NS_BINDING_ABORTED);
|
|
|
|
}
|
|
|
|
image->mRequests.Remove(mDocument);
|
|
|
|
}
|
|
|
|
mImages.Clear();
|
|
|
|
|
2012-08-15 00:34:20 +04:00
|
|
|
mDocument = nullptr;
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
2018-07-23 17:59:01 +03:00
|
|
|
// Normally, arrays of requests and frames are sorted by their pointer address,
|
|
|
|
// for faster lookup. When recording or replaying, we don't do this, so that
|
|
|
|
// the arrays retain their insertion order and are consistent between recording
|
|
|
|
// and replaying.
|
|
|
|
template <typename Elem, typename Item, typename Comparator = nsDefaultComparator<Elem, Item>>
|
|
|
|
static size_t
|
|
|
|
GetMaybeSortedIndex(const nsTArray<Elem>& aArray, const Item& aItem, bool* aFound,
|
|
|
|
Comparator aComparator = Comparator())
|
|
|
|
{
|
|
|
|
if (recordreplay::IsRecordingOrReplaying()) {
|
|
|
|
size_t index = aArray.IndexOf(aItem, 0, aComparator);
|
|
|
|
*aFound = index != nsTArray<Elem>::NoIndex;
|
|
|
|
return *aFound ? index + 1 : aArray.Length();
|
|
|
|
}
|
|
|
|
size_t index = aArray.IndexOfFirstElementGt(aItem, aComparator);
|
|
|
|
*aFound = index > 0 && aComparator.Equals(aItem, aArray.ElementAt(index - 1));
|
|
|
|
return index;
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
void
|
|
|
|
ImageLoader::AssociateRequestToFrame(imgIRequest* aRequest,
|
2018-01-25 09:56:43 +03:00
|
|
|
nsIFrame* aFrame,
|
|
|
|
FrameFlags aFlags)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
2012-10-12 20:11:22 +04:00
|
|
|
nsCOMPtr<imgINotificationObserver> observer;
|
|
|
|
aRequest->GetNotificationObserver(getter_AddRefs(observer));
|
2012-08-14 02:04:19 +04:00
|
|
|
if (!observer) {
|
|
|
|
// The request has already been canceled, so ignore it. This is ok because
|
|
|
|
// we're not going to get any more notifications from a canceled request.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
MOZ_ASSERT(observer == this);
|
|
|
|
|
2018-01-11 12:53:08 +03:00
|
|
|
FrameSet* frameSet =
|
|
|
|
mRequestToFrameMap.LookupForAdd(aRequest).OrInsert([=]() {
|
|
|
|
nsPresContext* presContext = GetPresContext();
|
|
|
|
if (presContext) {
|
|
|
|
nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
|
|
|
|
aRequest,
|
|
|
|
nullptr);
|
|
|
|
}
|
|
|
|
return new FrameSet();
|
|
|
|
});
|
2012-08-14 02:04:19 +04:00
|
|
|
|
2018-01-11 12:53:08 +03:00
|
|
|
RequestSet* requestSet =
|
|
|
|
mFrameToRequestMap.LookupForAdd(aFrame).OrInsert([=]() {
|
|
|
|
aFrame->SetHasImageRequest(true);
|
|
|
|
return new RequestSet();
|
|
|
|
});
|
2012-08-14 02:04:19 +04:00
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
// Add frame to the frameSet, and handle any special processing the
|
|
|
|
// frame might require.
|
2018-03-16 21:01:57 +03:00
|
|
|
FrameWithFlags fwf(aFrame);
|
2018-01-25 09:56:43 +03:00
|
|
|
FrameWithFlags* fwfToModify(&fwf);
|
|
|
|
|
|
|
|
// See if the frameSet already has this frame.
|
2018-07-23 17:59:01 +03:00
|
|
|
bool found;
|
|
|
|
uint32_t i = GetMaybeSortedIndex(*frameSet, fwf, &found, FrameOnlyComparator());
|
|
|
|
if (found) {
|
2018-01-25 09:56:43 +03:00
|
|
|
// We're already tracking this frame, so prepare to modify the
|
|
|
|
// existing FrameWithFlags object.
|
|
|
|
fwfToModify = &frameSet->ElementAt(i-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Check if the frame requires special processing.
|
|
|
|
if (aFlags & REQUEST_REQUIRES_REFLOW) {
|
|
|
|
fwfToModify->mFlags |= REQUEST_REQUIRES_REFLOW;
|
|
|
|
|
|
|
|
// If we weren't already blocking onload, do that now.
|
|
|
|
if ((fwfToModify->mFlags & REQUEST_HAS_BLOCKED_ONLOAD) == 0) {
|
2018-04-27 22:00:35 +03:00
|
|
|
// Get request status to see if we should block onload, and if we can
|
|
|
|
// request reflow immediately.
|
2018-01-25 09:56:43 +03:00
|
|
|
uint32_t status = 0;
|
2018-04-27 22:00:35 +03:00
|
|
|
if (NS_SUCCEEDED(aRequest->GetImageStatus(&status)) &&
|
|
|
|
!(status & imgIRequest::STATUS_ERROR)) {
|
|
|
|
// No error, so we can block onload.
|
|
|
|
fwfToModify->mFlags |= REQUEST_HAS_BLOCKED_ONLOAD;
|
|
|
|
|
|
|
|
// Block document onload until we either remove the frame in
|
|
|
|
// RemoveRequestToFrameMapping or onLoadComplete, or complete a reflow.
|
|
|
|
mDocument->BlockOnload();
|
|
|
|
|
|
|
|
// We need to stay blocked until we get a reflow. If the first frame
|
|
|
|
// is not yet decoded, we'll trigger that reflow from onFrameComplete.
|
|
|
|
// But if the first frame is already decoded, we need to trigger that
|
|
|
|
// reflow now, because we'll never get a call to onFrameComplete.
|
|
|
|
if(status & imgIRequest::STATUS_FRAME_COMPLETE) {
|
|
|
|
RequestReflowOnFrame(fwfToModify, aRequest);
|
2018-05-09 00:13:56 +03:00
|
|
|
} else {
|
|
|
|
// If we don't already have a complete frame, kickoff decode. This
|
|
|
|
// will ensure that either onFrameComplete or onLoadComplete will
|
|
|
|
// unblock document onload.
|
|
|
|
|
|
|
|
// We want to request decode in such a way that avoids triggering
|
|
|
|
// sync decode. First, we attempt to convert the aRequest into
|
|
|
|
// a imgIContainer. If that succeeds, then aRequest has an image
|
|
|
|
// and we can request decoding for size at zero size, and that will
|
|
|
|
// trigger async decode. If the conversion to imgIContainer is
|
|
|
|
// unsuccessful, then that means aRequest doesn't have an image yet,
|
|
|
|
// which means we can safely call StartDecoding() on it without
|
|
|
|
// triggering any synchronous work.
|
|
|
|
nsCOMPtr<imgIContainer> imgContainer;
|
|
|
|
aRequest->GetImage(getter_AddRefs(imgContainer));
|
|
|
|
if (imgContainer) {
|
|
|
|
imgContainer->RequestDecodeForSize(gfx::IntSize(0, 0),
|
|
|
|
imgIContainer::DECODE_FLAGS_DEFAULT);
|
|
|
|
} else {
|
|
|
|
// It's safe to call StartDecoding directly, since it can't
|
|
|
|
// trigger synchronous decode without an image. Flags are ignored.
|
|
|
|
aRequest->StartDecoding(imgIContainer::FLAG_NONE);
|
|
|
|
}
|
2018-04-27 22:00:35 +03:00
|
|
|
}
|
2018-01-25 09:56:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Do some sanity checking to ensure that we only add to one mapping
|
|
|
|
// iff we also add to the other mapping.
|
|
|
|
DebugOnly<bool> didAddToFrameSet(false);
|
|
|
|
DebugOnly<bool> didAddToRequestSet(false);
|
|
|
|
|
|
|
|
// If we weren't already tracking this frame, add it to the frameSet.
|
2018-07-23 17:59:01 +03:00
|
|
|
if (!found) {
|
2018-03-16 21:01:57 +03:00
|
|
|
frameSet->InsertElementAt(i, fwf);
|
2018-01-25 09:56:43 +03:00
|
|
|
didAddToFrameSet = true;
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
2018-01-25 09:56:43 +03:00
|
|
|
|
|
|
|
// Add request to the request set if it wasn't already there.
|
2018-07-23 17:59:01 +03:00
|
|
|
i = GetMaybeSortedIndex(*requestSet, aRequest, &found);
|
|
|
|
if (!found) {
|
2012-08-14 02:04:19 +04:00
|
|
|
requestSet->InsertElementAt(i, aRequest);
|
2018-01-25 09:56:43 +03:00
|
|
|
didAddToRequestSet = true;
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
2018-01-25 09:56:43 +03:00
|
|
|
|
|
|
|
MOZ_ASSERT(didAddToFrameSet == didAddToRequestSet,
|
|
|
|
"We should only add to one map iff we also add to the other map.");
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-24 21:50:49 +04:00
|
|
|
ImageLoader::MaybeRegisterCSSImage(ImageLoader::Image* aImage)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(aImage, "This should never be null!");
|
|
|
|
|
|
|
|
bool found = false;
|
|
|
|
aImage->mRequests.GetWeak(mDocument, &found);
|
|
|
|
if (found) {
|
|
|
|
// This document already has a request.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-10-12 16:43:01 +04:00
|
|
|
imgRequestProxy* canonicalRequest = aImage->mRequests.GetWeak(nullptr);
|
2012-08-14 02:04:19 +04:00
|
|
|
if (!canonicalRequest) {
|
|
|
|
// The image was blocked or something.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<imgRequestProxy> request;
|
2012-08-14 02:04:19 +04:00
|
|
|
|
|
|
|
// Ignore errors here. If cloning fails for some reason we'll put a null
|
|
|
|
// entry in the hash and we won't keep trying to clone.
|
|
|
|
mInClone = true;
|
2017-07-19 21:15:11 +03:00
|
|
|
canonicalRequest->SyncClone(this, mDocument, getter_AddRefs(request));
|
2012-08-14 02:04:19 +04:00
|
|
|
mInClone = false;
|
|
|
|
|
|
|
|
aImage->mRequests.Put(mDocument, request);
|
|
|
|
|
|
|
|
AddImage(aImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-24 21:50:49 +04:00
|
|
|
ImageLoader::DeregisterCSSImage(ImageLoader::Image* aImage)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
RemoveImage(aImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-06-07 16:22:41 +03:00
|
|
|
ImageLoader::RemoveRequestToFrameMapping(imgIRequest* aRequest,
|
|
|
|
nsIFrame* aFrame)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2012-10-12 20:11:22 +04:00
|
|
|
nsCOMPtr<imgINotificationObserver> observer;
|
|
|
|
aRequest->GetNotificationObserver(getter_AddRefs(observer));
|
2012-08-14 02:04:19 +04:00
|
|
|
MOZ_ASSERT(!observer || observer == this);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2017-06-18 18:07:54 +03:00
|
|
|
if (auto entry = mRequestToFrameMap.Lookup(aRequest)) {
|
|
|
|
FrameSet* frameSet = entry.Data();
|
|
|
|
MOZ_ASSERT(frameSet, "This should never be null");
|
2018-01-25 09:56:43 +03:00
|
|
|
|
|
|
|
// Before we remove aFrame from the frameSet, unblock onload if needed.
|
2018-07-23 17:59:01 +03:00
|
|
|
bool found;
|
|
|
|
uint32_t i = GetMaybeSortedIndex(*frameSet, FrameWithFlags(aFrame), &found,
|
|
|
|
FrameOnlyComparator());
|
|
|
|
if (found) {
|
2018-01-25 09:56:43 +03:00
|
|
|
FrameWithFlags& fwf = frameSet->ElementAt(i-1);
|
|
|
|
if (fwf.mFlags & REQUEST_HAS_BLOCKED_ONLOAD) {
|
|
|
|
mDocument->UnblockOnload(false);
|
|
|
|
// We're about to remove fwf from the frameSet, so we don't bother
|
|
|
|
// updating the flag.
|
|
|
|
}
|
|
|
|
frameSet->RemoveElementAt(i-1);
|
|
|
|
}
|
|
|
|
|
2017-06-18 18:07:54 +03:00
|
|
|
if (frameSet->IsEmpty()) {
|
|
|
|
nsPresContext* presContext = GetPresContext();
|
|
|
|
if (presContext) {
|
|
|
|
nsLayoutUtils::DeregisterImageRequest(presContext, aRequest, nullptr);
|
2017-06-07 16:22:41 +03:00
|
|
|
}
|
2017-06-18 18:07:54 +03:00
|
|
|
entry.Remove();
|
|
|
|
}
|
|
|
|
}
|
2017-06-07 16:22:41 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::RemoveFrameToRequestMapping(imgIRequest* aRequest,
|
|
|
|
nsIFrame* aFrame)
|
|
|
|
{
|
2017-06-18 18:07:54 +03:00
|
|
|
if (auto entry = mFrameToRequestMap.Lookup(aFrame)) {
|
|
|
|
RequestSet* requestSet = entry.Data();
|
|
|
|
MOZ_ASSERT(requestSet, "This should never be null");
|
2018-07-23 17:59:01 +03:00
|
|
|
if (recordreplay::IsRecordingOrReplaying()) {
|
|
|
|
requestSet->RemoveElement(aRequest);
|
|
|
|
} else {
|
|
|
|
requestSet->RemoveElementSorted(aRequest);
|
|
|
|
}
|
2017-06-18 18:07:54 +03:00
|
|
|
if (requestSet->IsEmpty()) {
|
|
|
|
aFrame->SetHasImageRequest(false);
|
|
|
|
entry.Remove();
|
|
|
|
}
|
|
|
|
}
|
2017-06-07 16:22:41 +03:00
|
|
|
}
|
2012-08-14 02:04:19 +04:00
|
|
|
|
2017-06-07 16:22:41 +03:00
|
|
|
void
|
|
|
|
ImageLoader::DisassociateRequestFromFrame(imgIRequest* aRequest,
|
|
|
|
nsIFrame* aFrame)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aFrame->HasImageRequest(), "why call me?");
|
|
|
|
RemoveRequestToFrameMapping(aRequest, aFrame);
|
|
|
|
RemoveFrameToRequestMapping(aRequest, aFrame);
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::DropRequestsForFrame(nsIFrame* aFrame)
|
|
|
|
{
|
2017-06-07 16:22:41 +03:00
|
|
|
MOZ_ASSERT(aFrame->HasImageRequest(), "why call me?");
|
|
|
|
nsAutoPtr<RequestSet> requestSet;
|
2017-07-05 03:01:45 +03:00
|
|
|
mFrameToRequestMap.Remove(aFrame, &requestSet);
|
2017-06-07 16:22:41 +03:00
|
|
|
aFrame->SetHasImageRequest(false);
|
|
|
|
if (MOZ_UNLIKELY(!requestSet)) {
|
|
|
|
MOZ_ASSERT_UNREACHABLE("HasImageRequest was lying");
|
2012-08-14 02:04:19 +04:00
|
|
|
return;
|
|
|
|
}
|
2017-06-07 16:22:41 +03:00
|
|
|
for (imgIRequest* request : *requestSet) {
|
|
|
|
RemoveRequestToFrameMapping(request, aFrame);
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-22 19:56:38 +04:00
|
|
|
ImageLoader::SetAnimationMode(uint16_t aMode)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(aMode == imgIContainer::kNormalAnimMode ||
|
|
|
|
aMode == imgIContainer::kDontAnimMode ||
|
|
|
|
aMode == imgIContainer::kLoopOnceAnimMode,
|
|
|
|
"Wrong Animation Mode is being set!");
|
|
|
|
|
2015-07-30 23:48:10 +03:00
|
|
|
for (auto iter = mRequestToFrameMap.ConstIter(); !iter.Done(); iter.Next()) {
|
|
|
|
auto request = static_cast<imgIRequest*>(iter.Key());
|
2014-09-05 08:27:16 +04:00
|
|
|
|
|
|
|
#ifdef DEBUG
|
2015-07-30 23:48:10 +03:00
|
|
|
{
|
2018-10-02 00:38:01 +03:00
|
|
|
nsCOMPtr<imgIRequest> debugRequest = request;
|
2015-07-30 23:48:10 +03:00
|
|
|
NS_ASSERTION(debugRequest == request, "This is bad");
|
|
|
|
}
|
2014-09-05 08:27:16 +04:00
|
|
|
#endif
|
|
|
|
|
2015-07-30 23:48:10 +03:00
|
|
|
nsCOMPtr<imgIContainer> container;
|
|
|
|
request->GetImage(getter_AddRefs(container));
|
|
|
|
if (!container) {
|
|
|
|
continue;
|
|
|
|
}
|
2014-09-05 08:27:16 +04:00
|
|
|
|
2015-07-30 23:48:10 +03:00
|
|
|
// This can fail if the image is in error, and we don't care.
|
|
|
|
container->SetAnimationMode(aMode);
|
|
|
|
}
|
2014-09-05 08:27:16 +04:00
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
void
|
2014-09-05 08:27:16 +04:00
|
|
|
ImageLoader::ClearFrames(nsPresContext* aPresContext)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
2015-07-30 23:48:10 +03:00
|
|
|
for (auto iter = mRequestToFrameMap.ConstIter(); !iter.Done(); iter.Next()) {
|
|
|
|
auto request = static_cast<imgIRequest*>(iter.Key());
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
{
|
2018-10-02 00:38:01 +03:00
|
|
|
nsCOMPtr<imgIRequest> debugRequest = request;
|
2015-07-30 23:48:10 +03:00
|
|
|
NS_ASSERTION(debugRequest == request, "This is bad");
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (aPresContext) {
|
|
|
|
nsLayoutUtils::DeregisterImageRequest(aPresContext,
|
2018-01-11 12:53:08 +03:00
|
|
|
request,
|
|
|
|
nullptr);
|
2015-07-30 23:48:10 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
mRequestToFrameMap.Clear();
|
|
|
|
mFrameToRequestMap.Clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::LoadImage(nsIURI* aURI, nsIPrincipal* aOriginPrincipal,
|
2018-09-17 08:36:54 +03:00
|
|
|
nsIURI* aReferrer,
|
|
|
|
mozilla::net::ReferrerPolicy aPolicy,
|
|
|
|
ImageLoader::Image* aImage,
|
2018-01-26 01:14:13 +03:00
|
|
|
CORSMode aCorsMode)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(aImage->mRequests.Count() == 0, "Huh?");
|
|
|
|
|
2012-08-15 00:34:20 +04:00
|
|
|
aImage->mRequests.Put(nullptr, nullptr);
|
2012-08-14 02:04:19 +04:00
|
|
|
|
|
|
|
if (!aURI) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-01-26 01:14:13 +03:00
|
|
|
int32_t loadFlags = nsIRequest::LOAD_NORMAL |
|
|
|
|
nsContentUtils::CORSModeToLoadImageFlags(aCorsMode);
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<imgRequestProxy> request;
|
2016-04-27 20:41:13 +03:00
|
|
|
nsresult rv = nsContentUtils::LoadImage(aURI, mDocument, mDocument,
|
2017-09-21 03:09:00 +03:00
|
|
|
aOriginPrincipal, 0, aReferrer,
|
2018-09-17 08:36:54 +03:00
|
|
|
aPolicy,
|
2018-01-26 01:14:13 +03:00
|
|
|
nullptr, loadFlags,
|
2016-04-27 20:41:13 +03:00
|
|
|
NS_LITERAL_STRING("css"),
|
|
|
|
getter_AddRefs(request));
|
|
|
|
|
|
|
|
if (NS_FAILED(rv) || !request) {
|
2012-08-14 02:04:19 +04:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-10-18 08:24:48 +03:00
|
|
|
RefPtr<imgRequestProxy> clonedRequest;
|
2012-08-14 02:04:19 +04:00
|
|
|
mInClone = true;
|
2017-07-19 21:15:11 +03:00
|
|
|
rv = request->SyncClone(this, mDocument, getter_AddRefs(clonedRequest));
|
2012-08-14 02:04:19 +04:00
|
|
|
mInClone = false;
|
|
|
|
|
|
|
|
if (NS_FAILED(rv)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2012-08-15 00:34:20 +04:00
|
|
|
aImage->mRequests.Put(nullptr, request);
|
2012-08-14 02:04:19 +04:00
|
|
|
aImage->mRequests.Put(mDocument, clonedRequest);
|
|
|
|
|
|
|
|
AddImage(aImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-24 21:50:49 +04:00
|
|
|
ImageLoader::AddImage(ImageLoader::Image* aImage)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(!mImages.Contains(aImage), "Huh?");
|
2015-05-27 00:04:24 +03:00
|
|
|
mImages.PutEntry(aImage);
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-08-24 21:50:49 +04:00
|
|
|
ImageLoader::RemoveImage(ImageLoader::Image* aImage)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mImages.Contains(aImage), "Huh?");
|
|
|
|
mImages.RemoveEntry(aImage);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsPresContext*
|
|
|
|
ImageLoader::GetPresContext()
|
|
|
|
{
|
|
|
|
if (!mDocument) {
|
2012-08-15 00:34:20 +04:00
|
|
|
return nullptr;
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
2018-02-21 01:00:10 +03:00
|
|
|
return mDocument->GetPresContext();
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
2017-12-04 06:12:25 +03:00
|
|
|
static bool
|
|
|
|
IsRenderNoImages(uint32_t aDisplayItemKey)
|
2012-11-07 02:04:53 +04:00
|
|
|
{
|
2017-12-04 06:12:25 +03:00
|
|
|
DisplayItemType type = GetDisplayItemTypeFromKey(aDisplayItemKey);
|
2017-08-07 07:07:43 +03:00
|
|
|
uint8_t flags = GetDisplayItemFlagsForType(type);
|
2017-12-04 06:12:25 +03:00
|
|
|
return flags & TYPE_RENDERS_NO_IMAGES;
|
|
|
|
}
|
2012-11-07 02:04:53 +04:00
|
|
|
|
2018-02-23 08:03:45 +03:00
|
|
|
static void
|
|
|
|
InvalidateImages(nsIFrame* aFrame)
|
2017-12-04 06:12:25 +03:00
|
|
|
{
|
|
|
|
bool invalidateFrame = false;
|
|
|
|
const SmallPointerArray<DisplayItemData>& array = aFrame->DisplayItemData();
|
|
|
|
for (uint32_t i = 0; i < array.Length(); i++) {
|
|
|
|
DisplayItemData* data = DisplayItemData::AssertDisplayItemData(array.ElementAt(i));
|
|
|
|
uint32_t displayItemKey = data->GetDisplayItemKey();
|
|
|
|
if (displayItemKey != 0 && !IsRenderNoImages(displayItemKey)) {
|
|
|
|
if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
|
|
|
|
DisplayItemType type = GetDisplayItemTypeFromKey(displayItemKey);
|
|
|
|
printf_stderr("Invalidating display item(type=%d) based on frame %p \
|
|
|
|
because it might contain an invalidated image\n",
|
|
|
|
static_cast<uint32_t>(type), aFrame);
|
|
|
|
}
|
|
|
|
|
|
|
|
data->Invalidate();
|
|
|
|
invalidateFrame = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (auto userDataTable =
|
2018-03-16 00:35:56 +03:00
|
|
|
aFrame->GetProperty(layers::WebRenderUserDataProperty::Key())) {
|
2017-12-04 06:12:25 +03:00
|
|
|
for (auto iter = userDataTable->Iter(); !iter.Done(); iter.Next()) {
|
|
|
|
RefPtr<layers::WebRenderUserData> data = iter.UserData();
|
|
|
|
if (data->GetType() == layers::WebRenderAnimationData::UserDataType::eFallback &&
|
|
|
|
!IsRenderNoImages(data->GetDisplayItemKey())) {
|
|
|
|
static_cast<layers::WebRenderFallbackData*>(data.get())->SetInvalid(true);
|
|
|
|
}
|
2018-03-27 18:51:29 +03:00
|
|
|
//XXX: handle Blob data
|
2017-12-04 06:12:25 +03:00
|
|
|
invalidateFrame = true;
|
|
|
|
}
|
2012-11-07 02:04:53 +04:00
|
|
|
}
|
|
|
|
|
2017-12-04 06:12:25 +03:00
|
|
|
if (invalidateFrame) {
|
|
|
|
aFrame->SchedulePaint();
|
2015-03-23 06:32:00 +03:00
|
|
|
}
|
2012-11-07 02:04:53 +04:00
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
void
|
2014-11-08 02:40:12 +03:00
|
|
|
ImageLoader::DoRedraw(FrameSet* aFrameSet, bool aForcePaint)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
|
|
|
NS_ASSERTION(aFrameSet, "Must have a frame set");
|
|
|
|
NS_ASSERTION(mDocument, "Should have returned earlier!");
|
|
|
|
|
2018-03-16 21:01:57 +03:00
|
|
|
for (FrameWithFlags& fwf : *aFrameSet) {
|
|
|
|
nsIFrame* frame = fwf.mFrame;
|
2013-02-17 01:51:02 +04:00
|
|
|
if (frame->StyleVisibility()->IsVisible()) {
|
2013-03-08 06:18:45 +04:00
|
|
|
if (frame->IsFrameOfType(nsIFrame::eTablePart)) {
|
|
|
|
// Tables don't necessarily build border/background display items
|
|
|
|
// for the individual table part frames, so IterateRetainedDataFor
|
|
|
|
// might not find the right display item.
|
|
|
|
frame->InvalidateFrame();
|
|
|
|
} else {
|
2017-12-04 06:12:25 +03:00
|
|
|
InvalidateImages(frame);
|
2015-06-25 20:46:00 +03:00
|
|
|
|
|
|
|
// Update ancestor rendering observers (-moz-element etc)
|
|
|
|
nsIFrame *f = frame;
|
|
|
|
while (f && !f->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) {
|
2017-08-30 17:58:31 +03:00
|
|
|
SVGObserverUtils::InvalidateDirectRenderingObservers(f);
|
2015-06-25 20:46:00 +03:00
|
|
|
f = nsLayoutUtils::GetCrossDocParentFrame(f);
|
|
|
|
}
|
|
|
|
|
2014-11-08 02:40:12 +03:00
|
|
|
if (aForcePaint) {
|
|
|
|
frame->SchedulePaint();
|
|
|
|
}
|
2013-03-08 06:18:45 +04:00
|
|
|
}
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
void
|
|
|
|
ImageLoader::UnblockOnloadIfNeeded(nsIFrame* aFrame, imgIRequest* aRequest)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aFrame);
|
|
|
|
MOZ_ASSERT(aRequest);
|
|
|
|
|
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t i = frameSet->BinaryIndexOf(FrameWithFlags(aFrame),
|
|
|
|
FrameOnlyComparator());
|
|
|
|
if (i != FrameSet::NoIndex) {
|
|
|
|
FrameWithFlags& fwf = frameSet->ElementAt(i);
|
|
|
|
if (fwf.mFlags & REQUEST_HAS_BLOCKED_ONLOAD) {
|
|
|
|
mDocument->UnblockOnload(false);
|
|
|
|
fwf.mFlags &= ~REQUEST_HAS_BLOCKED_ONLOAD;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::RequestReflowIfNeeded(FrameSet* aFrameSet, imgIRequest* aRequest)
|
|
|
|
{
|
|
|
|
MOZ_ASSERT(aFrameSet);
|
|
|
|
|
|
|
|
for (FrameWithFlags& fwf : *aFrameSet) {
|
|
|
|
if (fwf.mFlags & REQUEST_REQUIRES_REFLOW) {
|
|
|
|
// Tell the container of the frame to reflow because the
|
|
|
|
// image request has finished decoding its first frame.
|
|
|
|
RequestReflowOnFrame(&fwf, aRequest);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::RequestReflowOnFrame(FrameWithFlags* aFwf, imgIRequest* aRequest)
|
|
|
|
{
|
|
|
|
nsIFrame* frame = aFwf->mFrame;
|
|
|
|
|
|
|
|
// Actually request the reflow.
|
|
|
|
nsIFrame* parent = frame->GetInFlowParent();
|
|
|
|
parent->PresShell()->FrameNeedsReflow(parent, nsIPresShell::eStyleChange,
|
|
|
|
NS_FRAME_IS_DIRTY);
|
|
|
|
|
|
|
|
// We'll respond to the reflow events by unblocking onload, regardless
|
|
|
|
// of whether the reflow was completed or cancelled. The callback will
|
|
|
|
// also delete itself when it is called.
|
|
|
|
ImageReflowCallback* unblocker = new ImageReflowCallback(this, frame,
|
|
|
|
aRequest);
|
|
|
|
parent->PresShell()->PostReflowCallback(unblocker);
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
NS_IMPL_ADDREF(ImageLoader)
|
|
|
|
NS_IMPL_RELEASE(ImageLoader)
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN(ImageLoader)
|
2012-10-12 20:11:22 +04:00
|
|
|
NS_INTERFACE_MAP_ENTRY(imgINotificationObserver)
|
2012-08-14 02:04:19 +04:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2014-11-18 01:29:56 +03:00
|
|
|
ImageLoader::Notify(imgIRequest* aRequest, int32_t aType, const nsIntRect* aData)
|
2012-10-12 20:11:22 +04:00
|
|
|
{
|
2018-01-18 22:02:30 +03:00
|
|
|
#ifdef MOZ_GECKO_PROFILER
|
|
|
|
nsCString uriString;
|
|
|
|
if (profiler_is_active()) {
|
|
|
|
nsCOMPtr<nsIURI> uri;
|
|
|
|
aRequest->GetFinalURI(getter_AddRefs(uri));
|
|
|
|
if (uri) {
|
|
|
|
uri->GetSpec(uriString);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
AUTO_PROFILER_LABEL_DYNAMIC_NSCSTRING("ImageLoader::Notify", OTHER, uriString);
|
|
|
|
#endif
|
|
|
|
|
2012-10-12 20:11:23 +04:00
|
|
|
if (aType == imgINotificationObserver::SIZE_AVAILABLE) {
|
2012-10-12 20:11:22 +04:00
|
|
|
nsCOMPtr<imgIContainer> image;
|
|
|
|
aRequest->GetImage(getter_AddRefs(image));
|
2014-11-18 01:29:56 +03:00
|
|
|
return OnSizeAvailable(aRequest, image);
|
2012-10-12 20:11:22 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
if (aType == imgINotificationObserver::IS_ANIMATED) {
|
|
|
|
return OnImageIsAnimated(aRequest);
|
|
|
|
}
|
|
|
|
|
2014-11-18 01:29:56 +03:00
|
|
|
if (aType == imgINotificationObserver::FRAME_COMPLETE) {
|
2014-11-18 01:29:56 +03:00
|
|
|
return OnFrameComplete(aRequest);
|
2012-10-12 20:11:22 +04:00
|
|
|
}
|
|
|
|
|
2012-10-12 20:11:23 +04:00
|
|
|
if (aType == imgINotificationObserver::FRAME_UPDATE) {
|
2014-11-18 01:29:56 +03:00
|
|
|
return OnFrameUpdate(aRequest);
|
2012-10-12 20:11:22 +04:00
|
|
|
}
|
|
|
|
|
2015-06-03 20:42:07 +03:00
|
|
|
if (aType == imgINotificationObserver::DECODE_COMPLETE) {
|
|
|
|
nsCOMPtr<imgIContainer> image;
|
|
|
|
aRequest->GetImage(getter_AddRefs(image));
|
|
|
|
if (image && mDocument) {
|
|
|
|
image->PropagateUseCounters(mDocument);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
if (aType == imgINotificationObserver::LOAD_COMPLETE) {
|
|
|
|
return OnLoadComplete(aRequest);
|
|
|
|
}
|
|
|
|
|
2012-10-12 20:11:22 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsresult
|
2014-11-18 01:29:56 +03:00
|
|
|
ImageLoader::OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage)
|
2017-07-06 15:00:35 +03:00
|
|
|
{
|
2012-08-14 02:04:19 +04:00
|
|
|
nsPresContext* presContext = GetPresContext();
|
|
|
|
if (!presContext) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
aImage->SetAnimationMode(presContext->ImageAnimationMode());
|
|
|
|
|
2018-01-11 13:08:51 +03:00
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
2017-12-15 02:37:56 +03:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-03-16 21:01:57 +03:00
|
|
|
for (FrameWithFlags& fwf : *frameSet) {
|
|
|
|
nsIFrame* frame = fwf.mFrame;
|
2017-12-15 02:37:56 +03:00
|
|
|
if (frame->StyleVisibility()->IsVisible()) {
|
|
|
|
frame->MarkNeedsDisplayItemRebuild();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-10-12 20:11:22 +04:00
|
|
|
nsresult
|
2012-08-14 02:04:19 +04:00
|
|
|
ImageLoader::OnImageIsAnimated(imgIRequest* aRequest)
|
|
|
|
{
|
|
|
|
if (!mDocument) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-01-11 13:08:51 +03:00
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
2012-08-22 03:14:06 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
// Register with the refresh driver now that we are aware that
|
|
|
|
// we are animated.
|
|
|
|
nsPresContext* presContext = GetPresContext();
|
|
|
|
if (presContext) {
|
|
|
|
nsLayoutUtils::RegisterImageRequest(presContext,
|
|
|
|
aRequest,
|
2012-08-15 00:34:20 +04:00
|
|
|
nullptr);
|
2012-08-14 02:04:19 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-10-12 20:11:22 +04:00
|
|
|
nsresult
|
2014-11-18 01:29:56 +03:00
|
|
|
ImageLoader::OnFrameComplete(imgIRequest* aRequest)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
2012-08-21 04:14:04 +04:00
|
|
|
if (!mDocument || mInClone) {
|
2012-08-14 02:04:19 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-01-11 13:08:51 +03:00
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
2012-08-14 02:04:19 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
// We may need reflow (for example if the image is from shape-outside).
|
|
|
|
RequestReflowIfNeeded(frameSet, aRequest);
|
|
|
|
|
2014-11-08 02:40:12 +03:00
|
|
|
// Since we just finished decoding a frame, we always want to paint, in case
|
|
|
|
// we're now able to paint an image that we couldn't paint before (and hence
|
|
|
|
// that we don't have retained data for).
|
|
|
|
DoRedraw(frameSet, /* aForcePaint = */ true);
|
2012-08-14 02:04:19 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2012-10-12 20:11:22 +04:00
|
|
|
nsresult
|
2014-11-18 01:29:56 +03:00
|
|
|
ImageLoader::OnFrameUpdate(imgIRequest* aRequest)
|
2012-08-14 02:04:19 +04:00
|
|
|
{
|
2012-08-21 04:14:04 +04:00
|
|
|
if (!mDocument || mInClone) {
|
2012-08-14 02:04:19 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-01-11 13:08:51 +03:00
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
2012-08-14 02:04:19 +04:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2014-11-08 02:40:12 +03:00
|
|
|
DoRedraw(frameSet, /* aForcePaint = */ false);
|
2012-08-14 02:04:19 +04:00
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
nsresult
|
|
|
|
ImageLoader::OnLoadComplete(imgIRequest* aRequest)
|
|
|
|
{
|
|
|
|
if (!mDocument || mInClone) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
FrameSet* frameSet = mRequestToFrameMap.Get(aRequest);
|
|
|
|
if (!frameSet) {
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2018-04-27 22:00:35 +03:00
|
|
|
// Check if aRequest has an error state. If it does, we need to unblock
|
|
|
|
// Document onload for all the frames associated with this request that
|
|
|
|
// have blocked onload. This is what happens in a CORS mode violation, and
|
|
|
|
// may happen during other network events.
|
|
|
|
uint32_t status = 0;
|
|
|
|
if(NS_SUCCEEDED(aRequest->GetImageStatus(&status)) &&
|
|
|
|
status & imgIRequest::STATUS_ERROR) {
|
|
|
|
for (FrameWithFlags& fwf : *frameSet) {
|
|
|
|
if (fwf.mFlags & REQUEST_HAS_BLOCKED_ONLOAD) {
|
|
|
|
// We've blocked onload. Unblock onload and clear the flag.
|
|
|
|
mDocument->UnblockOnload(false);
|
|
|
|
fwf.mFlags &= ~REQUEST_HAS_BLOCKED_ONLOAD;
|
|
|
|
}
|
2018-01-25 09:56:43 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2015-03-17 22:25:35 +03:00
|
|
|
void
|
|
|
|
ImageLoader::FlushUseCounters()
|
|
|
|
{
|
|
|
|
for (auto iter = mImages.Iter(); !iter.Done(); iter.Next()) {
|
|
|
|
nsPtrHashKey<Image>* key = iter.Get();
|
|
|
|
ImageLoader::Image* image = key->GetKey();
|
|
|
|
|
|
|
|
imgIRequest* request = image->mRequests.GetWeak(mDocument);
|
|
|
|
|
|
|
|
nsCOMPtr<imgIContainer> container;
|
|
|
|
request->GetImage(getter_AddRefs(container));
|
|
|
|
if (container) {
|
|
|
|
static_cast<image::Image*>(container.get())->ReportUseCounters();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-01-25 09:56:43 +03:00
|
|
|
bool
|
|
|
|
ImageLoader::ImageReflowCallback::ReflowFinished()
|
|
|
|
{
|
|
|
|
// Check that the frame is still valid. If it isn't, then onload was
|
|
|
|
// unblocked when the frame was removed from the FrameSet in
|
|
|
|
// RemoveRequestToFrameMapping.
|
|
|
|
if (mFrame.IsAlive()) {
|
|
|
|
mLoader->UnblockOnloadIfNeeded(mFrame, mRequest);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get rid of this callback object.
|
|
|
|
delete this;
|
|
|
|
|
|
|
|
// We don't need to trigger layout.
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ImageLoader::ImageReflowCallback::ReflowCallbackCanceled()
|
|
|
|
{
|
|
|
|
// Check that the frame is still valid. If it isn't, then onload was
|
|
|
|
// unblocked when the frame was removed from the FrameSet in
|
|
|
|
// RemoveRequestToFrameMapping.
|
|
|
|
if (mFrame.IsAlive()) {
|
|
|
|
mLoader->UnblockOnloadIfNeeded(mFrame, mRequest);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Get rid of this callback object.
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
2012-08-14 02:04:19 +04:00
|
|
|
} // namespace css
|
|
|
|
} // namespace mozilla
|