summaryrefslogtreecommitdiffstats
path: root/layout/painting/nsDisplayList.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /layout/painting/nsDisplayList.h
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/painting/nsDisplayList.h')
-rw-r--r--layout/painting/nsDisplayList.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h
index 5064677cc7..acda6ea863 100644
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -659,7 +659,7 @@ class nsDisplayListBuilder {
* Get the frame that the caret is supposed to draw in.
* If the caret is currently invisible, this will be null.
*/
- nsIFrame* GetCaretFrame() { return mCaretFrame; }
+ nsIFrame* GetCaretFrame() { return CurrentPresShellState()->mCaretFrame; }
/**
* Get the rectangle we're supposed to draw the caret into.
*/
@@ -852,9 +852,9 @@ class nsDisplayListBuilder {
/**
* Notifies the builder that a particular themed widget exists
* at the given rectangle within the currently built display list.
- * For certain appearance values (currently only StyleAppearance::Toolbar and
- * StyleAppearance::WindowTitlebar) this gets called during every display list
- * construction, for every themed widget of the right type within the
+ * For certain appearance values (currently only
+ * StyleAppearance::MozWindowTitlebar) this gets called during every display
+ * list construction, for every themed widget of the right type within the
* display list, except for themed widgets which are transformed or have
* effects applied to them (e.g. CSS opacity or filters).
*
@@ -904,6 +904,11 @@ class nsDisplayListBuilder {
const dom::EffectsInfo& aUpdate);
/**
+ * Invalidates the caret frames from previous paints, if they have changed.
+ */
+ void InvalidateCaretFramesIfNeeded();
+
+ /**
* Allocate memory in our arena. It will only be freed when this display list
* builder is destroyed. This memory holds nsDisplayItems and
* DisplayItemClipChain objects.
@@ -1729,6 +1734,7 @@ class nsDisplayListBuilder {
bool mInsidePointerEventsNoneDoc;
bool mTouchEventPrefEnabledDoc;
nsIFrame* mPresShellIgnoreScrollFrame;
+ nsIFrame* mCaretFrame = nullptr;
};
PresShellState* CurrentPresShellState() {
@@ -1763,7 +1769,6 @@ class nsDisplayListBuilder {
// The reference frame for mCurrentFrame.
const nsIFrame* mCurrentReferenceFrame;
- nsIFrame* mCaretFrame;
// A temporary list that we append scroll info items to while building
// display items for the contents of frames with SVG effects.
// Only non-null when ShouldBuildScrollInfoItemsForHoisting() is true.
@@ -1808,6 +1813,9 @@ class nsDisplayListBuilder {
// Stores reusable items collected during display list preprocessing.
nsTHashSet<nsDisplayItem*> mReuseableItems;
+ // Tracked carets used for retained display list.
+ AutoTArray<RefPtr<nsCaret>, 1> mPaintedCarets;
+
// Tracked regions used for retained display list.
WeakFrameRegion mRetainedWindowDraggingRegion;
WeakFrameRegion mRetainedWindowNoDraggingRegion;
@@ -3195,12 +3203,13 @@ class nsDisplayList {
// array of 20 items should be able to avoid a lot of dynamic allocations
// here.
AutoTArray<Item, 20> items;
+ // Ensure we need just one alloc otherwise, no-op if enough.
+ items.SetCapacity(Length());
for (nsDisplayItem* item : TakeItems()) {
items.AppendElement(Item(item));
}
-
- std::stable_sort(items.begin(), items.end(), aComparator);
+ items.StableSort(aComparator);
for (Item& item : items) {
AppendToTop(item);
@@ -3208,6 +3217,7 @@ class nsDisplayList {
}
nsDisplayList TakeItems() {
+ // This std::move makes this a defined empty list, see assignment operator.
nsDisplayList list = std::move(*this);
#ifdef MOZ_DIAGNOSTIC_ASSERT_ENABLED
list.mAllowNonEmptyDestruction = true;