diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /layout/generic/nsBlockFrame.h | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/nsBlockFrame.h')
-rw-r--r-- | layout/generic/nsBlockFrame.h | 31 |
1 files changed, 30 insertions, 1 deletions
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 @@ -492,6 +492,14 @@ class nsBlockFrame : public nsContainerFrame { 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 @@ -849,12 +867,23 @@ class nsBlockFrame : public nsContainerFrame { 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, |