From f5c1a59332e02daaff7713f9c5a85575b54292ad Mon Sep 17 00:00:00 2001 From: Jon Bauman Date: Fri, 20 Nov 2020 21:21:03 +0000 Subject: [PATCH] Bug 1675987 - No derogatory language: Remove references to "crazy" in layout module r=emilio,AlaskanEmily Differential Revision: https://phabricator.services.mozilla.com/D97657 --- layout/generic/nsBlockFrame.cpp | 10 +++++----- layout/generic/nsBlockReflowContext.cpp | 6 +++--- layout/generic/nsContainerFrame.h | 10 +++++----- layout/generic/nsGridContainerFrame.cpp | 2 +- layout/generic/nsLineLayout.cpp | 24 ++++++++++++------------ layout/xul/tree/nsTreeBodyFrame.cpp | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 10f65f7c0b23..5624ad5d2f0d 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2029,8 +2029,8 @@ void nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput, aMetrics.SetSize(wm, finalSize); #ifdef DEBUG_blocks - if ((CRAZY_SIZE(aMetrics.Width()) || CRAZY_SIZE(aMetrics.Height())) && - !GetParent()->IsCrazySizeAssertSuppressed()) { + if ((ABSURD_SIZE(aMetrics.Width()) || ABSURD_SIZE(aMetrics.Height())) && + !GetParent()->IsAbsurdSizeAssertSuppressed()) { ListTag(stdout); printf(": WARNING: desired:%d,%d\n", aMetrics.Width(), aMetrics.Height()); } @@ -4923,11 +4923,11 @@ bool nsBlockFrame::PlaceLine(BlockReflowInput& aState, } #ifdef DEBUG - if (!GetParent()->IsCrazySizeAssertSuppressed()) { + if (!GetParent()->IsAbsurdSizeAssertSuppressed()) { static nscoord lastHeight = 0; - if (CRAZY_SIZE(aLine->BStart())) { + if (ABSURD_SIZE(aLine->BStart())) { lastHeight = aLine->BStart(); - if (abs(aLine->BStart() - lastHeight) > CRAZY_COORD / 10) { + if (abs(aLine->BStart() - lastHeight) > ABSURD_COORD / 10) { nsIFrame::ListTag(stdout); printf(": line=%p y=%d line.bounds.height=%d\n", static_cast(aLine.get()), aLine->BStart(), diff --git a/layout/generic/nsBlockReflowContext.cpp b/layout/generic/nsBlockReflowContext.cpp index 60a6dec34751..dcd12f5471c2 100644 --- a/layout/generic/nsBlockReflowContext.cpp +++ b/layout/generic/nsBlockReflowContext.cpp @@ -290,9 +290,9 @@ void nsBlockReflowContext::ReflowBlock( #ifdef DEBUG if (!aFrameReflowStatus.IsInlineBreakBefore()) { - if ((CRAZY_SIZE(mMetrics.ISize(mWritingMode)) || - CRAZY_SIZE(mMetrics.BSize(mWritingMode))) && - !mFrame->GetParent()->IsCrazySizeAssertSuppressed()) { + if ((ABSURD_SIZE(mMetrics.ISize(mWritingMode)) || + ABSURD_SIZE(mMetrics.BSize(mWritingMode))) && + !mFrame->GetParent()->IsAbsurdSizeAssertSuppressed()) { printf("nsBlockReflowContext: "); mFrame->ListTag(stdout); printf(" metrics=%d,%d!\n", mMetrics.ISize(mWritingMode), diff --git a/layout/generic/nsContainerFrame.h b/layout/generic/nsContainerFrame.h index 3b123a2012d3..3f8a987fc3b8 100644 --- a/layout/generic/nsContainerFrame.h +++ b/layout/generic/nsContainerFrame.h @@ -29,9 +29,9 @@ class PresShell; #ifdef DEBUG // 10 million pixels, converted to app units. Note that this a bit larger // than 1/4 of nscoord_MAX. So, if any content gets to be this large, we're -// definitely in danger of grazing up against nscoord_MAX; hence, it's CRAZY. -# define CRAZY_COORD (10000000 * 60) -# define CRAZY_SIZE(_x) (((_x) < -CRAZY_COORD) || ((_x) > CRAZY_COORD)) +// definitely in danger of grazing up against nscoord_MAX; hence, it's ABSURD. +# define ABSURD_COORD (10000000 * 60) +# define ABSURD_SIZE(_x) (((_x) < -ABSURD_COORD) || ((_x) > ABSURD_COORD)) #endif /** @@ -482,9 +482,9 @@ class nsContainerFrame : public nsSplittableFrame { void ClearHasFirstLetterChild() { mHasFirstLetterChild = false; } #ifdef DEBUG - // Use this to suppress the CRAZY_SIZE assertions. + // Use this to suppress the ABSURD_SIZE assertions. NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(DebugReflowingWithInfiniteISize, bool) - bool IsCrazySizeAssertSuppressed() const { + bool IsAbsurdSizeAssertSuppressed() const { return GetProperty(DebugReflowingWithInfiniteISize()); } #endif diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 502f61aebd98..9ca650f85042 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -4939,7 +4939,7 @@ static nscoord MeasuringReflow(nsIFrame* aChild, rs = dummyParentState.ptr(); } #ifdef DEBUG - // This will suppress various CRAZY_SIZE warnings for this reflow. + // This will suppress various ABSURD_SIZE warnings for this reflow. parent->SetProperty(nsContainerFrame::DebugReflowingWithInfiniteISize(), true); #endif diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 8edf28b62d24..f10503c34ae9 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -153,13 +153,13 @@ void nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord, "very large sizes, not attempts at intrinsic width " "calculation"); #ifdef DEBUG - if ((aISize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aISize) && - !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) { + if ((aISize != NS_UNCONSTRAINEDSIZE) && ABSURD_SIZE(aISize) && + !LineContainerFrame()->GetParent()->IsAbsurdSizeAssertSuppressed()) { mBlockReflowInput->mFrame->ListTag(stdout); printf(": Init: bad caller: width WAS %d(0x%x)\n", aISize, aISize); } - if ((aBSize != NS_UNCONSTRAINEDSIZE) && CRAZY_SIZE(aBSize) && - !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) { + if ((aBSize != NS_UNCONSTRAINEDSIZE) && ABSURD_SIZE(aBSize) && + !LineContainerFrame()->GetParent()->IsAbsurdSizeAssertSuppressed()) { mBlockReflowInput->mFrame->ListTag(stdout); printf(": Init: bad caller: height WAS %d(0x%x)\n", aBSize, aBSize); } @@ -293,15 +293,15 @@ void nsLineLayout::UpdateBand(WritingMode aWM, #endif #ifdef DEBUG if ((availSpace.ISize(lineWM) != NS_UNCONSTRAINEDSIZE) && - CRAZY_SIZE(availSpace.ISize(lineWM)) && - !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) { + ABSURD_SIZE(availSpace.ISize(lineWM)) && + !LineContainerFrame()->GetParent()->IsAbsurdSizeAssertSuppressed()) { mBlockReflowInput->mFrame->ListTag(stdout); printf(": UpdateBand: bad caller: ISize WAS %d(0x%x)\n", availSpace.ISize(lineWM), availSpace.ISize(lineWM)); } if ((availSpace.BSize(lineWM) != NS_UNCONSTRAINEDSIZE) && - CRAZY_SIZE(availSpace.BSize(lineWM)) && - !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) { + ABSURD_SIZE(availSpace.BSize(lineWM)) && + !LineContainerFrame()->GetParent()->IsAbsurdSizeAssertSuppressed()) { mBlockReflowInput->mFrame->ListTag(stdout); printf(": UpdateBand: bad caller: BSize WAS %d(0x%x)\n", availSpace.BSize(lineWM), availSpace.BSize(lineWM)); @@ -965,9 +965,9 @@ void nsLineLayout::ReflowFrame(nsIFrame* aFrame, nsReflowStatus& aReflowStatus, // Note: break-before means ignore the reflow metrics since the // frame will be reflowed another time. if (!aReflowStatus.IsInlineBreakBefore()) { - if ((CRAZY_SIZE(reflowOutput.ISize(lineWM)) || - CRAZY_SIZE(reflowOutput.BSize(lineWM))) && - !LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) { + if ((ABSURD_SIZE(reflowOutput.ISize(lineWM)) || + ABSURD_SIZE(reflowOutput.BSize(lineWM))) && + !LineContainerFrame()->GetParent()->IsAbsurdSizeAssertSuppressed()) { printf("nsLineLayout: "); aFrame->ListTag(stdout); printf(" metrics=%d,%d!\n", reflowOutput.Width(), reflowOutput.Height()); @@ -2368,7 +2368,7 @@ void nsLineLayout::VerticalAlignFrames(PerSpanData* psd) { // they might end up being aligned anywhere. However, we'll guess // that they'll be placed aligned with the top or bottom of this // frame (as though this frame is the only thing in the line). - // (Guessing isn't crazy, since all we're doing is reducing the + // (Guessing isn't unreasonable, since all we're doing is reducing the // scope of a quirk and making the behavior more standards-like.) if (maxStartBoxBSize > maxBCoord - minBCoord) { // Distribute maxStartBoxBSize to ascent (baselineBCoord - minBCoord), and diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp index bd5352abe70c..65a73a51594d 100644 --- a/layout/xul/tree/nsTreeBodyFrame.cpp +++ b/layout/xul/tree/nsTreeBodyFrame.cpp @@ -1979,7 +1979,7 @@ nsRect nsTreeBodyFrame::GetImageSize(int32_t aRowIndex, nsTreeColumn* aCol, bool needHeight = false; // We have to load image even though we already have a size. - // Don't change this, otherwise things start to go crazy. + // Don't change this, otherwise things start to go awry. bool useImageRegion = true; nsCOMPtr image; GetImage(aRowIndex, aCol, aUseContext, aComputedStyle, useImageRegion,