gecko-dev/layout/base/nsIPresShellInlines.h
Emilio Cobos Álvarez 68f1504992 Bug 1355343: Take all the snapshots into account. r=bholley
I've chosen this approach mainly because there's no other good way to guarantee
the model is correct than holding the snapshots alive until a style refresh.

What I tried before this (storing them in a sort of "immutable element data") is
a pain, since we call into style from the frame constructor and other content
notifications, which makes keeping track of which snapshots should be cleared an
which shouldn't an insane task.

Ideally we'd have a single entry-point for style, but that's not the case right
now, and changing that requires pretty non-trivial changes to the frame
constructor.

MozReview-Commit-ID: FF1KWZv2iBM

--HG--
extra : rebase_source : b02d516ea164fc567110338411bf6ba251d53dab
2017-05-07 16:36:47 +02:00

47 lines
930 B
C

#ifndef nsIPresShellInlines_h
#define nsIPresShellInlines_h
#include "nsIDocument.h"
void
nsIPresShell::SetNeedLayoutFlush()
{
mNeedLayoutFlush = true;
if (nsIDocument* doc = mDocument->GetDisplayDocument()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->mNeedLayoutFlush = true;
}
}
}
void
nsIPresShell::SetNeedStyleFlush()
{
mNeedStyleFlush = true;
if (nsIDocument* doc = mDocument->GetDisplayDocument()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->mNeedStyleFlush = true;
}
}
}
void
nsIPresShell::EnsureStyleFlush()
{
SetNeedStyleFlush();
ObserveStyleFlushes();
}
void
nsIPresShell::SetNeedThrottledAnimationFlush()
{
mNeedThrottledAnimationFlush = true;
if (nsIDocument* doc = mDocument->GetDisplayDocument()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->mNeedThrottledAnimationFlush = true;
}
}
}
#endif // nsIPresShellInlines_h