mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-04-12 02:50:13 +00:00

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
47 lines
930 B
C
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
|