Backed out changeset be3b005bfc6d (bug 1619428) for causing reftest failure in contain-size-select-elem-002-ref.html CLOSED TREE

This commit is contained in:
shindli 2020-03-03 22:15:47 +02:00
Родитель 4783212dfc
Коммит b961822146
11 изменённых файлов: 40 добавлений и 45 удалений

Просмотреть файл

@ -10408,7 +10408,7 @@ nsSize nsFrame::GetXULMinSize(nsBoxLayoutState& aState) {
// get our size in CSS.
bool widthSet, heightSet;
bool completelyRedefined =
nsIFrame::AddXULMinSize(this, size, widthSet, heightSet);
nsIFrame::AddXULMinSize(aState, this, size, widthSet, heightSet);
// Refresh our caches with new sizes.
if (!completelyRedefined) {

Просмотреть файл

@ -1665,7 +1665,7 @@ nsSize nsXULScrollFrame::GetXULMinSize(nsBoxLayoutState& aState) {
AddBorderAndPadding(min);
bool widthSet, heightSet;
nsIFrame::AddXULMinSize(this, min, widthSet, heightSet);
nsIFrame::AddXULMinSize(aState, this, min, widthSet, heightSet);
return min;
}

Просмотреть файл

@ -3848,8 +3848,8 @@ class nsIFrame : public nsQueryFrame {
static bool AddXULPrefSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth,
bool& aHeightSet);
static bool AddXULMinSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth,
bool& aHeightSet);
static bool AddXULMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
nsSize& aSize, bool& aWidth, bool& aHeightSet);
static bool AddXULMaxSize(nsIFrame* aBox, nsSize& aSize, bool& aWidth,
bool& aHeightSet);
static bool AddXULFlex(nsIFrame* aBox, nscoord& aFlex);

Просмотреть файл

