diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /layout/xul | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-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/xul')
-rw-r--r-- | layout/xul/nsMenuPopupFrame.cpp | 20 | ||||
-rw-r--r-- | layout/xul/nsXULPopupManager.cpp | 1 | ||||
-rw-r--r-- | layout/xul/tree/nsTreeBodyFrame.cpp | 2 |
3 files changed, 12 insertions, 11 deletions
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp index 8ebb8b01d5..17993c8466 100644 --- a/layout/xul/nsMenuPopupFrame.cpp +++ b/layout/xul/nsMenuPopupFrame.cpp @@ -491,19 +491,13 @@ void nsMenuPopupFrame::TweakMinPrefISize(nscoord& aSize) { } nscoord nsMenuPopupFrame::GetMinISize(gfxContext* aRC) { - nscoord result; - DISPLAY_PREF_INLINE_SIZE(this, result); - - result = nsBlockFrame::GetMinISize(aRC); + nscoord result = nsBlockFrame::GetMinISize(aRC); TweakMinPrefISize(result); return result; } nscoord nsMenuPopupFrame::GetPrefISize(gfxContext* aRC) { - nscoord result; - DISPLAY_PREF_INLINE_SIZE(this, result); - - result = nsBlockFrame::GetPrefISize(aRC); + nscoord result = nsBlockFrame::GetPrefISize(aRC); TweakMinPrefISize(result); return result; } @@ -514,7 +508,6 @@ void nsMenuPopupFrame::Reflow(nsPresContext* aPresContext, nsReflowStatus& aStatus) { MarkInReflow(); DO_GLOBAL_REFLOW_COUNT("nsMenuPopupFrame"); - DISPLAY_REFLOW(aPresContext, this, aReflowInput, aDesiredSize, aStatus); MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!"); const auto wm = GetWritingMode(); @@ -2186,6 +2179,12 @@ nsMargin nsMenuPopupFrame::GetMargin() const { margin.left += auOffset.x; margin.right += auOffset.x; } + if (mPopupType == PopupType::Tooltip && !IsAnchored()) { + const auto auOffset = + CSSPixel::ToAppUnits(LookAndFeel::TooltipOffsetVertical()); + margin.top += auOffset; + margin.bottom += auOffset; + } return margin; } @@ -2246,7 +2245,8 @@ void nsMenuPopupFrame::MoveTo(const CSSPoint& aPos, bool aUpdateAttrs, void nsMenuPopupFrame::MoveToAnchor(nsIContent* aAnchorContent, const nsAString& aPosition, int32_t aXPos, int32_t aYPos, bool aAttributesOverride) { - NS_ASSERTION(IsVisible(), "popup must be visible to move it"); + NS_ASSERTION(IsVisibleOrShowing(), + "popup must be visible or showing to move it"); nsPopupState oldstate = mPopupState; InitializePopup(aAnchorContent, mTriggerContent, aPosition, aXPos, aYPos, diff --git a/layout/xul/nsXULPopupManager.cpp b/layout/xul/nsXULPopupManager.cpp index 332d60d363..a6dbeadca7 100644 --- a/layout/xul/nsXULPopupManager.cpp +++ b/layout/xul/nsXULPopupManager.cpp @@ -49,6 +49,7 @@ #include "mozilla/dom/XULMenuElement.h" #include "mozilla/dom/XULMenuBarElement.h" #include "mozilla/dom/XULPopupElement.h" +#include "mozilla/AutoRestore.h" #include "mozilla/EventDispatcher.h" #include "mozilla/EventStateManager.h" #include "mozilla/LookAndFeel.h" diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index 5ccc1468cc..f585009600 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -3895,7 +3895,7 @@ void nsTreeBodyFrame::RemoveImageCacheEntry(int32_t aRowIndex, nsTreeColumn* aCol) { nsAutoString imageSrc; nsCOMPtr<nsITreeView> view = GetExistingView(); - if (NS_FAILED(view->GetImageSrc(aRowIndex, aCol, imageSrc))) { + if (!view || NS_FAILED(view->GetImageSrc(aRowIndex, aCol, imageSrc))) { return; } nsTreeImageCacheEntry entry; |