Bug 1789034 - Rename ShrinkWidthToFit to ShrinkISizeToFit. r=emilio
This method already works in logical coordinates. We should name it correctly. Differential Revision: https://phabricator.services.mozilla.com/D156356
This commit is contained in:
@@ -918,7 +918,7 @@ LogicalSize nsContainerFrame::ComputeAutoSize(
|
|||||||
: StylePosition()->ISize(aWM);
|
: StylePosition()->ISize(aWM);
|
||||||
if (styleISize.IsAuto()) {
|
if (styleISize.IsAuto()) {
|
||||||
result.ISize(aWM) =
|
result.ISize(aWM) =
|
||||||
ShrinkWidthToFit(aRenderingContext, availBased, aFlags);
|
ShrinkISizeToFit(aRenderingContext, availBased, aFlags);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
result.ISize(aWM) = availBased;
|
result.ISize(aWM) = availBased;
|
||||||
|
|||||||
@@ -6590,12 +6590,12 @@ LogicalSize nsIFrame::ComputeAutoSize(
|
|||||||
if (styleISize.IsAuto()) {
|
if (styleISize.IsAuto()) {
|
||||||
nscoord availBased =
|
nscoord availBased =
|
||||||
aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM);
|
aAvailableISize - aMargin.ISize(aWM) - aBorderPadding.ISize(aWM);
|
||||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased, aFlags);
|
result.ISize(aWM) = ShrinkISizeToFit(aRenderingContext, availBased, aFlags);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
nscoord nsIFrame::ShrinkWidthToFit(gfxContext* aRenderingContext,
|
nscoord nsIFrame::ShrinkISizeToFit(gfxContext* aRenderingContext,
|
||||||
nscoord aISizeInCB,
|
nscoord aISizeInCB,
|
||||||
ComputeSizeFlags aFlags) {
|
ComputeSizeFlags aFlags) {
|
||||||
// If we're a container for font size inflation, then shrink
|
// If we're a container for font size inflation, then shrink
|
||||||
|
|||||||
@@ -2748,7 +2748,7 @@ class nsIFrame : public nsQueryFrame {
|
|||||||
* Utility function for ComputeAutoSize implementations. Return
|
* Utility function for ComputeAutoSize implementations. Return
|
||||||
* max(GetMinISize(), min(aISizeInCB, GetPrefISize()))
|
* max(GetMinISize(), min(aISizeInCB, GetPrefISize()))
|
||||||
*/
|
*/
|
||||||
nscoord ShrinkWidthToFit(gfxContext* aRenderingContext, nscoord aISizeInCB,
|
nscoord ShrinkISizeToFit(gfxContext* aRenderingContext, nscoord aISizeInCB,
|
||||||
mozilla::ComputeSizeFlags aFlags);
|
mozilla::ComputeSizeFlags aFlags);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -1466,7 +1466,7 @@ nscoord nsTableFrame::TableShrinkISizeToFit(gfxContext* aRenderingContext,
|
|||||||
// Tables shrink inline-size to fit with a slightly different algorithm
|
// Tables shrink inline-size to fit with a slightly different algorithm
|
||||||
// from the one they use for their intrinsic isize (the difference
|
// from the one they use for their intrinsic isize (the difference
|
||||||
// relates to handling of percentage isizes on columns). So this
|
// relates to handling of percentage isizes on columns). So this
|
||||||
// function differs from nsIFrame::ShrinkWidthToFit by only the
|
// function differs from nsIFrame::ShrinkISizeToFit by only the
|
||||||
// following line.
|
// following line.
|
||||||
// Since we've already called GetMinISize, we don't need to do any
|
// Since we've already called GetMinISize, we don't need to do any
|
||||||
// of the other stuff GetPrefISize does.
|
// of the other stuff GetPrefISize does.
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ class nsTableFrame : public nsContainerFrame {
|
|||||||
mozilla::ComputeSizeFlags aFlags) override;
|
mozilla::ComputeSizeFlags aFlags) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A copy of nsIFrame::ShrinkWidthToFit that calls a different
|
* A copy of nsIFrame::ShrinkISizeToFit that calls a different
|
||||||
* GetPrefISize, since tables have two different ones.
|
* GetPrefISize, since tables have two different ones.
|
||||||
*/
|
*/
|
||||||
nscoord TableShrinkISizeToFit(gfxContext* aRenderingContext,
|
nscoord TableShrinkISizeToFit(gfxContext* aRenderingContext,
|
||||||
|
|||||||
Reference in New Issue
Block a user