From 0e3edb584a7789dc19b773fe80d3d33637a4ea42 Mon Sep 17 00:00:00 2001 From: Stephen Pohl Date: Sun, 26 May 2013 15:00:17 -0700 Subject: [PATCH] Back out bug 869314 for missing r='s. --- gfx/src/nsThemeConstants.h | 3 -- layout/forms/nsComboboxControlFrame.cpp | 18 +++------ layout/forms/test/Makefile.in | 1 - layout/forms/test/test_bug869314.html | 54 ------------------------- layout/generic/nsGfxScrollFrame.cpp | 34 ---------------- layout/generic/nsGfxScrollFrame.h | 11 ----- layout/generic/nsIScrollableFrame.h | 6 +-- widget/cocoa/nsNativeThemeCocoa.mm | 5 --- 8 files changed, 6 insertions(+), 126 deletions(-) delete mode 100644 layout/forms/test/test_bug869314.html diff --git a/gfx/src/nsThemeConstants.h b/gfx/src/nsThemeConstants.h index 8e11e8af206..0f6fdc9311d 100644 --- a/gfx/src/nsThemeConstants.h +++ b/gfx/src/nsThemeConstants.h @@ -157,9 +157,6 @@ #define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL 88 #define NS_THEME_SCROLLBAR_THUMB_VERTICAL 89 -// A non-disappearing scrollbar. -#define NS_THEME_SCROLLBAR_NON_DISAPPEARING 90 - // A textfield or text area #define NS_THEME_TEXTFIELD 95 diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp index 3edd8c98aee..2bd08d56cfb 100644 --- a/layout/forms/nsComboboxControlFrame.cpp +++ b/layout/forms/nsComboboxControlFrame.cpp @@ -56,7 +56,6 @@ #include "mozilla/Likely.h" #include #include "nsTextNode.h" -#include "mozilla/LookAndFeel.h" using namespace mozilla; @@ -739,8 +738,8 @@ nsComboboxControlFrame::GetIntrinsicWidth(nsRenderingContext* aRenderingContext, if (mListControlFrame) { nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame); NS_ASSERTION(scrollable, "List must be a scrollable frame"); - scrollbarWidth = scrollable->GetNondisappearingScrollbarWidth( - presContext, aRenderingContext); + scrollbarWidth = + scrollable->GetDesiredScrollbarSizes(presContext, aRenderingContext).LeftRight(); } nscoord displayWidth = 0; @@ -752,19 +751,11 @@ nsComboboxControlFrame::GetIntrinsicWidth(nsRenderingContext* aRenderingContext, if (mDropdownFrame) { nscoord dropdownContentWidth; - bool isUsingOverlayScrollbars = - LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0; if (aType == nsLayoutUtils::MIN_WIDTH) { dropdownContentWidth = mDropdownFrame->GetMinWidth(aRenderingContext); - if (isUsingOverlayScrollbars) { - dropdownContentWidth += scrollbarWidth; - } } else { NS_ASSERTION(aType == nsLayoutUtils::PREF_WIDTH, "Unexpected type"); dropdownContentWidth = mDropdownFrame->GetPrefWidth(aRenderingContext); - if (isUsingOverlayScrollbars) { - dropdownContentWidth += scrollbarWidth; - } } dropdownContentWidth = NSCoordSaturatingSubtract(dropdownContentWidth, scrollbarWidth, @@ -859,8 +850,9 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext, else { nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame); NS_ASSERTION(scrollable, "List must be a scrollable frame"); - buttonWidth = scrollable->GetNondisappearingScrollbarWidth( - PresContext(), aReflowState.rendContext); + buttonWidth = + scrollable->GetDesiredScrollbarSizes(PresContext(), + aReflowState.rendContext).LeftRight(); if (buttonWidth > aReflowState.ComputedWidth()) { buttonWidth = 0; } diff --git a/layout/forms/test/Makefile.in b/layout/forms/test/Makefile.in index c7c91b119f7..7e5f80895ee 100644 --- a/layout/forms/test/Makefile.in +++ b/layout/forms/test/Makefile.in @@ -43,7 +43,6 @@ MOCHITEST_FILES = test_bug231389.html \ test_bug644542.html \ test_bug672810.html \ test_bug704049.html \ - test_bug869314.html \ test_listcontrol_search.html \ $(NULL) diff --git a/layout/forms/test/test_bug869314.html b/layout/forms/test/test_bug869314.html deleted file mode 100644 index 9116884d66f..00000000000 --- a/layout/forms/test/test_bug869314.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - Test for Bug 869314 - - - - - - - -Mozilla Bug 869314 -