@ -796,7 +796,7 @@ nscoord nsGrid::GetMinRowHeight(nsBoxLayoutState& aState, int32_t aIndex,
if (box) {
bool widthSet, heightSet;
nsSize cssSize(-1, -1);
nsIFrame::AddXULMinSize(box, cssSize, widthSet, heightSet);
nsIFrame::AddXULMinSize(aState, box, cssSize, widthSet, heightSet);
row->mMin = GET_HEIGHT(cssSize, aIsHorizontal);

Просмотреть файл

@ -229,7 +229,7 @@ nsSize nsBox::GetXULMinSize(nsBoxLayoutState& aState) {
AddBorderAndPadding(min);
bool widthSet, heightSet;
nsIFrame::AddXULMinSize(this, min, widthSet, heightSet);
nsIFrame::AddXULMinSize(aState, this, min, widthSet, heightSet);
return min;
}
@ -421,30 +421,28 @@ static nscoord GetScrollbarWidthNoTheme(nsIFrame* aBox) {
}
}
bool nsIFrame::AddXULMinSize(nsIFrame* aBox,
bool nsIFrame::AddXULMinSize(nsBoxLayoutState& aState, nsIFrame* aBox,
nsSize& aSize, bool& aWidthSet, bool& aHeightSet) {
aWidthSet = false;
aHeightSet = false;
bool canOverride = true;
nsPresContext* pc = aBox->PresContext();
// See if a native theme wants to supply a minimum size.
const nsStyleDisplay* display = aBox->StyleDisplay();
if (display->HasAppearance()) {
nsITheme* theme = pc->GetTheme();
if (theme && theme->ThemeSupportsWidget(pc, aBox,
nsITheme* theme = aState.PresContext()->GetTheme();
if (theme && theme->ThemeSupportsWidget(aState.PresContext(), aBox,
display->mAppearance)) {
LayoutDeviceIntSize size;
theme->GetMinimumWidgetSize(pc, aBox,
theme->GetMinimumWidgetSize(aState.PresContext(), aBox,
display->mAppearance, &size, &canOverride);
if (size.width) {
aSize.width = pc->DevPixelsToAppUnits(size.width);
aSize.width = aState.PresContext()->DevPixelsToAppUnits(size.width);
aWidthSet = true;
}
if (size.height) {
aSize.height = pc->DevPixelsToAppUnits(size.height);
aSize.height = aState.PresContext()->DevPixelsToAppUnits(size.height);
aHeightSet = true;
}
} else {

Просмотреть файл

@ -606,7 +606,8 @@ nsSize nsBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) {
// if the size was not completely redefined in CSS then ask our children
bool widthSet, heightSet;
if (!nsIFrame::AddXULMinSize(this, size, widthSet, heightSet)) {
if (!nsIFrame::AddXULMinSize(aBoxLayoutState, this, size, widthSet,
heightSet)) {
if (mLayoutManager) {
nsSize layoutSize = mLayoutManager->GetXULMinSize(this, aBoxLayoutState);
if (!widthSet) size.width = layoutSize.width;

Просмотреть файл

@ -736,7 +736,7 @@ nsSize nsImageBoxFrame::GetXULMinSize(nsBoxLayoutState& aState) {
DISPLAY_MIN_SIZE(this, size);
AddBorderAndPadding(size);
bool widthSet, heightSet;
nsIFrame::AddXULMinSize(this, size, widthSet, heightSet);
nsIFrame::AddXULMinSize(aState, this, size, widthSet, heightSet);
return size;
}

Просмотреть файл

@ -163,47 +163,39 @@ nsIScrollbarMediator* nsScrollbarFrame::GetScrollbarMediator() {
}
nsresult nsScrollbarFrame::GetXULMargin(nsMargin& aMargin) {
nsresult rv = NS_ERROR_FAILURE;
aMargin.SizeTo(0, 0, 0, 0);
const bool overlayScrollbars =
!!LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars);
const bool horizontal = IsXULHorizontal();
bool didSetMargin = false;
if (overlayScrollbars) {
nsSize minSize;
bool widthSet = false;
bool heightSet = false;
AddXULMinSize(this, minSize, widthSet, heightSet);
if (horizontal) {
if (heightSet) {
aMargin.top = -minSize.height;
didSetMargin = true;
}
} else {
if (widthSet) {
aMargin.left = -minSize.width;
didSetMargin = true;
if (LookAndFeel::GetInt(LookAndFeel::eIntID_UseOverlayScrollbars) != 0) {
nsPresContext* presContext = PresContext();
nsITheme* theme = presContext->GetTheme();
if (theme && theme->ThemeSupportsWidget(presContext, this,
StyleAppearance::Scrollbar)) {
LayoutDeviceIntSize size;
bool isOverridable;
theme->GetMinimumWidgetSize(presContext, this, StyleAppearance::Scrollbar,
&size, &isOverridable);
if (IsXULHorizontal()) {
aMargin.top = -presContext->DevPixelsToAppUnits(size.height);
} else {
aMargin.left = -presContext->DevPixelsToAppUnits(size.width);
}
rv = NS_OK;
}
}
if (!didSetMargin) {
DebugOnly<nsresult> rv = nsBox::GetXULMargin(aMargin);
// TODO(emilio): Should probably not be fallible, it's not like anybody
// cares about the return value anyway.
MOZ_ASSERT(NS_SUCCEEDED(rv), "nsBox::GetXULMargin can't really fail");
if (NS_FAILED(rv)) {
rv = nsBox::GetXULMargin(aMargin);
}
if (!horizontal) {
if (NS_SUCCEEDED(rv) && !IsXULHorizontal()) {
nsIScrollbarMediator* scrollFrame = GetScrollbarMediator();
if (scrollFrame && !scrollFrame->IsScrollbarOnRight()) {
std::swap(aMargin.left, aMargin.right);
}
}
return NS_OK;
return rv;
}
void nsScrollbarFrame::SetIncrementToLine(int32_t aDirection) {

Просмотреть файл

@ -1080,7 +1080,7 @@ nsSize nsTextBoxFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) {
AddBorderAndPadding(size);
bool widthSet, heightSet;
nsIFrame::AddXULMinSize(this, size, widthSet, heightSet);
nsIFrame::AddXULMinSize(aBoxLayoutState, this, size, widthSet, heightSet);
return size;
}

Просмотреть файл

@ -192,7 +192,7 @@ nsSize nsTreeBodyFrame::GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) {
AddBorderAndPadding(min);
bool widthSet, heightSet;
nsIFrame::AddXULMinSize(this, min, widthSet, heightSet);
nsIFrame::AddXULMinSize(aBoxLayoutState, this, min, widthSet, heightSet);
return min;
}

Просмотреть файл

@ -20,7 +20,10 @@ xul|scrollbar {
display: block;
}
/* Scrollbar code will reset the margin to the correct side depending on
where layout actually puts the scrollbar */
xul|scrollbar[orient="vertical"] {
margin-left: -6px;
min-width: 6px;
max-width: 6px;
}
@ -32,6 +35,7 @@ xul|scrollbar[orient="vertical"] xul|thumb {
}
xul|scrollbar[orient="horizontal"] {
margin-top: -6px;
min-height: 6px;
max-height: 6px;
}