Back out bug 869314 for missing r='s.

This commit is contained in:
Stephen Pohl 2013-05-26 15:00:17 -07:00
parent 956f3e72e5
commit 5f012bbde6
8 changed files with 6 additions and 126 deletions

View File

@ -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

View File

@ -56,7 +56,6 @@
#include "mozilla/Likely.h"
#include <algorithm>
#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;
}

View File

@ -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)

View File

@ -1,54 +0,0 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=869314
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 869314</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<style type="text/css">
.selectbox {
background-color: #00FF00;
}
</style>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=869314">Mozilla Bug 869314</a>
<p id="display"></p>
<div id="content">
<select id="selectbox1" name="non-native selectbox" class="selectbox">
<option value="item">test item</option>
</select>
<select id="selectbox2" name="native selectbox">
<option value="item">test item</option>
</select>
<script type="application/javascript">
var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
var sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
var osName = sysInfo.getProperty("name");
if (osName == "Darwin") { // Mac OS X.
// This test is for Mac only. See bug for more info.
ok(document.getElementById("selectbox1").clientWidth >
document.getElementById("selectbox2").clientWidth,
"Non-native styled combobox does not have enough space for a " +
"dropmarker!");
} else {
// We need to call at least one test function to make the test harness
// happy.
ok(true, "Test wasn't ignored but should have been.");
}
</script>
</div>
<pre id="test">
</pre>
</body>
</html>

View File

@ -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<ContentInfo>& aElements)
{

View File

@ -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();
}

View File

@ -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.

View File

@ -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: