Bug 1357583: Add an API to get the restyle generation from the pres context. r=heycam

MozReview-Commit-ID: b7j0CpPimC
This commit is contained in:
Emilio Cobos Álvarez 2017-05-26 16:39:11 +02:00
parent d59f61ebff
commit fa730cc3b0
2 changed files with 19 additions and 0 deletions

View File

@ -4033,6 +4033,18 @@ nsDOMWindowUtils::GetElementsRestyled(uint64_t* aResult)
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetRestyleGeneration(uint64_t* aResult)
{
nsPresContext* presContext = GetPresContext();
if (!presContext) {
return NS_ERROR_NOT_AVAILABLE;
}
*aResult = presContext->GetRestyleGeneration();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetFramesConstructed(uint64_t* aResult)
{

View File

@ -1886,6 +1886,13 @@ interface nsIDOMWindowUtils : nsISupports {
*/
readonly attribute unsigned long long elementsRestyled;
/**
* Restyle generation for the current document.
*
* May throw NS_ERROR_NOT_AVAILABLE.
*/
readonly attribute unsigned long long restyleGeneration;
/**
* Number of frames constructed (excluding breaking) for the curent
* document.