Backout cset a476b7988f63 from bug 666446 while we sort out regressions

This commit is contained in:
Scott Johnson 2011-10-07 00:25:48 -07:00
Родитель 882053fa8e
Коммит e7410d09c6
2 изменённых файлов: 0 добавлений и 153 удалений

Просмотреть файл

@ -4292,102 +4292,6 @@ nsLayoutUtils::Shutdown()
}
}
/* static */
void
nsLayoutUtils::RegisterImageRequest(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered)
{
if (!aPresContext) {
return;
}
if (aRequestRegistered && *aRequestRegistered) {
// Our request is already registered with the refresh driver, so
// no need to register it again.
return;
}
if (aRequest) {
nsCOMPtr<imgIContainer> image;
aRequest->GetImage(getter_AddRefs(image));
if (image) {
if (!aPresContext->RefreshDriver()->AddImageRequest(aRequest)) {
NS_WARNING("Unable to add image request");
return;
}
if (aRequestRegistered) {
*aRequestRegistered = true;
}
}
}
}
/* static */
void
nsLayoutUtils::DeregisterImageRequest(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered)
{
if (!aPresContext) {
return;
}
// Deregister our imgIRequest with the refresh driver to
// complete tear-down, but only if it has been registered
if (aRequestRegistered && !*aRequestRegistered) {
return;
}
if (aRequest) {
nsCOMPtr<imgIContainer> image;
aRequest->GetImage(getter_AddRefs(image));
if (image) {
aPresContext->RefreshDriver()->RemoveImageRequest(aRequest);
if (aRequestRegistered) {
*aRequestRegistered = false;
}
}
}
}
/* static */
void
nsLayoutUtils::DeregisterImageRequestIfNotAnimated(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered)
{
if (!aPresContext) {
return;
}
if (aRequestRegistered && !*aRequestRegistered) {
// Image request isn't registered with the refresh driver - no need
// to try and deregister it.
return;
}
// Deregister the imgIRequest with the refresh driver if the
// image is not animated
nsCOMPtr<imgIContainer> imageContainer;
if (aRequest) {
aRequest->GetImage(getter_AddRefs(imageContainer));
bool animated;
if (!imageContainer) {
return;
}
nsresult rv = imageContainer->GetAnimated(&animated);
if (NS_SUCCEEDED(rv) && !animated) {
nsLayoutUtils::DeregisterImageRequest(aPresContext, aRequest,
aRequestRegistered);
}
}
}
nsSetAttrRunnable::nsSetAttrRunnable(nsIContent* aContent, nsIAtom* aAttrName,
const nsAString& aValue)
: mContent(aContent),

Просмотреть файл

@ -1440,63 +1440,6 @@ public:
static void Shutdown();
/**
* Register an imgIRequest object with a refresh driver.
*
* @param aPresContext The nsPresContext whose refresh driver we want to
* register with.
* @param aRequest A pointer to the imgIRequest object which the client wants
* to register with the refresh driver.
* @param aRequestRegistered A pointer to a boolean value which indicates
* whether the given image request is registered. If
* *aRequestRegistered is true, then this request will not be
* registered again. If the request is registered by this function,
* then *aRequestRegistered will be set to true upon the completion of
* this function.
*
*/
static void RegisterImageRequest(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered);
/**
* Deregister an imgIRequest object from a refresh driver.
*
* @param aPresContext The nsPresContext whose refresh driver we want to
* deregister from.
* @param aRequest A pointer to the imgIRequest object with which the client
* previously registered and now wants to deregister from the refresh
* driver.
* @param aRequestRegistered A pointer to a boolean value which indicates
* whether the given image request is registered. If
* *aRequestRegistered is false, then this request will not be
* deregistered. If the request is deregistered by this function,
* then *aRequestRegistered will be set to false upon the completion of
* this function.
*/
static void DeregisterImageRequest(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered);
/**
* Deregister an imgIRequest object from a refresh driver, if the
* imgIRequest object represents a static (i.e. not animated) image.
*
* @param aPresContext The nsPresContext whose refresh driver we want to
* deregister from.
* @param aRequest A pointer to the imgIRequest object with which the client
* previously registered and now wants to deregister from the refresh
* driver.
* @param aRequestRegistered A pointer to a boolean value which indicates
* whether the given image request is registered. If
* *aRequestRegistered is false, then this request will not be
* deregistered. If the request is deregistered by this function,
* then *aRequestRegistered will be set to false upon the completion of
* this function.
*/
static void DeregisterImageRequestIfNotAnimated(nsPresContext* aPresContext,
imgIRequest* aRequest,
bool* aRequestRegistered);
#ifdef DEBUG
/**
* Assert that there are no duplicate continuations of the same frame