mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 1300369 part 4 - Refactor all ComputeAutoSize methods to take the full ComputeSizeFlags instead of just a "bool aShrinkWrap" for the eShrinkWrap flag (idempotent patch). r=dholbert
This commit is contained in:
parent
6b8c4c8679
commit
e78d14df88
@ -64,14 +64,14 @@ nsFormControlFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsFormControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsFormControlFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
const WritingMode wm = GetWritingMode();
|
||||
LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
|
||||
|
@ -57,14 +57,14 @@ public:
|
||||
* Our auto size is just intrinsic width and intrinsic height.
|
||||
*/
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
/**
|
||||
* Respond to a gui event
|
||||
|
@ -221,14 +221,14 @@ nsMeterFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
}
|
||||
|
||||
LogicalSize
|
||||
nsMeterFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsMeterFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
RefPtr<nsFontMetrics> fontMet =
|
||||
nsLayoutUtils::GetFontMetricsForFrame(this, 1.0f);
|
||||
|
@ -53,14 +53,14 @@ public:
|
||||
int32_t aModType) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||
|
@ -230,14 +230,14 @@ nsProgressFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
}
|
||||
|
||||
LogicalSize
|
||||
nsProgressFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsProgressFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
const WritingMode wm = GetWritingMode();
|
||||
LogicalSize autoSize(wm);
|
||||
|
@ -60,14 +60,14 @@ public:
|
||||
int32_t aModType) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||
|
@ -764,14 +764,14 @@ nsRangeFrame::AttributeChanged(int32_t aNameSpaceID,
|
||||
}
|
||||
|
||||
LogicalSize
|
||||
nsRangeFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsRangeFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
nscoord oneEm = NSToCoordRound(StyleFont()->mFont.size *
|
||||
nsLayoutUtils::FontSizeInflationFor(this)); // 1em
|
||||
|
@ -73,14 +73,14 @@ public:
|
||||
int32_t aModType) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual nscoord GetMinISize(nsRenderingContext *aRenderingContext) override;
|
||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||
|
@ -471,14 +471,14 @@ nsTextControlFrame::GetMinISize(nsRenderingContext* aRenderingContext)
|
||||
}
|
||||
|
||||
LogicalSize
|
||||
nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsTextControlFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
|
||||
LogicalSize autoSize(aWM);
|
||||
@ -497,7 +497,7 @@ nsTextControlFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
nsContainerFrame::ComputeAutoSize(aRenderingContext, aWM,
|
||||
aCBSize, aAvailableISize,
|
||||
aMargin, aBorder,
|
||||
aPadding, aShrinkWrap);
|
||||
aPadding, aFlags);
|
||||
// Disabled when there's inflation; see comment in GetXULPrefSize.
|
||||
MOZ_ASSERT(inflation != 1.0f ||
|
||||
ancestorAutoSize.ISize(aWM) == autoSize.ISize(aWM),
|
||||
|
@ -48,14 +48,14 @@ public:
|
||||
virtual nscoord GetPrefISize(nsRenderingContext* aRenderingContext) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
@ -56,18 +56,18 @@ nsBackdropFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
}
|
||||
|
||||
/* virtual */ LogicalSize
|
||||
nsBackdropFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsBackdropFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
// Note that this frame is a child of the viewport frame.
|
||||
LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE);
|
||||
if (aShrinkWrap) {
|
||||
if (aFlags & ComputeSizeFlags::eShrinkWrap) {
|
||||
result.ISize(aWM) = 0;
|
||||
} else {
|
||||
result.ISize(aWM) = aAvailableISize - aMargin.ISize(aWM) -
|
||||
|
@ -30,14 +30,14 @@ public:
|
||||
const nsRect& aDirtyRect,
|
||||
const nsDisplayListSet& aLists) override;
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
const ReflowInput& aReflowInput,
|
||||
|
@ -921,22 +921,22 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsContainerFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE);
|
||||
nscoord availBased = aAvailableISize - aMargin.ISize(aWM) -
|
||||
aBorder.ISize(aWM) - aPadding.ISize(aWM);
|
||||
// replaced elements always shrink-wrap
|
||||
if (aShrinkWrap || IsFrameOfType(eReplaced)) {
|
||||
if ((aFlags & ComputeSizeFlags::eShrinkWrap) || IsFrameOfType(eReplaced)) {
|
||||
// don't bother setting it if the result won't be used
|
||||
if (StylePosition()->ISize(aWM).GetUnit() == eStyleUnit_Auto) {
|
||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased);
|
||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased, aFlags);
|
||||
}
|
||||
} else {
|
||||
result.ISize(aWM) = availBased;
|
||||
|
@ -234,14 +234,14 @@ public:
|
||||
* classes derived from nsContainerFrame want.
|
||||
*/
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
/**
|
||||
* Positions aChildFrame and its view (if requested), and then calls Reflow().
|
||||
|
@ -4639,14 +4639,14 @@ nsFrame::GetIntrinsicRatio()
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
nsFrame::ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
MOZ_ASSERT(GetIntrinsicRatio() == nsSize(0,0),
|
||||
"Please override this method and call "
|
||||
@ -4654,7 +4654,7 @@ nsFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
LogicalSize result = ComputeAutoSize(aRenderingContext, aWM,
|
||||
aCBSize, aAvailableISize,
|
||||
aMargin, aBorder, aPadding,
|
||||
aFlags & ComputeSizeFlags::eShrinkWrap);
|
||||
aFlags);
|
||||
const nsStylePosition *stylePos = StylePosition();
|
||||
|
||||
LogicalSize boxSizingAdjust(aWM);
|
||||
@ -4881,14 +4881,14 @@ nsIFrame::GetPrefWidthTightBounds(nsRenderingContext* aContext,
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
nsFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
// Use basic shrink-wrapping as a default implementation.
|
||||
LogicalSize result(aWM, 0xdeadbeef, NS_UNCONSTRAINEDSIZE);
|
||||
@ -4897,29 +4897,30 @@ nsFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
if (StylePosition()->ISize(aWM).GetUnit() == eStyleUnit_Auto) {
|
||||
nscoord availBased = aAvailableISize - aMargin.ISize(aWM) -
|
||||
aBorder.ISize(aWM) - aPadding.ISize(aWM);
|
||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased);
|
||||
result.ISize(aWM) = ShrinkWidthToFit(aRenderingContext, availBased, aFlags);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
nscoord
|
||||
nsFrame::ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
|
||||
nscoord aWidthInCB)
|
||||
nsFrame::ShrinkWidthToFit(nsRenderingContext* aRenderingContext,
|
||||
nscoord aISizeInCB,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
// If we're a container for font size inflation, then shrink
|
||||
// wrapping inside of us should not apply font size inflation.
|
||||
AutoMaybeDisableFontInflation an(this);
|
||||
|
||||
nscoord result;
|
||||
nscoord minWidth = GetMinISize(aRenderingContext);
|
||||
if (minWidth > aWidthInCB) {
|
||||
result = minWidth;
|
||||
nscoord minISize = GetMinISize(aRenderingContext);
|
||||
if (minISize > aISizeInCB) {
|
||||
result = minISize;
|
||||
} else {
|
||||
nscoord prefWidth = GetPrefISize(aRenderingContext);
|
||||
if (prefWidth > aWidthInCB) {
|
||||
result = aWidthInCB;
|
||||
nscoord prefISize = GetPrefISize(aRenderingContext);
|
||||
if (prefISize > aISizeInCB) {
|
||||
result = aISizeInCB;
|
||||
} else {
|
||||
result = prefWidth;
|
||||
result = prefISize;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -266,14 +266,14 @@ public:
|
||||
virtual nsSize GetIntrinsicRatio() override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
// Compute tight bounds assuming this frame honours its border, background
|
||||
// and outline, its children's tight bounds, and nothing else.
|
||||
@ -295,21 +295,22 @@ public:
|
||||
* to be unused.
|
||||
*/
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap);
|
||||
ComputeSizeFlags aFlags);
|
||||
|
||||
/**
|
||||
* Utility function for ComputeAutoSize implementations. Return
|
||||
* max(GetMinISize(), min(aWidthInCB, GetPrefISize()))
|
||||
* max(GetMinISize(), min(aISizeInCB, GetPrefISize()))
|
||||
*/
|
||||
nscoord ShrinkWidthToFit(nsRenderingContext *aRenderingContext,
|
||||
nscoord aWidthInCB);
|
||||
nscoord ShrinkWidthToFit(nsRenderingContext* aRenderingContext,
|
||||
nscoord aISizeInCB,
|
||||
ComputeSizeFlags aFlags);
|
||||
|
||||
/**
|
||||
* Calculates the size of this frame after reflowing (calling Reflow on, and
|
||||
|
@ -34,14 +34,14 @@ nsLeafFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsLeafFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsLeafFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
const WritingMode wm = GetWritingMode();
|
||||
LogicalSize result(wm, GetIntrinsicISize(), GetIntrinsicBSize());
|
||||
|
@ -41,14 +41,14 @@ public:
|
||||
* Our auto size is just intrinsic width and intrinsic height.
|
||||
*/
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
/**
|
||||
* Reflow our frame. This will use the computed width plus borderpadding for
|
||||
|
@ -683,19 +683,19 @@ nsSubDocumentFrame::GetIntrinsicRatio()
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsSubDocumentFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsSubDocumentFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
if (!IsInline()) {
|
||||
return nsFrame::ComputeAutoSize(aRenderingContext, aWM, aCBSize,
|
||||
aAvailableISize, aMargin, aBorder,
|
||||
aPadding, aShrinkWrap);
|
||||
aPadding, aFlags);
|
||||
}
|
||||
|
||||
const WritingMode wm = GetWritingMode();
|
||||
@ -706,14 +706,14 @@ nsSubDocumentFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsSubDocumentFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
nsSubDocumentFrame::ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
nsIFrame* subDocRoot = ObtainIntrinsicSizeFrame();
|
||||
if (subDocRoot) {
|
||||
|
@ -54,24 +54,24 @@ public:
|
||||
virtual nsSize GetIntrinsicRatio() override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
@ -1587,14 +1587,14 @@ nsTableFrame::IntrinsicISizeOffsets()
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsTableFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
nsTableFrame::ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
LogicalSize result =
|
||||
nsContainerFrame::ComputeSize(aRenderingContext, aWM,
|
||||
@ -1654,14 +1654,14 @@ nsTableFrame::TableShrinkISizeToFit(nsRenderingContext *aRenderingContext,
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsTableFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsTableFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
// Tables always shrink-wrap.
|
||||
nscoord cbBased = aAvailableISize - aMargin.ISize(aWM) - aBorder.ISize(aWM) -
|
||||
|
@ -327,24 +327,24 @@ public:
|
||||
virtual IntrinsicISizeOffsetData IntrinsicISizeOffsets() override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
/**
|
||||
* A copy of nsFrame::ShrinkWidthToFit that calls a different
|
||||
|
@ -395,14 +395,14 @@ ChildShrinkWrapISize(nsRenderingContext *aRenderingContext,
|
||||
|
||||
/* virtual */
|
||||
LogicalSize
|
||||
nsTableWrapperFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsTableWrapperFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
nscoord kidAvailableISize = aAvailableISize - aMargin.ISize(aWM);
|
||||
NS_ASSERTION(aBorder.IsAllZero() && aPadding.IsAllZero(),
|
||||
|
@ -72,14 +72,14 @@ public:
|
||||
virtual nscoord GetPrefISize(nsRenderingContext *aRenderingContext) override;
|
||||
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
/** process a reflow command for the table.
|
||||
* This involves reflowing the caption and the inner table.
|
||||
|
@ -175,19 +175,19 @@ nsLeafBoxFrame::GetIntrinsicISize()
|
||||
}
|
||||
|
||||
LogicalSize
|
||||
nsLeafBoxFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
bool aShrinkWrap)
|
||||
nsLeafBoxFrame::ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
WritingMode aWM,
|
||||
const LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
const LogicalSize& aMargin,
|
||||
const LogicalSize& aBorder,
|
||||
const LogicalSize& aPadding,
|
||||
ComputeSizeFlags aFlags)
|
||||
{
|
||||
// Important: NOT calling our direct superclass here!
|
||||
return nsFrame::ComputeAutoSize(aRenderingContext, aWM,
|
||||
aCBSize, aAvailableISize,
|
||||
aMargin, aBorder, aPadding, aShrinkWrap);
|
||||
aMargin, aBorder, aPadding, aFlags);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -43,14 +43,14 @@ public:
|
||||
|
||||
// Our auto size is that provided by nsFrame, not nsLeafFrame
|
||||
virtual mozilla::LogicalSize
|
||||
ComputeAutoSize(nsRenderingContext *aRenderingContext,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
ComputeAutoSize(nsRenderingContext* aRenderingContext,
|
||||
mozilla::WritingMode aWM,
|
||||
const mozilla::LogicalSize& aCBSize,
|
||||
nscoord aAvailableISize,
|
||||
nscoord aAvailableISize,
|
||||
const mozilla::LogicalSize& aMargin,
|
||||
const mozilla::LogicalSize& aBorder,
|
||||
const mozilla::LogicalSize& aPadding,
|
||||
bool aShrinkWrap) override;
|
||||
ComputeSizeFlags aFlags) override;
|
||||
|
||||
virtual void Reflow(nsPresContext* aPresContext,
|
||||
ReflowOutput& aDesiredSize,
|
||||
|
Loading…
Reference in New Issue
Block a user