From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/generic/nsBlockFrame.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'layout/generic/nsBlockFrame.h') diff --git a/layout/generic/nsBlockFrame.h b/layout/generic/nsBlockFrame.h index 15dd4c3278..9fb909430c 100644 --- a/layout/generic/nsBlockFrame.h +++ b/layout/generic/nsBlockFrame.h @@ -491,6 +491,14 @@ class nsBlockFrame : public nsContainerFrame { nscoord ComputeFinalSize(const ReflowInput& aReflowInput, BlockReflowState& aState, ReflowOutput& aMetrics); + /** + * Calculates the necessary shift to honor 'align-content' and applies it. + */ + void AlignContent(BlockReflowState& aState, ReflowOutput& aMetrics, + nscoord aBEndEdgeOfChildren); + // Stash the effective align-content shift value between reflows + NS_DECLARE_FRAME_PROPERTY_SMALL_VALUE(AlignContentShift, nscoord) + /** * Helper method for Reflow(). Computes the overflow areas created by our * children, and includes them into aOverflowAreas. @@ -540,6 +548,16 @@ class nsBlockFrame : public nsContainerFrame { */ bool IsVisualFormControl(nsPresContext* aPresContext); + /** Whether this block has an effective align-content property */ + bool IsAligned() const { + return StylePosition()->mAlignContent.primary != + mozilla::StyleAlignFlags::NORMAL; + } + + nscoord GetAlignContentShift() const { + return IsAligned() ? GetProperty(AlignContentShift()) : 0; + } + /** * For text-wrap:balance, we iteratively try reflowing with adjusted inline * size to find the "best" result (the tightest size that can be applied @@ -848,13 +866,24 @@ class nsBlockFrame : public nsContainerFrame { LineIterator aLine, bool* aKeepReflowGoing); + /** + * Indicates if we need to compute a page name for the next page when pushing + * a truncated line. + * + * Using a value of No saves work when a new page name has already been set + * with nsCSSFrameConstructor::SetNextPageContentFramePageName. + */ + enum class ComputeNewPageNameIfNeeded : uint8_t { Yes, No }; + /** * Push aLine (and any after it), since it cannot be placed on this * page/column. Set aKeepReflowGoing to false and set * flag aState.mReflowStatus as incomplete. */ void PushTruncatedLine(BlockReflowState& aState, LineIterator aLine, - bool* aKeepReflowGoing); + bool* aKeepReflowGoing, + ComputeNewPageNameIfNeeded aComputeNewPageName = + ComputeNewPageNameIfNeeded::Yes); void SplitLine(BlockReflowState& aState, nsLineLayout& aLineLayout, LineIterator aLine, nsIFrame* aFrame, -- cgit v1.2.3