Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / base / FlushType.h
blob04a253c534c30c75ad6955d3e0f7bff4bad4b2d1
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
10 #include <stdint.h>
11 #include "X11UndefineNone.h"
12 #include "mozilla/EnumeratedArray.h"
14 namespace mozilla {
16 /**
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
29 notifications. */
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 */
38 Count
41 // Flush type strings that will be displayed in the profiler
42 // clang-format off
43 const EnumeratedArray<FlushType, FlushType::Count, const char*>
44 kFlushTypeNames = {
45 "",
46 "Event",
47 "Content",
48 "ContentAndNotify",
49 "Style",
50 // As far as the profiler is concerned, EnsurePresShellInitAndFrames and
51 // Frames are the same
52 "Style",
53 "Style",
54 "InterruptibleLayout",
55 "Layout",
56 "Display"
58 // clang-format on
60 struct ChangesToFlush {
61 ChangesToFlush(FlushType aFlushType, bool aFlushAnimations)
62 : mFlushType(aFlushType), mFlushAnimations(aFlushAnimations) {}
64 FlushType mFlushType;
65 bool mFlushAnimations;
68 } // namespace mozilla
70 #endif // mozilla_FlushType_h