Bug 709492 - Part 1: Add a paintingSuppressed getter to nsIDOMWindowUtils. r=bz

This commit is contained in:
Patrick Walton 2012-01-03 22:52:20 -08:00
parent 27f33128b7
commit 2307e2060e
2 changed files with 23 additions and 1 deletions

View File

@ -2039,3 +2039,19 @@ nsDOMWindowUtils::GetPCCountScriptContents(PRInt32 script, JSContext* cx, nsAStr
result = str;
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetPaintingSuppressed(bool *aPaintingSuppressed)
{
NS_ENSURE_TRUE(mWindow, NS_ERROR_FAILURE);
nsIDocShell *docShell = mWindow->GetDocShell();
NS_ENSURE_TRUE(docShell, NS_ERROR_FAILURE);
nsCOMPtr<nsIPresShell> presShell;
docShell->GetPresShell(getter_AddRefs(presShell));
NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);
*aPaintingSuppressed = presShell->IsPaintingSuppressed();
return NS_OK;
}

View File

@ -69,7 +69,7 @@ interface nsIDOMBlob;
interface nsIDOMFile;
interface nsIFile;
[scriptable, uuid(9df58cf3-7094-4c8d-96f2-bebd765099fe)]
[scriptable, uuid(c1fa9c82-acf2-4b27-8ca7-7d1864e606af)]
interface nsIDOMWindowUtils : nsISupports {
/**
@ -981,4 +981,10 @@ interface nsIDOMWindowUtils : nsISupports {
*/
[implicit_jscontext]
AString getPCCountScriptContents(in long script);
/**
* Returns true if painting is suppressed for this window and false
* otherwise.
*/
readonly attribute boolean paintingSuppressed;
};