1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_FlushType_h
8 #define mozilla_FlushType_h
11 #include "X11UndefineNone.h"
12 #include "mozilla/EnumeratedArray.h"
17 * This is the enum used by Document::FlushPendingNotifications to
18 * decide what to flush.
20 * Please note that if you change these values, you should sync it with the
21 * kFlushTypeNames array below.
23 enum class FlushType
: uint8_t {
24 None
, /* Actually don't flush anything */
25 Event
, /* Flush pending events before notify other observers */
26 Content
, /* flush the content model construction */
27 ContentAndNotify
, /* As above, plus flush the frame model
28 construction and other nsIMutationObserver
30 Style
, /* As above, plus flush style reresolution */
31 Frames
, /* As above, plus flush frame construction */
32 EnsurePresShellInitAndFrames
, /* As above, plus ensure the pres shell is alive
34 InterruptibleLayout
, /* As above, plus flush reflow, but allow it to be
35 interrupted (so an incomplete layout may result) */
36 Layout
, /* As above, but layout must run to completion */
37 Display
, /* As above, plus flush painting */
41 // Flush type strings that will be displayed in the profiler
43 const EnumeratedArray
<FlushType
, FlushType::Count
, const char*>
50 // As far as the profiler is concerned, EnsurePresShellInitAndFrames and
51 // Frames are the same
54 "InterruptibleLayout",
60 struct ChangesToFlush
{
61 ChangesToFlush(FlushType aFlushType
, bool aFlushAnimations
)
62 : mFlushType(aFlushType
), mFlushAnimations(aFlushAnimations
) {}
65 bool mFlushAnimations
;
68 } // namespace mozilla
70 #endif // mozilla_FlushType_h