зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1667594 - Avoid including nsLayoutUtils.h in nsContainerFrame.h. r=emilio
nsContainerFrame.h was only using the enum nsLayoutUtils::IntrinsicISizeType, which this patch moves to LayoutConstants.h instead. Depends on D91505 Differential Revision: https://phabricator.services.mozilla.com/D91506
This commit is contained in:
Родитель
4e4819d795
Коммит
948cec1b06
|
@ -7,6 +7,7 @@
|
|||
#include "Flex.h"
|
||||
|
||||
#include "FlexLineValues.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
|
||||
|
|
|
@ -6,7 +6,9 @@
|
|||
|
||||
#include "FlexItemValues.h"
|
||||
|
||||
#include "mozilla/dom/DOMRect.h"
|
||||
#include "mozilla/dom/FlexBinding.h"
|
||||
#include "mozilla/dom/FlexLineValues.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
|
|
@ -13,9 +13,13 @@
|
|||
|
||||
struct ComputedFlexItemInfo;
|
||||
|
||||
class nsINode;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class DOMRectReadOnly;
|
||||
|
||||
class FlexLineValues;
|
||||
|
||||
class FlexItemValues : public nsISupports, public nsWrapperCache {
|
||||
|
|
|
@ -75,6 +75,12 @@ enum class ComputeSizeFlag : uint8_t {
|
|||
};
|
||||
using ComputeSizeFlags = mozilla::EnumSet<ComputeSizeFlag>;
|
||||
|
||||
/**
|
||||
* This is used in some nsLayoutUtils functions.
|
||||
* Declared here so that fewer files need to include nsLayoutUtils.h.
|
||||
*/
|
||||
enum class IntrinsicISizeType { MinISize, PrefISize };
|
||||
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // LayoutConstants_h___
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
struct nsStyleDisplay;
|
||||
struct nsGenConInitializer;
|
||||
|
||||
class nsBlockFrame;
|
||||
class nsContainerFrame;
|
||||
class nsFirstLineFrame;
|
||||
class nsFirstLetterFrame;
|
||||
|
|
|
@ -5510,12 +5510,11 @@ static bool IsReplacedBoxResolvedAgainstZero(
|
|||
*/
|
||||
static nscoord AddIntrinsicSizeOffset(
|
||||
gfxContext* aRenderingContext, nsIFrame* aFrame,
|
||||
const nsIFrame::IntrinsicSizeOffsetData& aOffsets,
|
||||
nsLayoutUtils::IntrinsicISizeType aType, StyleBoxSizing aBoxSizing,
|
||||
nscoord aContentSize, nscoord aContentMinSize, const StyleSize& aStyleSize,
|
||||
const nscoord* aFixedMinSize, const StyleSize& aStyleMinSize,
|
||||
const nscoord* aFixedMaxSize, const StyleMaxSize& aStyleMaxSize,
|
||||
uint32_t aFlags, PhysicalAxis aAxis) {
|
||||
const nsIFrame::IntrinsicSizeOffsetData& aOffsets, IntrinsicISizeType aType,
|
||||
StyleBoxSizing aBoxSizing, nscoord aContentSize, nscoord aContentMinSize,
|
||||
const StyleSize& aStyleSize, const nscoord* aFixedMinSize,
|
||||
const StyleSize& aStyleMinSize, const nscoord* aFixedMaxSize,
|
||||
const StyleMaxSize& aStyleMaxSize, uint32_t aFlags, PhysicalAxis aAxis) {
|
||||
nscoord result = aContentSize;
|
||||
nscoord min = aContentMinSize;
|
||||
nscoord coordOutsideSize = 0;
|
||||
|
|
|
@ -1555,9 +1555,8 @@ class nsLayoutUtils {
|
|||
* size by reducing the *content size* (flooring at zero). This is used for:
|
||||
* https://drafts.csswg.org/css-grid/#min-size-auto
|
||||
*/
|
||||
enum class IntrinsicISizeType { MinISize, PrefISize };
|
||||
static const auto MIN_ISIZE = IntrinsicISizeType::MinISize;
|
||||
static const auto PREF_ISIZE = IntrinsicISizeType::PrefISize;
|
||||
static const auto MIN_ISIZE = mozilla::IntrinsicISizeType::MinISize;
|
||||
static const auto PREF_ISIZE = mozilla::IntrinsicISizeType::PrefISize;
|
||||
enum {
|
||||
IGNORE_PADDING = 0x01,
|
||||
BAIL_IF_REFLOW_NEEDED = 0x02, // returns NS_INTRINSIC_ISIZE_UNKNOWN if so
|
||||
|
@ -1565,7 +1564,7 @@ class nsLayoutUtils {
|
|||
};
|
||||
static nscoord IntrinsicForAxis(
|
||||
mozilla::PhysicalAxis aAxis, gfxContext* aRenderingContext,
|
||||
nsIFrame* aFrame, IntrinsicISizeType aType,
|
||||
nsIFrame* aFrame, mozilla::IntrinsicISizeType aType,
|
||||
const mozilla::Maybe<LogicalSize>& aPercentageBasis = mozilla::Nothing(),
|
||||
uint32_t aFlags = 0, nscoord aMarginBoxMinSizeClamp = NS_MAXSIZE);
|
||||
/**
|
||||
|
@ -1573,7 +1572,7 @@ class nsLayoutUtils {
|
|||
*/
|
||||
static nscoord IntrinsicForContainer(gfxContext* aRenderingContext,
|
||||
nsIFrame* aFrame,
|
||||
IntrinsicISizeType aType,
|
||||
mozilla::IntrinsicISizeType aType,
|
||||
uint32_t aFlags = 0);
|
||||
|
||||
/**
|
||||
|
@ -1597,7 +1596,7 @@ class nsLayoutUtils {
|
|||
*/
|
||||
static nscoord MinSizeContributionForAxis(mozilla::PhysicalAxis aAxis,
|
||||
gfxContext* aRC, nsIFrame* aFrame,
|
||||
IntrinsicISizeType aType,
|
||||
mozilla::IntrinsicISizeType aType,
|
||||
const LogicalSize& aPercentageBasis,
|
||||
uint32_t aFlags = 0);
|
||||
|
||||
|
|
|
@ -723,8 +723,8 @@ nscoord nsComboboxControlFrame::DropDownButtonISize() {
|
|||
return presContext->DevPixelsToAppUnits(dropdownButtonSize.width);
|
||||
}
|
||||
|
||||
nscoord nsComboboxControlFrame::GetIntrinsicISize(
|
||||
gfxContext* aRenderingContext, nsLayoutUtils::IntrinsicISizeType aType) {
|
||||
nscoord nsComboboxControlFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
IntrinsicISizeType aType) {
|
||||
// get the scrollbar width, we'll use this later
|
||||
nscoord scrollbarWidth = 0;
|
||||
nsPresContext* presContext = PresContext();
|
||||
|
|
|
@ -238,7 +238,7 @@ class nsComboboxControlFrame final : public nsBlockFrame,
|
|||
|
||||
// Helper for GetMinISize/GetPrefISize
|
||||
nscoord GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
nsLayoutUtils::IntrinsicISizeType aType);
|
||||
mozilla::IntrinsicISizeType aType);
|
||||
|
||||
class RedisplayTextEvent : public mozilla::Runnable {
|
||||
public:
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "mozilla/Likely.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/Maybe.h"
|
||||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsCSSFrameConstructor.h"
|
||||
#include "nsCSSRendering.h"
|
||||
|
@ -340,8 +341,8 @@ image::ImgDrawResult nsFieldSetFrame::PaintBorder(
|
|||
return result;
|
||||
}
|
||||
|
||||
nscoord nsFieldSetFrame::GetIntrinsicISize(
|
||||
gfxContext* aRenderingContext, nsLayoutUtils::IntrinsicISizeType aType) {
|
||||
nscoord nsFieldSetFrame::GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
IntrinsicISizeType aType) {
|
||||
nscoord legendWidth = 0;
|
||||
nscoord contentWidth = 0;
|
||||
if (!StyleDisplay()->IsContainSize()) {
|
||||
|
|
|
@ -21,7 +21,7 @@ class nsFieldSetFrame final : public nsContainerFrame {
|
|||
explicit nsFieldSetFrame(ComputedStyle* aStyle, nsPresContext* aPresContext);
|
||||
|
||||
nscoord GetIntrinsicISize(gfxContext* aRenderingContext,
|
||||
nsLayoutUtils::IntrinsicISizeType);
|
||||
mozilla::IntrinsicISizeType);
|
||||
virtual nscoord GetMinISize(gfxContext* aRenderingContext) override;
|
||||
virtual nscoord GetPrefISize(gfxContext* aRenderingContext) override;
|
||||
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#include "mozilla/ComputedStyle.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/dom/HTMLSummaryElement.h"
|
||||
#include "mozilla/gfx/2D.h"
|
||||
#include "mozilla/gfx/Types.h"
|
||||
#include "nsAbsoluteContainingBlock.h"
|
||||
#include "nsAttrValue.h"
|
||||
#include "nsAttrValueInlines.h"
|
||||
|
@ -37,12 +39,19 @@
|
|||
#include "mozilla/AutoRestore.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
#include "nsPrintfCString.h"
|
||||
#include "mozilla/webrender/WebRenderAPI.h"
|
||||
#include <algorithm>
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
using namespace mozilla::layout;
|
||||
|
||||
using mozilla::gfx::ColorPattern;
|
||||
using mozilla::gfx::DeviceColor;
|
||||
using mozilla::gfx::Rect;
|
||||
using mozilla::gfx::sRGBColor;
|
||||
using mozilla::gfx::ToDeviceColor;
|
||||
|
||||
nsContainerFrame::~nsContainerFrame() = default;
|
||||
|
||||
NS_QUERYFRAME_HEAD(nsContainerFrame)
|
||||
|
@ -873,9 +882,9 @@ static nscoord GetCoord(const LengthPercentageOrAuto& aCoord,
|
|||
return GetCoord(aCoord.AsLengthPercentage(), aIfNotCoord);
|
||||
}
|
||||
|
||||
void nsContainerFrame::DoInlineIntrinsicISize(
|
||||
gfxContext* aRenderingContext, InlineIntrinsicISizeData* aData,
|
||||
nsLayoutUtils::IntrinsicISizeType aType) {
|
||||
void nsContainerFrame::DoInlineIntrinsicISize(gfxContext* aRenderingContext,
|
||||
InlineIntrinsicISizeData* aData,
|
||||
IntrinsicISizeType aType) {
|
||||
if (GetPrevInFlow()) return; // Already added.
|
||||
|
||||
MOZ_ASSERT(
|
||||
|
|
|
@ -10,9 +10,9 @@
|
|||
#define nsContainerFrame_h___
|
||||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "LayoutConstants.h"
|
||||
#include "nsSplittableFrame.h"
|
||||
#include "nsFrameList.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsLineBox.h"
|
||||
|
||||
class nsOverflowContinuationTracker;
|
||||
|
@ -213,7 +213,7 @@ class nsContainerFrame : public nsSplittableFrame {
|
|||
// Used by both nsInlineFrame and nsFirstLetterFrame.
|
||||
void DoInlineIntrinsicISize(gfxContext* aRenderingContext,
|
||||
InlineIntrinsicISizeData* aData,
|
||||
nsLayoutUtils::IntrinsicISizeType aType);
|
||||
mozilla::IntrinsicISizeType aType);
|
||||
|
||||
/**
|
||||
* This is the CSS block concept of computing 'auto' widths, which most
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "mozilla/RestyleManager.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsLineLayout.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsFrameManager.h"
|
||||
|
|
|
@ -5545,8 +5545,8 @@ void nsFlexContainerFrame::ReflowPlaceholders(
|
|||
}
|
||||
}
|
||||
|
||||
nscoord nsFlexContainerFrame::IntrinsicISize(
|
||||
gfxContext* aRenderingContext, nsLayoutUtils::IntrinsicISizeType aType) {
|
||||
nscoord nsFlexContainerFrame::IntrinsicISize(gfxContext* aRenderingContext,
|
||||
IntrinsicISizeType aType) {
|
||||
nscoord containerISize = 0;
|
||||
const nsStylePosition* stylePos = StylePosition();
|
||||
const FlexboxAxisTracker axisTracker(this);
|
||||
|
|
|
@ -644,7 +644,7 @@ class nsFlexContainerFrame final : public nsContainerFrame {
|
|||
* Helper for GetMinISize / GetPrefISize.
|
||||
*/
|
||||
nscoord IntrinsicISize(gfxContext* aRenderingContext,
|
||||
nsLayoutUtils::IntrinsicISizeType aType);
|
||||
mozilla::IntrinsicISizeType aType);
|
||||
|
||||
/**
|
||||
* Cached values to optimize GetMinISize/GetPrefISize.
|
||||
|
|
|
@ -42,7 +42,6 @@ using namespace mozilla;
|
|||
typedef nsAbsoluteContainingBlock::AbsPosReflowFlags AbsPosReflowFlags;
|
||||
typedef nsGridContainerFrame::TrackSize TrackSize;
|
||||
typedef mozilla::CSSAlignUtils::AlignJustifyFlags AlignJustifyFlags;
|
||||
typedef nsLayoutUtils::IntrinsicISizeType IntrinsicISizeType;
|
||||
|
||||
using GridTemplate = StyleGridTemplateComponent;
|
||||
using TrackListValue =
|
||||
|
|
|
@ -313,7 +313,6 @@ class nsGridContainerFrame final : public nsContainerFrame {
|
|||
typedef mozilla::LogicalRect LogicalRect;
|
||||
typedef mozilla::LogicalSize LogicalSize;
|
||||
typedef mozilla::WritingMode WritingMode;
|
||||
typedef nsLayoutUtils::IntrinsicISizeType IntrinsicISizeType;
|
||||
struct Grid;
|
||||
struct GridArea;
|
||||
class LineNameMap;
|
||||
|
@ -363,7 +362,7 @@ class nsGridContainerFrame final : public nsContainerFrame {
|
|||
* Helper for GetMinISize / GetPrefISize.
|
||||
*/
|
||||
nscoord IntrinsicISize(gfxContext* aRenderingContext,
|
||||
IntrinsicISizeType aConstraint);
|
||||
mozilla::IntrinsicISizeType aConstraint);
|
||||
|
||||
bool GetBBaseline(BaselineSharingGroup aBaselineGroup,
|
||||
nscoord* aResult) const {
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
// Keep others in (case-insensitive) order:
|
||||
#include "AutoReferenceChainGuard.h"
|
||||
#include "gfxPattern.h"
|
||||
#include "gfxUtils.h"
|
||||
#include "mozilla/PresShell.h"
|
||||
#include "mozilla/SVGObserverUtils.h"
|
||||
#include "mozilla/SVGUtils.h"
|
||||
|
|
|
@ -340,7 +340,7 @@ nscoord nsTableWrapperFrame::GetPrefISize(gfxContext* aRenderingContext) {
|
|||
maxISize += capMin;
|
||||
} break;
|
||||
default: {
|
||||
nsLayoutUtils::IntrinsicISizeType iwt;
|
||||
IntrinsicISizeType iwt;
|
||||
if (captionSide == NS_STYLE_CAPTION_SIDE_TOP ||
|
||||
captionSide == NS_STYLE_CAPTION_SIDE_BOTTOM) {
|
||||
// Don't let the caption's pref isize expand the table's pref
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
#include "nsGkAtoms.h"
|
||||
#include "nsITheme.h"
|
||||
#include "nsBoxLayout.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "FrameLayerBuilder.h"
|
||||
#include "mozilla/dom/Attr.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
|
|
Загрузка…
Ссылка в новой задаче