summaryrefslogtreecommitdiffstats
path: root/layout/generic/BlockReflowState.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /layout/generic/BlockReflowState.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/generic/BlockReflowState.cpp')
-rw-r--r--layout/generic/BlockReflowState.cpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/layout/generic/BlockReflowState.cpp b/layout/generic/BlockReflowState.cpp
index 6163a200a3..78dab82e98 100644
--- a/layout/generic/BlockReflowState.cpp
+++ b/layout/generic/BlockReflowState.cpp
@@ -47,7 +47,8 @@ BlockReflowState::BlockReflowState(
mMinLineHeight(aReflowInput.GetLineHeight()),
mLineNumber(0),
mTrailingClearFromPIF(StyleClear::None),
- mConsumedBSize(aConsumedBSize) {
+ mConsumedBSize(aConsumedBSize),
+ mAlignContentShift(mBlock->GetAlignContentShift()) {
NS_ASSERTION(mConsumedBSize != NS_UNCONSTRAINEDSIZE,
"The consumed block-size should be constrained!");
@@ -87,8 +88,8 @@ BlockReflowState::BlockReflowState(
// the "overflow" property. When we don't have a specified style block-size,
// then we may end up limiting our block-size if the available block-size is
// constrained (this situation occurs when we are paginated).
- if (const nscoord availableBSize = aReflowInput.AvailableBSize();
- availableBSize != NS_UNCONSTRAINEDSIZE) {
+ const nscoord availableBSize = aReflowInput.AvailableBSize();
+ if (availableBSize != NS_UNCONSTRAINEDSIZE) {
// We are in a paginated situation. The block-end edge of the available
// space to reflow the children is within our block-end border and padding.
// If we're cloning our border and padding, and we're going to request
@@ -112,10 +113,34 @@ BlockReflowState::BlockReflowState(
mContentArea.IStart(wm) = mBorderPadding.IStart(wm);
mBCoord = mContentArea.BStart(wm) = mBorderPadding.BStart(wm);
+ // Account for existing cached shift, we'll re-position in AlignContent() if
+ // needed.
+ if (mAlignContentShift) {
+ mBCoord += mAlignContentShift;
+ mContentArea.BStart(wm) += mAlignContentShift;
+
+ if (availableBSize != NS_UNCONSTRAINEDSIZE) {
+ mContentArea.BSize(wm) += mAlignContentShift;
+ }
+ }
+
mPrevChild = nullptr;
mCurrentLine = aFrame->LinesEnd();
}
+void BlockReflowState::UndoAlignContentShift() {
+ if (!mAlignContentShift) {
+ return;
+ }
+
+ mBCoord -= mAlignContentShift;
+ mContentArea.BStart(mReflowInput.GetWritingMode()) -= mAlignContentShift;
+
+ if (mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE) {
+ mContentArea.BSize(mReflowInput.GetWritingMode()) -= mAlignContentShift;
+ }
+}
+
void BlockReflowState::ComputeFloatAvoidingOffsets(
nsIFrame* aFloatAvoidingBlock, const LogicalRect& aFloatAvailableSpace,
nscoord& aIStartResult, nscoord& aIEndResult) const {