-
- - - - - - - -
-
-
- - diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp index f6333dc1157..6bb36924331 100644 --- a/layout/generic/nsGfxScrollFrame.cpp +++ b/layout/generic/nsGfxScrollFrame.cpp @@ -932,40 +932,6 @@ nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aState) return result; } -nscoord -nsGfxScrollFrameInner::GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState) -{ - NS_ASSERTION(aState && aState->GetRenderingContext(), - "Must have rendering context in layout state for size " - "computations"); - - if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) { - // We're using overlay scrollbars, so we need to get the width that - // non-disappearing scrollbars would have. - nsITheme* theme = aState->PresContext()->GetTheme(); - if (theme && - theme->ThemeSupportsWidget(aState->PresContext(), - mVScrollbarBox, - NS_THEME_SCROLLBAR_NON_DISAPPEARING)) { - nsIntSize size; - nsRenderingContext* rendContext = aState->GetRenderingContext(); - if (rendContext) { - bool canOverride = true; - theme->GetMinimumWidgetSize(rendContext, - mVScrollbarBox, - NS_THEME_SCROLLBAR_NON_DISAPPEARING, - &size, - &canOverride); - if (size.width) { - return aState->PresContext()->DevPixelsToAppUnits(size.width); - } - } - } - } - - return GetDesiredScrollbarSizes(aState).LeftRight(); -} - nsresult nsXULScrollFrame::CreateAnonymousContent(nsTArray& aElements) { diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h index ca4d274ed01..38dd5d6b3c2 100644 --- a/layout/generic/nsGfxScrollFrame.h +++ b/layout/generic/nsGfxScrollFrame.h @@ -235,7 +235,6 @@ public: } nsMargin GetActualScrollbarSizes() const; nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState); - nscoord GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState); bool IsLTR() const; bool IsScrollbarOnRight() const; bool IsScrollingActive() const { return mScrollingActive || ShouldBuildLayer(); } @@ -487,11 +486,6 @@ public: nsBoxLayoutState bls(aPresContext, aRC, 0); return GetDesiredScrollbarSizes(&bls); } - virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, - nsRenderingContext* aRC) MOZ_OVERRIDE { - nsBoxLayoutState bls(aPresContext, aRC, 0); - return mInner.GetNondisappearingScrollbarWidth(&bls); - } virtual nsRect GetScrollPortRect() const MOZ_OVERRIDE { return mInner.GetScrollPortRect(); } @@ -750,11 +744,6 @@ public: nsBoxLayoutState bls(aPresContext, aRC, 0); return GetDesiredScrollbarSizes(&bls); } - virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, - nsRenderingContext* aRC) MOZ_OVERRIDE { - nsBoxLayoutState bls(aPresContext, aRC, 0); - return mInner.GetNondisappearingScrollbarWidth(&bls); - } virtual nsRect GetScrollPortRect() const MOZ_OVERRIDE { return mInner.GetScrollPortRect(); } diff --git a/layout/generic/nsIScrollableFrame.h b/layout/generic/nsIScrollableFrame.h index b149b510dcc..725d5f51c4d 100644 --- a/layout/generic/nsIScrollableFrame.h +++ b/layout/generic/nsIScrollableFrame.h @@ -81,11 +81,7 @@ public: */ virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext, nsRenderingContext* aRC) = 0; - /** - * Return the width for non-disappearing scrollbars. - */ - virtual nscoord GetNondisappearingScrollbarWidth(nsPresContext* aPresContext, - nsRenderingContext* aRC) = 0; + /** * Get the area of the scrollport relative to the origin of this frame's * border-box. diff --git a/widget/cocoa/nsNativeThemeCocoa.mm b/widget/cocoa/nsNativeThemeCocoa.mm index 4a2760a3c58..ae11394f6d6 100644 --- a/widget/cocoa/nsNativeThemeCocoa.mm +++ b/widget/cocoa/nsNativeThemeCocoa.mm @@ -2846,11 +2846,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsRenderingContext* aContext, aResult->SizeTo(16, 16); break; } - // Intentional fallthrough to next case. - } - case NS_THEME_SCROLLBAR_NON_DISAPPEARING: - { // yeah, i know i'm cheating a little here, but i figure that it // really doesn't matter if the scrollbar is vertical or horizontal // and the width metric is a really good metric for every piece @@ -3060,7 +3056,6 @@ nsNativeThemeCocoa::ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* a case NS_THEME_SCROLLBAR_THUMB_VERTICAL: case NS_THEME_SCROLLBAR_TRACK_VERTICAL: case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL: - case NS_THEME_SCROLLBAR_NON_DISAPPEARING: case NS_THEME_DROPDOWN: case NS_THEME_DROPDOWN_BUTTON: