2017-10-27 20:33:53 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-03-23 07:28:20 +03:00
|
|
|
|
2006-03-29 22:29:03 +04:00
|
|
|
/* state used in reflow of block frames */
|
|
|
|
|
2016-07-21 13:36:36 +03:00
|
|
|
#ifndef BlockReflowInput_h
|
|
|
|
#define BlockReflowInput_h
|
2001-05-01 08:22:57 +04:00
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
#include "nsFloatManager.h"
|
2001-05-01 08:22:57 +04:00
|
|
|
#include "nsLineBox.h"
|
2016-07-21 13:36:34 +03:00
|
|
|
#include "mozilla/ReflowInput.h"
|
2013-02-12 05:52:55 +04:00
|
|
|
|
|
|
|
class nsBlockFrame;
|
2013-08-22 22:32:52 +04:00
|
|
|
class nsFrameList;
|
2013-02-12 05:52:55 +04:00
|
|
|
class nsOverflowContinuationTracker;
|
2001-08-01 05:27:50 +04:00
|
|
|
|
2016-07-21 13:36:36 +03:00
|
|
|
namespace mozilla {
|
|
|
|
|
2016-08-12 10:28:45 +03:00
|
|
|
// BlockReflowInput contains additional reflow input information that the
|
2016-07-21 13:36:35 +03:00
|
|
|
// block frame uses along with ReflowInput. Like ReflowInput, this
|
2016-07-08 13:24:49 +03:00
|
|
|
// is read-only data that is passed down from a parent frame to its children.
|
2016-07-21 13:36:36 +03:00
|
|
|
class BlockReflowInput {
|
2016-10-12 11:06:25 +03:00
|
|
|
using BandInfoType = nsFloatManager::BandInfoType;
|
|
|
|
using ShapeType = nsFloatManager::ShapeType;
|
2016-08-12 10:28:45 +03:00
|
|
|
|
|
|
|
// Block reflow input flags.
|
|
|
|
struct Flags {
|
|
|
|
Flags()
|
|
|
|
: mHasUnconstrainedBSize(false),
|
|
|
|
mIsBStartMarginRoot(false),
|
|
|
|
mIsBEndMarginRoot(false),
|
|
|
|
mShouldApplyBStartMargin(false),
|
|
|
|
mIsFirstInflow(false),
|
|
|
|
mHasLineAdjacentToTop(false),
|
|
|
|
mBlockNeedsFloatManager(false),
|
|
|
|
mIsLineLayoutEmpty(false),
|
|
|
|
mIsOverflowContainer(false),
|
|
|
|
mIsFloatListInBlockPropertyTable(false),
|
2019-05-09 05:32:30 +03:00
|
|
|
mCanHaveOverflowMarkers(false) {}
|
2016-08-12 10:28:45 +03:00
|
|
|
|
|
|
|
// Set in the BlockReflowInput constructor when the frame being reflowed has
|
|
|
|
// been given NS_UNCONSTRAINEDSIZE as its available BSize in the
|
|
|
|
// ReflowInput. If set, NS_UNCONSTRAINEDSIZE is passed to nsLineLayout as
|
|
|
|
// the available BSize.
|
|
|
|
bool mHasUnconstrainedBSize : 1;
|
|
|
|
|
|
|
|
// Set in the BlockReflowInput constructor when reflowing a "block margin
|
|
|
|
// root" frame (i.e. a frame with the NS_BLOCK_MARGIN_ROOT flag set, for
|
|
|
|
// which margins apply by default).
|
|
|
|
//
|
|
|
|
// The flag is also set when reflowing a frame whose computed BStart border
|
|
|
|
// padding is non-zero.
|
|
|
|
bool mIsBStartMarginRoot : 1;
|
|
|
|
|
|
|
|
// Set in the BlockReflowInput constructor when reflowing a "block margin
|
|
|
|
// root" frame (i.e. a frame with the NS_BLOCK_MARGIN_ROOT flag set, for
|
|
|
|
// which margins apply by default).
|
|
|
|
//
|
|
|
|
// The flag is also set when reflowing a frame whose computed BEnd border
|
|
|
|
// padding is non-zero.
|
|
|
|
bool mIsBEndMarginRoot : 1;
|
|
|
|
|
|
|
|
// Set if the BStart margin should be considered when placing a linebox that
|
|
|
|
// contains a block frame. It may be set as a side-effect of calling
|
|
|
|
// nsBlockFrame::ShouldApplyBStartMargin(); once set,
|
|
|
|
// ShouldApplyBStartMargin() uses it as a fast-path way to return whether
|
|
|
|
// the BStart margin should apply.
|
|
|
|
//
|
|
|
|
// If the flag hasn't been set in the block reflow input, then
|
|
|
|
// ShouldApplyBStartMargin() will crawl the line list to see if a block
|
|
|
|
// frame precedes the specified frame. If so, the BStart margin should be
|
|
|
|
// applied, and the flag is set to cache the result. (If not, the BStart
|
|
|
|
// margin will be applied as a result of the generational margin collapsing
|
|
|
|
// logic in nsBlockReflowContext::ComputeCollapsedBStartMargin(). In this
|
|
|
|
// case, the flag won't be set, so subsequent calls to
|
|
|
|
// ShouldApplyBStartMargin() will continue crawl the line list.)
|
|
|
|
//
|
|
|
|
// This flag is also set in the BlockReflowInput constructor if
|
|
|
|
// mIsBStartMarginRoot is set; that is, the frame being reflowed is a margin
|
|
|
|
// root by default.
|
|
|
|
bool mShouldApplyBStartMargin : 1;
|
|
|
|
|
|
|
|
bool mIsFirstInflow : 1;
|
|
|
|
|
|
|
|
// Set when mLineAdjacentToTop is valid.
|
|
|
|
bool mHasLineAdjacentToTop : 1;
|
|
|
|
|
|
|
|
// Set when the block has the equivalent of NS_BLOCK_FLOAT_MGR.
|
|
|
|
bool mBlockNeedsFloatManager : 1;
|
|
|
|
|
|
|
|
// Set when nsLineLayout::LineIsEmpty was true at the end of reflowing
|
|
|
|
// the current line.
|
|
|
|
bool mIsLineLayoutEmpty : 1;
|
|
|
|
|
|
|
|
bool mIsOverflowContainer : 1;
|
|
|
|
|
|
|
|
// Set when our mPushedFloats list is stored on the block's property table.
|
|
|
|
bool mIsFloatListInBlockPropertyTable : 1;
|
|
|
|
|
2019-05-09 05:32:30 +03:00
|
|
|
// Set when we need text-overflow or -webkit-line-clamp processing.
|
|
|
|
bool mCanHaveOverflowMarkers : 1;
|
2016-08-12 10:28:45 +03:00
|
|
|
};
|
2016-07-21 13:36:34 +03:00
|
|
|
|
1998-12-05 19:02:08 +03:00
|
|
|
public:
|
2016-07-21 13:36:39 +03:00
|
|
|
BlockReflowInput(const ReflowInput& aReflowInput, nsPresContext* aPresContext,
|
1999-03-05 07:21:32 +03:00
|
|
|
nsBlockFrame* aFrame, bool aBStartMarginRoot,
|
2014-06-20 13:55:35 +04:00
|
|
|
bool aBEndMarginRoot, bool aBlockNeedsFloatManager,
|
2019-06-05 02:41:20 +03:00
|
|
|
nscoord aConsumedBSize = NS_UNCONSTRAINEDSIZE);
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
/**
|
2009-04-09 00:52:36 +04:00
|
|
|
* Get the available reflow space (the area not occupied by floats)
|
|
|
|
* for the current y coordinate. The available space is relative to
|
|
|
|
* our coordinate system, which is the content box, with (0, 0) in the
|
|
|
|
* upper left.
|
|
|
|
*
|
2014-06-20 13:55:35 +04:00
|
|
|
* Returns whether there are floats present at the given block-direction
|
|
|
|
* coordinate and within the inline size of the content rect.
|
1999-04-03 22:59:01 +04:00
|
|
|
*/
|
2009-04-09 00:52:37 +04:00
|
|
|
nsFlowAreaRect GetFloatAvailableSpace() const {
|
2014-06-20 13:55:35 +04:00
|
|
|
return GetFloatAvailableSpace(mBCoord);
|
|
|
|
}
|
2016-10-12 11:06:25 +03:00
|
|
|
nsFlowAreaRect GetFloatAvailableSpaceForPlacingFloat(nscoord aBCoord) const {
|
|
|
|
return GetFloatAvailableSpaceWithState(aBCoord, ShapeType::Margin, nullptr);
|
|
|
|
}
|
2014-06-20 13:55:35 +04:00
|
|
|
nsFlowAreaRect GetFloatAvailableSpace(nscoord aBCoord) const {
|
2016-10-12 11:06:25 +03:00
|
|
|
return GetFloatAvailableSpaceWithState(aBCoord, ShapeType::ShapeOutside,
|
|
|
|
nullptr);
|
2018-11-30 13:46:48 +03:00
|
|
|
}
|
2016-10-12 11:06:25 +03:00
|
|
|
nsFlowAreaRect GetFloatAvailableSpaceWithState(
|
|
|
|
nscoord aBCoord, ShapeType aShapeType,
|
2009-04-09 00:52:37 +04:00
|
|
|
nsFloatManager::SavedState* aState) const;
|
2014-06-20 13:55:35 +04:00
|
|
|
nsFlowAreaRect GetFloatAvailableSpaceForBSize(
|
|
|
|
nscoord aBCoord, nscoord aBSize,
|
|
|
|
nsFloatManager::SavedState* aState) const;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2005-03-23 06:35:08 +03:00
|
|
|
/*
|
2011-10-17 18:59:28 +04:00
|
|
|
* The following functions all return true if they were able to
|
|
|
|
* place the float, false if the float did not fit in available
|
2005-03-23 06:35:08 +03:00
|
|
|
* space.
|
2010-08-06 08:59:20 +04:00
|
|
|
* aLineLayout is null when we are reflowing pushed floats (because
|
2009-08-31 22:25:36 +04:00
|
|
|
* they are not associated with a line box).
|
2005-03-23 06:35:08 +03:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool AddFloat(nsLineLayout* aLineLayout, nsIFrame* aFloat,
|
2014-06-20 13:55:35 +04:00
|
|
|
nscoord aAvailableISize);
|
2016-07-15 10:57:40 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool FlowAndPlaceFloat(nsIFrame* aFloat);
|
2016-07-15 10:57:40 +03:00
|
|
|
|
2018-08-23 02:29:22 +03:00
|
|
|
void PlaceBelowCurrentLineFloats(nsLineBox* aLine);
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2014-06-20 13:55:35 +04:00
|
|
|
// Returns the first coordinate >= aBCoord that clears the
|
|
|
|
// floats indicated by aBreakType and has enough inline size between floats
|
2008-05-04 03:33:36 +04:00
|
|
|
// (or no floats remaining) to accomodate aReplacedBlock.
|
2016-09-07 05:20:17 +03:00
|
|
|
nscoord ClearFloats(nscoord aBCoord, mozilla::StyleClear aBreakType,
|
2012-07-30 18:20:58 +04:00
|
|
|
nsIFrame* aReplacedBlock = nullptr, uint32_t aFlags = 0);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2017-02-09 11:59:07 +03:00
|
|
|
nsFloatManager* FloatManager() const {
|
|
|
|
MOZ_ASSERT(mReflowInput.mFloatManager,
|
|
|
|
"Float manager should be valid during the lifetime of "
|
|
|
|
"BlockReflowInput!");
|
|
|
|
return mReflowInput.mFloatManager;
|
|
|
|
}
|
|
|
|
|
2015-08-03 07:03:09 +03:00
|
|
|
// Advances to the next band, i.e., the next horizontal stripe in
|
|
|
|
// which there is a different set of floats.
|
|
|
|
// Return false if it did not advance, which only happens for
|
|
|
|
// constrained heights (and means that we should get pushed to the
|
|
|
|
// next column/page).
|
|
|
|
bool AdvanceToNextBand(const mozilla::LogicalRect& aFloatAvailableSpace,
|
|
|
|
nscoord* aBCoord) const {
|
2016-07-21 13:36:39 +03:00
|
|
|
mozilla::WritingMode wm = mReflowInput.GetWritingMode();
|
2015-08-03 07:03:09 +03:00
|
|
|
if (aFloatAvailableSpace.BSize(wm) > 0) {
|
|
|
|
// See if there's room in the next band.
|
|
|
|
*aBCoord += aFloatAvailableSpace.BSize(wm);
|
|
|
|
} else {
|
2016-07-21 13:36:39 +03:00
|
|
|
if (mReflowInput.AvailableHeight() != NS_UNCONSTRAINEDSIZE) {
|
2015-08-03 07:03:09 +03:00
|
|
|
// Stop trying to clear here; we'll just get pushed to the
|
|
|
|
// next column or page and try again there.
|
|
|
|
return false;
|
|
|
|
}
|
2018-06-18 08:43:11 +03:00
|
|
|
MOZ_ASSERT_UNREACHABLE("avail space rect with zero height!");
|
2015-08-03 07:03:09 +03:00
|
|
|
*aBCoord += 1;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ReplacedBlockFitsInAvailSpace(
|
|
|
|
nsIFrame* aReplacedBlock,
|
|
|
|
const nsFlowAreaRect& aFloatAvailableSpace) const;
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool IsAdjacentWithTop() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mBCoord == mBorderPadding.BStart(mReflowInput.GetWritingMode());
|
1998-12-05 19:02:08 +03:00
|
|
|
}
|
|
|
|
|
2005-04-26 06:26:12 +04:00
|
|
|
/**
|
2014-05-12 15:45:28 +04:00
|
|
|
* Return mBlock's computed physical border+padding with GetSkipSides applied.
|
2005-04-26 06:26:12 +04:00
|
|
|
*/
|
2014-06-20 13:55:35 +04:00
|
|
|
const mozilla::LogicalMargin& BorderPadding() const { return mBorderPadding; }
|
1999-03-05 07:21:32 +03:00
|
|
|
|
2014-06-20 13:55:35 +04:00
|
|
|
// Reconstruct the previous block-end margin that goes before |aLine|.
|
|
|
|
void ReconstructMarginBefore(nsLineList::iterator aLine);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2019-05-11 00:06:48 +03:00
|
|
|
// Caller must have called GetFloatAvailableSpace for the correct position
|
2014-06-20 13:55:35 +04:00
|
|
|
// (which need not be the current mBCoord).
|
2008-04-15 05:05:17 +04:00
|
|
|
void ComputeReplacedBlockOffsetsForFloats(
|
2014-10-22 02:16:13 +04:00
|
|
|
nsIFrame* aFrame, const mozilla::LogicalRect& aFloatAvailableSpace,
|
2015-08-03 07:03:09 +03:00
|
|
|
nscoord& aIStartResult, nscoord& aIEndResult) const;
|
2008-04-15 05:05:17 +04:00
|
|
|
|
2019-05-11 00:06:48 +03:00
|
|
|
// Caller must have called GetFloatAvailableSpace for the current mBCoord
|
1999-08-28 01:45:37 +04:00
|
|
|
void ComputeBlockAvailSpace(nsIFrame* aFrame,
|
2009-04-09 00:52:37 +04:00
|
|
|
const nsFlowAreaRect& aFloatAvailableSpace,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aBlockAvoidsFloats,
|
2014-10-22 02:16:13 +04:00
|
|
|
mozilla::LogicalRect& aResult);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2014-06-20 13:55:35 +04:00
|
|
|
void RecoverStateFrom(nsLineList::iterator aLine, nscoord aDeltaBCoord);
|
1999-04-03 22:59:01 +04:00
|
|
|
|
1999-08-28 01:45:37 +04:00
|
|
|
void AdvanceToNextLine() {
|
2016-08-12 10:28:45 +03:00
|
|
|
if (mFlags.mIsLineLayoutEmpty) {
|
|
|
|
mFlags.mIsLineLayoutEmpty = false;
|
2008-11-27 21:44:47 +03:00
|
|
|
} else {
|
|
|
|
mLineNumber++;
|
|
|
|
}
|
1999-08-28 01:45:37 +04:00
|
|
|
}
|
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
|
|
|
|
|
|
|
// This state is the "global" state computed once for the reflow of
|
|
|
|
// the block.
|
|
|
|
|
|
|
|
// The block frame that is using this object
|
|
|
|
nsBlockFrame* mBlock;
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* mPresContext;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2016-07-21 13:36:39 +03:00
|
|
|
const ReflowInput& mReflowInput;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
// The coordinates within the float manager where the block is being
|
1999-04-03 22:59:01 +04:00
|
|
|
// placed <b>after</b> taking into account the blocks border and
|
|
|
|
// padding. This, therefore, represents the inner "content area" (in
|
2018-06-05 08:33:42 +03:00
|
|
|
// float manager coordinates) where child frames will be placed,
|
2003-10-14 01:51:02 +04:00
|
|
|
// including child blocks and floats.
|
2015-03-22 12:44:48 +03:00
|
|
|
nscoord mFloatManagerI, mFloatManagerB;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// XXX get rid of this
|
1998-12-05 19:02:08 +03:00
|
|
|
nsReflowStatus mReflowStatus;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2009-04-09 00:52:36 +04:00
|
|
|
// The float manager state as it was before the contents of this
|
|
|
|
// block. This is needed for positioning bullets, since we only want
|
|
|
|
// to move the bullet to flow around floats that were before this
|
|
|
|
// block, not floats inside of it.
|
|
|
|
nsFloatManager::SavedState mFloatManagerStateBefore;
|
2008-04-13 21:43:12 +04:00
|
|
|
|
2014-06-20 13:55:35 +04:00
|
|
|
nscoord mBEndEdge;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2010-08-11 23:32:53 +04:00
|
|
|
// The content area to reflow child frames within. This is within
|
2014-06-20 13:55:35 +04:00
|
|
|
// this frame's coordinate system and writing mode, which means
|
|
|
|
// mContentArea.IStart == BorderPadding().IStart and
|
|
|
|
// mContentArea.BStart == BorderPadding().BStart.
|
|
|
|
// The block size may be NS_UNCONSTRAINEDSIZE, which indicates that there
|
2010-08-11 23:32:53 +04:00
|
|
|
// is no page/column boundary below (the common case).
|
2014-06-20 13:55:35 +04:00
|
|
|
// mContentArea.BEnd() should only be called after checking that
|
|
|
|
// mContentArea.BSize is not NS_UNCONSTRAINEDSIZE; otherwise
|
2010-08-11 23:32:53 +04:00
|
|
|
// coordinate overflow may occur.
|
2014-06-20 13:55:35 +04:00
|
|
|
mozilla::LogicalRect mContentArea;
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentIStart() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.IStart(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentISize() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.ISize(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentIEnd() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.IEnd(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentBStart() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.BStart(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentBSize() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.BSize(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-06-30 22:05:28 +04:00
|
|
|
nscoord ContentBEnd() const {
|
2016-07-21 13:36:39 +03:00
|
|
|
return mContentArea.BEnd(mReflowInput.GetWritingMode());
|
2014-06-20 13:55:35 +04:00
|
|
|
}
|
2014-07-24 12:28:46 +04:00
|
|
|
mozilla::LogicalSize ContentSize(mozilla::WritingMode aWM) const {
|
2016-07-21 13:36:39 +03:00
|
|
|
mozilla::WritingMode wm = mReflowInput.GetWritingMode();
|
2014-07-24 12:28:46 +04:00
|
|
|
return mContentArea.Size(wm).ConvertTo(aWM, wm);
|
|
|
|
}
|
2014-11-13 11:58:03 +03:00
|
|
|
|
2015-02-11 12:43:03 +03:00
|
|
|
// Physical size. Use only for physical <-> logical coordinate conversion.
|
|
|
|
nsSize mContainerSize;
|
2015-07-16 12:07:57 +03:00
|
|
|
const nsSize& ContainerSize() const { return mContainerSize; }
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2009-08-31 22:25:36 +04:00
|
|
|
// Continuation out-of-flow float frames that need to move to our
|
2010-08-06 08:59:19 +04:00
|
|
|
// next in flow are placed here during reflow. It's a pointer to
|
|
|
|
// a frame list stored in the block's property table.
|
2010-08-06 08:59:20 +04:00
|
|
|
nsFrameList* mPushedFloats;
|
|
|
|
// This method makes sure pushed floats are accessible to
|
|
|
|
// StealFrame. Call it before adding any frames to mPushedFloats.
|
|
|
|
void SetupPushedFloatList();
|
2014-12-19 19:28:43 +03:00
|
|
|
/**
|
|
|
|
* Append aFloatCont and its next-in-flows within the same block to
|
|
|
|
* mPushedFloats. aFloatCont should not be on any child list when
|
|
|
|
* making this call. Its next-in-flows will be removed from
|
|
|
|
* mBlock using StealFrame() before being added to mPushedFloats.
|
|
|
|
* All appended frames will be marked NS_FRAME_IS_PUSHED_FLOAT.
|
|
|
|
*/
|
|
|
|
void AppendPushedFloatChain(nsIFrame* aFloatCont);
|
2005-03-23 06:35:08 +03:00
|
|
|
|
2007-07-26 08:03:29 +04:00
|
|
|
// Track child overflow continuations.
|
2009-09-14 04:26:01 +04:00
|
|
|
nsOverflowContinuationTracker* mOverflowTracker;
|
2007-07-26 08:03:29 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
1998-09-24 00:10:40 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// This state is "running" state updated by the reflow of each line
|
|
|
|
// in the block. This same state is "recovered" when a line is not
|
|
|
|
// dirty and is passed over during incremental reflow.
|
|
|
|
|
|
|
|
// The current line being reflowed
|
2001-10-25 05:08:40 +04:00
|
|
|
// If it is mBlock->end_lines(), then it is invalid.
|
|
|
|
nsLineList::iterator mCurrentLine;
|
1998-09-24 00:10:40 +04:00
|
|
|
|
2016-08-12 10:28:45 +03:00
|
|
|
// When mHasLineAdjacentToTop is set, this refers to a line
|
2006-02-27 07:15:05 +03:00
|
|
|
// which we know is adjacent to the top of the block (in other words,
|
|
|
|
// all lines before it are empty and do not have clearance. This line is
|
|
|
|
// always before the current line.
|
|
|
|
nsLineList::iterator mLineAdjacentToTop;
|
|
|
|
|
2014-06-20 13:55:35 +04:00
|
|
|
// The current block-direction coordinate in the block
|
|
|
|
nscoord mBCoord;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2014-05-12 15:45:28 +04:00
|
|
|
// mBlock's computed physical border+padding with GetSkipSides applied.
|
2014-06-20 13:55:35 +04:00
|
|
|
mozilla::LogicalMargin mBorderPadding;
|
2014-05-12 15:45:28 +04:00
|
|
|
|
2010-10-07 08:25:45 +04:00
|
|
|
// The overflow areas of all floats placed so far
|
|
|
|
nsOverflowAreas mFloatOverflowAreas;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mFloatCacheFreeList;
|
1999-09-15 04:28:10 +04:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// Previous child. This is used when pulling up a frame to update
|
|
|
|
// the sibling list.
|
|
|
|
nsIFrame* mPrevChild;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
|
|
|
// The previous child frames collapsed bottom margin value.
|
2014-06-20 13:55:35 +04:00
|
|
|
nsCollapsingMargin mPrevBEndMargin;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
// The current next-in-flow for the block. When lines are pulled
|
|
|
|
// from a next-in-flow, this is used to know which next-in-flow to
|
|
|
|
// pull from. When a next-in-flow is emptied of lines, we advance
|
|
|
|
// this to the next next-in-flow.
|
|
|
|
nsBlockFrame* mNextInFlow;
|
1999-03-05 07:21:32 +03:00
|
|
|
|
1999-04-03 22:59:01 +04:00
|
|
|
//----------------------------------------
|
|
|
|
|
2019-04-11 23:51:42 +03:00
|
|
|
// Temporary state, for line-reflow. This state is used during the reflow
|
1999-04-03 22:59:01 +04:00
|
|
|
// of a given line, but doesn't have meaning before or after.
|
1999-09-15 04:28:10 +04:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
// The list of floats that are "current-line" floats. These are
|
1999-09-15 04:28:10 +04:00
|
|
|
// added to the line after the line has been reflowed, to keep the
|
|
|
|
// list fiddling from being N^2.
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mCurrentLineFloats;
|
1999-09-15 04:28:10 +04:00
|
|
|
|
2003-10-14 01:51:02 +04:00
|
|
|
// The list of floats which are "below current-line"
|
|
|
|
// floats. These are reflowed/placed after the line is reflowed
|
1999-09-15 04:28:10 +04:00
|
|
|
// and placed. Again, this is done to keep the list fiddling from
|
|
|
|
// being N^2.
|
2003-10-14 01:51:02 +04:00
|
|
|
nsFloatCacheFreeList mBelowCurrentLineFloats;
|
1999-04-03 22:59:01 +04:00
|
|
|
|
2018-08-21 17:16:50 +03:00
|
|
|
// The list of floats that are waiting on a break opportunity in order to be
|
|
|
|
// placed, since we're on a nowrap context.
|
|
|
|
nsTArray<nsIFrame*> mNoWrapFloats;
|
|
|
|
|
1999-08-28 01:45:37 +04:00
|
|
|
nscoord mMinLineHeight;
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mLineNumber;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2016-08-12 10:28:45 +03:00
|
|
|
Flags mFlags;
|
2016-07-15 10:57:40 +03:00
|
|
|
|
2016-09-07 05:20:17 +03:00
|
|
|
StyleClear mFloatBreakType;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2019-08-15 19:49:14 +03:00
|
|
|
// The amount of computed content block-size "consumed" by our previous
|
|
|
|
// continuations.
|
|
|
|
const nscoord mConsumedBSize;
|
2013-07-25 19:34:12 +04:00
|
|
|
|
2016-08-22 14:42:37 +03:00
|
|
|
// Cache the current line's BSize if nsBlockFrame::PlaceLine() fails to
|
|
|
|
// place the line. When redoing the line, it will be used to query the
|
|
|
|
// accurate float available space in AddFloat() and
|
|
|
|
// nsBlockFrame::PlaceLine().
|
|
|
|
mozilla::Maybe<nscoord> mLineBSize;
|
|
|
|
|
2016-07-15 10:57:40 +03:00
|
|
|
private:
|
|
|
|
bool CanPlaceFloat(nscoord aFloatISize,
|
|
|
|
const nsFlowAreaRect& aFloatAvailableSpace);
|
|
|
|
|
|
|
|
void PushFloatPastBreak(nsIFrame* aFloat);
|
|
|
|
|
|
|
|
void RecoverFloats(nsLineList::iterator aLine, nscoord aDeltaBCoord);
|
1998-09-24 00:10:40 +04:00
|
|
|
};
|
2001-05-01 08:22:57 +04:00
|
|
|
|
2016-07-21 13:36:36 +03:00
|
|
|
}; // namespace mozilla
|
|
|
|
|
2016-07-21 13:36:36 +03:00
|
|
|
#endif // BlockReflowInput_h
|