summaryrefslogtreecommitdiffstats
path: root/dom/base/FlushType.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/base/FlushType.h
parentInitial commit. (diff)
downloadfirefox-esr-upstream.tar.xz
firefox-esr-upstream.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/FlushType.h')
-rw-r--r--dom/base/FlushType.h70
1 files changed, 70 insertions, 0 deletions
diff --git a/dom/base/FlushType.h b/dom/base/FlushType.h
new file mode 100644
index 0000000000..04a253c534
--- /dev/null
+++ b/dom/base/FlushType.h
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef mozilla_FlushType_h
+#define mozilla_FlushType_h
+
+#include <stdint.h>
+#include "X11UndefineNone.h"
+#include "mozilla/EnumeratedArray.h"
+
+namespace mozilla {
+
+/**
+ * This is the enum used by Document::FlushPendingNotifications to
+ * decide what to flush.
+ *
+ * Please note that if you change these values, you should sync it with the
+ * kFlushTypeNames array below.
+ */
+enum class FlushType : uint8_t {
+ None, /* Actually don't flush anything */
+ Event, /* Flush pending events before notify other observers */
+ Content, /* flush the content model construction */
+ ContentAndNotify, /* As above, plus flush the frame model
+ construction and other nsIMutationObserver
+ notifications. */
+ Style, /* As above, plus flush style reresolution */
+ Frames, /* As above, plus flush frame construction */
+ EnsurePresShellInitAndFrames, /* As above, plus ensure the pres shell is alive
+ */
+ InterruptibleLayout, /* As above, plus flush reflow, but allow it to be
+ interrupted (so an incomplete layout may result) */
+ Layout, /* As above, but layout must run to completion */
+ Display, /* As above, plus flush painting */
+ Count
+};
+
+// Flush type strings that will be displayed in the profiler
+// clang-format off
+const EnumeratedArray<FlushType, FlushType::Count, const char*>
+ kFlushTypeNames = {
+ "",
+ "Event",
+ "Content",
+ "ContentAndNotify",
+ "Style",
+ // As far as the profiler is concerned, EnsurePresShellInitAndFrames and
+ // Frames are the same
+ "Style",
+ "Style",
+ "InterruptibleLayout",
+ "Layout",
+ "Display"
+};
+// clang-format on
+
+struct ChangesToFlush {
+ ChangesToFlush(FlushType aFlushType, bool aFlushAnimations)
+ : mFlushType(aFlushType), mFlushAnimations(aFlushAnimations) {}
+
+ FlushType mFlushType;
+ bool mFlushAnimations;
+};
+
+} // namespace mozilla
+
+#endif // mozilla_FlushType_h