зеркало из https://github.com/mozilla/pjs.git
relanding fix for bug 265165 because it wasn't the source of Tp/Tdhtml regression
This commit is contained in:
Родитель
4be4d2d0b0
Коммит
fc63af3f2a
|
@ -1173,8 +1173,10 @@ nsGrid::GetMaxRowHeight(nsBoxLayoutState& aState, PRInt32 aIndex, nscoord& aSize
|
|||
if (!isCollapsed)
|
||||
{
|
||||
nsSize childSize(0,0);
|
||||
|
||||
child->GetMaxSize(aState, childSize);
|
||||
nsSize min(0,0);
|
||||
child->GetMinSize(aState, min);
|
||||
nsBox::BoundsCheckMinMax(min, childSize);
|
||||
|
||||
nsSprocketLayout::AddLargestSize(size, childSize, aIsHorizontal);
|
||||
}
|
||||
|
|
|
@ -1010,6 +1010,11 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
|
|||
aSize.width = min;
|
||||
widthSet = PR_TRUE;
|
||||
}
|
||||
} else if (position->mMinWidth.GetUnit() == eStyleUnit_Percent) {
|
||||
float min = position->mMinWidth.GetPercentValue();
|
||||
NS_ASSERTION(min == 0.0f, "Non-zero percentage values not currently supported");
|
||||
aSize.width = 0;
|
||||
widthSet = PR_TRUE;
|
||||
}
|
||||
|
||||
if (position->mMinHeight.GetUnit() == eStyleUnit_Coord) {
|
||||
|
@ -1018,6 +1023,11 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize)
|
|||
aSize.height = min;
|
||||
heightSet = PR_TRUE;
|
||||
}
|
||||
} else if (position->mMinHeight.GetUnit() == eStyleUnit_Percent) {
|
||||
float min = position->mMinHeight.GetPercentValue();
|
||||
NS_ASSERTION(min == 0.0f, "Non-zero percentage values not currently supported");
|
||||
aSize.height = 0;
|
||||
heightSet = PR_TRUE;
|
||||
}
|
||||
|
||||
nsIContent* content = aBox->GetContent();
|
||||
|
@ -1228,8 +1238,8 @@ nsBox::AddInset(nsIBox* aBox, nsSize& aSize)
|
|||
void
|
||||
nsBox::BoundsCheck(nscoord& aMin, nscoord& aPref, nscoord& aMax)
|
||||
{
|
||||
if (aMin > aMax)
|
||||
aMin = aMax;
|
||||
if (aMax < aMin)
|
||||
aMax = aMin;
|
||||
|
||||
if (aPref > aMax)
|
||||
aPref = aMax;
|
||||
|
@ -1238,6 +1248,17 @@ nsBox::BoundsCheck(nscoord& aMin, nscoord& aPref, nscoord& aMax)
|
|||
aPref = aMin;
|
||||
}
|
||||
|
||||
void
|
||||
nsBox::BoundsCheckMinMax(nsSize& aMinSize, nsSize& aMaxSize)
|
||||
{
|
||||
if (aMaxSize.width < aMinSize.width) {
|
||||
aMaxSize.width = aMinSize.width;
|
||||
}
|
||||
|
||||
if (aMaxSize.height < aMinSize.height)
|
||||
aMaxSize.height = aMinSize.height;
|
||||
}
|
||||
|
||||
void
|
||||
nsBox::BoundsCheck(nsSize& aMinSize, nsSize& aPrefSize, nsSize& aMaxSize)
|
||||
{
|
||||
|
|
|
@ -133,6 +133,7 @@ rollbox.
|
|||
static void AddMargin(nsIBox* aChild, nsSize& aSize);
|
||||
static void AddMargin(nsSize& aSize, const nsMargin& aMargin);
|
||||
|
||||
static void BoundsCheckMinMax(nsSize& aMinSize, nsSize& aMaxSize);
|
||||
static void BoundsCheck(nsSize& aMinSize, nsSize& aPrefSize, nsSize& aMaxSize);
|
||||
static void BoundsCheck(nscoord& aMinSize, nscoord& aPrefSize, nscoord& aMaxSize);
|
||||
|
||||
|
|
|
@ -514,7 +514,9 @@ nsSprocketLayout::Layout(nsIBox* aBox, nsBoxLayoutState& aState)
|
|||
if (sizeChanged) {
|
||||
// Our size is different. Sanity check against our maximum allowed size to ensure
|
||||
// we didn't exceed it.
|
||||
child->GetMinSize(aState, minSize);
|
||||
child->GetMaxSize(aState, maxSize);
|
||||
nsBox::BoundsCheckMinMax(minSize, maxSize);
|
||||
|
||||
// make sure the size is in our max size.
|
||||
if (childRect.width > maxSize.width)
|
||||
|
@ -1037,7 +1039,10 @@ nsSprocketLayout::ChildResized(nsIBox* aBox,
|
|||
// so we will set the changed index to be us. And signal that we need a new pass.
|
||||
|
||||
nsSize max(0,0);
|
||||
nsSize min(0,0);
|
||||
aChild->GetMaxSize(aState, max);
|
||||
aChild->GetMinSize(aState, max);
|
||||
nsBox::BoundsCheckMinMax(min, max);
|
||||
AddMargin(aChild, max);
|
||||
|
||||
if (isHorizontal)
|
||||
|
@ -1072,7 +1077,10 @@ nsSprocketLayout::ChildResized(nsIBox* aBox,
|
|||
|
||||
if (childActualWidth > childLayoutWidth) {
|
||||
nsSize max(0,0);
|
||||
nsSize min(0,0);
|
||||
aChild->GetMinSize(aState, min);
|
||||
aChild->GetMaxSize(aState, max);
|
||||
nsBox::BoundsCheckMinMax(min, max);
|
||||
AddMargin(aChild, max);
|
||||
|
||||
// our width now becomes the new size
|
||||
|
@ -1467,7 +1475,10 @@ nsSprocketLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSi
|
|||
{
|
||||
// if completely redefined don't even ask our child for its size.
|
||||
nsSize max(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
nsSize min(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
child->GetMaxSize(aState, max);
|
||||
child->GetMinSize(aState, min);
|
||||
nsBox::BoundsCheckMinMax(min, max);
|
||||
|
||||
AddMargin(child, max);
|
||||
AddSmallestSize(aSize, max, isHorizontal);
|
||||
|
|
|
@ -148,6 +148,9 @@ nsStackLayout::GetMaxSize(nsIBox* aBox, nsBoxLayoutState& aState, nsSize& aSize)
|
|||
while (child) {
|
||||
nsSize max(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
child->GetMaxSize(aState, max);
|
||||
nsSize min(NS_INTRINSICSIZE, NS_INTRINSICSIZE);
|
||||
child->GetMinSize(aState, min);
|
||||
nsBox::BoundsCheckMinMax(min, max);
|
||||
|
||||
AddMargin(child, max);
|
||||
AddOffset(aState, child, max);
|
||||
|
|
|
@ -707,6 +707,8 @@ grippy {
|
|||
.tree-splitter {
|
||||
width: 0px;
|
||||
max-width: 0px;
|
||||
min-width: 0% ! important;
|
||||
min-height: 0% ! important;
|
||||
-moz-box-ordinal-group: 2147483646;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче