From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/generic/TextOverflow.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'layout/generic/TextOverflow.cpp') diff --git a/layout/generic/TextOverflow.cpp b/layout/generic/TextOverflow.cpp index f529a2268d..758b61a99b 100644 --- a/layout/generic/TextOverflow.cpp +++ b/layout/generic/TextOverflow.cpp @@ -29,8 +29,7 @@ using mozilla::layout::TextDrawTarget; -namespace mozilla { -namespace css { +namespace mozilla::css { class LazyReferenceRenderingDrawTargetGetterFromFrame final : public gfxFontGroup::LazyReferenceDrawTargetGetter { @@ -165,8 +164,7 @@ class nsDisplayTextOverflowMarker final : public nsPaintedDisplayItem { virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) const override { *aSnap = false; - nsRect shadowRect = nsLayoutUtils::GetTextShadowRectsUnion(mRect, mFrame); - return mRect.Union(shadowRect); + return nsLayoutUtils::GetTextShadowRectsUnion(mRect, mFrame); } virtual nsRect GetComponentAlphaBounds( @@ -835,9 +833,10 @@ bool TextOverflow::CanHaveOverflowMarkers(nsBlockFrame* aBlockFrame, return false; } - // Skip ComboboxControlFrame because it would clip the drop-down arrow. - // Its anon block inherits 'text-overflow' and does what is expected. - if (aBlockFrame->IsComboboxControlFrame()) { + // Skip the combobox anonymous block because it would clip the drop-down + // arrow. The inner label inherits 'text-overflow' and does the right thing. + if (aBlockFrame->GetParent() && + aBlockFrame->GetParent()->IsComboboxControlFrame()) { return false; } @@ -932,5 +931,4 @@ void TextOverflow::Marker::SetupString(nsIFrame* aFrame) { mInitialized = true; } -} // namespace css -} // namespace mozilla +} // namespace mozilla::css -- cgit v1.2.3