зеркало из https://github.com/mozilla/gecko-dev.git
Back out bug 869314 for missing r='s.
This commit is contained in:
Родитель
956f3e72e5
Коммит
5f012bbde6
|
@ -157,9 +157,6 @@
|
||||||
#define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL 88
|
#define NS_THEME_SCROLLBAR_THUMB_HORIZONTAL 88
|
||||||
#define NS_THEME_SCROLLBAR_THUMB_VERTICAL 89
|
#define NS_THEME_SCROLLBAR_THUMB_VERTICAL 89
|
||||||
|
|
||||||
// A non-disappearing scrollbar.
|
|
||||||
#define NS_THEME_SCROLLBAR_NON_DISAPPEARING 90
|
|
||||||
|
|
||||||
// A textfield or text area
|
// A textfield or text area
|
||||||
#define NS_THEME_TEXTFIELD 95
|
#define NS_THEME_TEXTFIELD 95
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
#include "mozilla/Likely.h"
|
#include "mozilla/Likely.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include "nsTextNode.h"
|
#include "nsTextNode.h"
|
||||||
#include "mozilla/LookAndFeel.h"
|
|
||||||
|
|
||||||
using namespace mozilla;
|
using namespace mozilla;
|
||||||
|
|
||||||
|
@ -739,8 +738,8 @@ nsComboboxControlFrame::GetIntrinsicWidth(nsRenderingContext* aRenderingContext,
|
||||||
if (mListControlFrame) {
|
if (mListControlFrame) {
|
||||||
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
||||||
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
||||||
scrollbarWidth = scrollable->GetNondisappearingScrollbarWidth(
|
scrollbarWidth =
|
||||||
presContext, aRenderingContext);
|
scrollable->GetDesiredScrollbarSizes(presContext, aRenderingContext).LeftRight();
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord displayWidth = 0;
|
nscoord displayWidth = 0;
|
||||||
|
@ -752,19 +751,11 @@ nsComboboxControlFrame::GetIntrinsicWidth(nsRenderingContext* aRenderingContext,
|
||||||
|
|
||||||
if (mDropdownFrame) {
|
if (mDropdownFrame) {
|
||||||
nscoord dropdownContentWidth;
|
nscoord dropdownContentWidth;
|
||||||
bool isUsingOverlayScrollbars =
|
|
||||||
LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0;
|
|
||||||
if (aType == nsLayoutUtils::MIN_WIDTH) {
|
if (aType == nsLayoutUtils::MIN_WIDTH) {
|
||||||
dropdownContentWidth = mDropdownFrame->GetMinWidth(aRenderingContext);
|
dropdownContentWidth = mDropdownFrame->GetMinWidth(aRenderingContext);
|
||||||
if (isUsingOverlayScrollbars) {
|
|
||||||
dropdownContentWidth += scrollbarWidth;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
NS_ASSERTION(aType == nsLayoutUtils::PREF_WIDTH, "Unexpected type");
|
NS_ASSERTION(aType == nsLayoutUtils::PREF_WIDTH, "Unexpected type");
|
||||||
dropdownContentWidth = mDropdownFrame->GetPrefWidth(aRenderingContext);
|
dropdownContentWidth = mDropdownFrame->GetPrefWidth(aRenderingContext);
|
||||||
if (isUsingOverlayScrollbars) {
|
|
||||||
dropdownContentWidth += scrollbarWidth;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
dropdownContentWidth = NSCoordSaturatingSubtract(dropdownContentWidth,
|
dropdownContentWidth = NSCoordSaturatingSubtract(dropdownContentWidth,
|
||||||
scrollbarWidth,
|
scrollbarWidth,
|
||||||
|
@ -859,8 +850,9 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
||||||
else {
|
else {
|
||||||
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
nsIScrollableFrame* scrollable = do_QueryFrame(mListControlFrame);
|
||||||
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
||||||
buttonWidth = scrollable->GetNondisappearingScrollbarWidth(
|
buttonWidth =
|
||||||
PresContext(), aReflowState.rendContext);
|
scrollable->GetDesiredScrollbarSizes(PresContext(),
|
||||||
|
aReflowState.rendContext).LeftRight();
|
||||||
if (buttonWidth > aReflowState.ComputedWidth()) {
|
if (buttonWidth > aReflowState.ComputedWidth()) {
|
||||||
buttonWidth = 0;
|
buttonWidth = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,6 @@ MOCHITEST_FILES = test_bug231389.html \
|
||||||
test_bug644542.html \
|
test_bug644542.html \
|
||||||
test_bug672810.html \
|
test_bug672810.html \
|
||||||
test_bug704049.html \
|
test_bug704049.html \
|
||||||
test_bug869314.html \
|
|
||||||
test_listcontrol_search.html \
|
test_listcontrol_search.html \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
|
@ -932,40 +932,6 @@ nsGfxScrollFrameInner::GetDesiredScrollbarSizes(nsBoxLayoutState* aState)
|
||||||
return result;
|
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
|
nsresult
|
||||||
nsXULScrollFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
nsXULScrollFrame::CreateAnonymousContent(nsTArray<ContentInfo>& aElements)
|
||||||
{
|
{
|
||||||
|
|
|
@ -235,7 +235,6 @@ public:
|
||||||
}
|
}
|
||||||
nsMargin GetActualScrollbarSizes() const;
|
nsMargin GetActualScrollbarSizes() const;
|
||||||
nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState);
|
nsMargin GetDesiredScrollbarSizes(nsBoxLayoutState* aState);
|
||||||
nscoord GetNondisappearingScrollbarWidth(nsBoxLayoutState* aState);
|
|
||||||
bool IsLTR() const;
|
bool IsLTR() const;
|
||||||
bool IsScrollbarOnRight() const;
|
bool IsScrollbarOnRight() const;
|
||||||
bool IsScrollingActive() const { return mScrollingActive || ShouldBuildLayer(); }
|
bool IsScrollingActive() const { return mScrollingActive || ShouldBuildLayer(); }
|
||||||
|
@ -487,11 +486,6 @@ public:
|
||||||
nsBoxLayoutState bls(aPresContext, aRC, 0);
|
nsBoxLayoutState bls(aPresContext, aRC, 0);
|
||||||
return GetDesiredScrollbarSizes(&bls);
|
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 {
|
virtual nsRect GetScrollPortRect() const MOZ_OVERRIDE {
|
||||||
return mInner.GetScrollPortRect();
|
return mInner.GetScrollPortRect();
|
||||||
}
|
}
|
||||||
|
@ -750,11 +744,6 @@ public:
|
||||||
nsBoxLayoutState bls(aPresContext, aRC, 0);
|
nsBoxLayoutState bls(aPresContext, aRC, 0);
|
||||||
return GetDesiredScrollbarSizes(&bls);
|
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 {
|
virtual nsRect GetScrollPortRect() const MOZ_OVERRIDE {
|
||||||
return mInner.GetScrollPortRect();
|
return mInner.GetScrollPortRect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,11 +81,7 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext,
|
virtual nsMargin GetDesiredScrollbarSizes(nsPresContext* aPresContext,
|
||||||
nsRenderingContext* aRC) = 0;
|
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
|
* Get the area of the scrollport relative to the origin of this frame's
|
||||||
* border-box.
|
* border-box.
|
||||||
|
|
|
@ -2846,11 +2846,7 @@ nsNativeThemeCocoa::GetMinimumWidgetSize(nsRenderingContext* aContext,
|
||||||
aResult->SizeTo(16, 16);
|
aResult->SizeTo(16, 16);
|
||||||
break;
|
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
|
// 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
|
// really doesn't matter if the scrollbar is vertical or horizontal
|
||||||
// and the width metric is a really good metric for every piece
|
// 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_THUMB_VERTICAL:
|
||||||
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
|
case NS_THEME_SCROLLBAR_TRACK_VERTICAL:
|
||||||
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
|
case NS_THEME_SCROLLBAR_TRACK_HORIZONTAL:
|
||||||
case NS_THEME_SCROLLBAR_NON_DISAPPEARING:
|
|
||||||
|
|
||||||
case NS_THEME_DROPDOWN:
|
case NS_THEME_DROPDOWN:
|
||||||
case NS_THEME_DROPDOWN_BUTTON:
|
case NS_THEME_DROPDOWN_BUTTON:
|
||||||
|
|
Загрузка…
Ссылка в новой задаче