1998-06-18 20:25:41 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2001-10-25 05:08:40 +04:00
|
|
|
* vim:cindent:ts=2:et:sw=2:
|
1998-06-18 20:25:41 +04:00
|
|
|
*
|
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/.
|
2000-05-03 03:07:11 +04:00
|
|
|
* This Original Code has been modified by IBM Corporation. Modifications made by IBM
|
|
|
|
* described herein are Copyright (c) International Business Machines Corporation, 2000.
|
|
|
|
* Modifications to Mozilla code or documentation identified per MPL Section 3.3
|
|
|
|
*
|
|
|
|
* Date Modified by Description of modification
|
|
|
|
* 04/20/2000 IBM Corp. OS/2 VisualAge build.
|
1998-06-18 20:25:41 +04:00
|
|
|
*/
|
2006-03-29 22:29:03 +04:00
|
|
|
|
|
|
|
/* state and methods used while laying out a single line of a block frame */
|
|
|
|
|
1998-09-15 04:19:49 +04:00
|
|
|
#ifndef nsLineLayout_h___
|
|
|
|
#define nsLineLayout_h___
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2008-07-24 11:16:18 +04:00
|
|
|
#include "gfxTypes.h"
|
2014-11-10 04:25:17 +03:00
|
|
|
#include "JustificationUtils.h"
|
2015-03-26 10:29:31 +03:00
|
|
|
#include "mozilla/WritingModes.h"
|
|
|
|
#include "nsBlockReflowState.h"
|
|
|
|
#include "nsLineBox.h"
|
|
|
|
#include "plarena.h"
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2009-01-05 03:39:54 +03:00
|
|
|
class nsFloatManager;
|
1999-03-19 00:03:25 +03:00
|
|
|
struct nsStyleText;
|
1998-06-18 20:25:41 +04:00
|
|
|
|
1998-09-15 04:19:49 +04:00
|
|
|
class nsLineLayout {
|
1998-06-18 20:25:41 +04:00
|
|
|
public:
|
2014-12-06 02:05:51 +03:00
|
|
|
/**
|
|
|
|
* @param aBaseLineLayout the nsLineLayout for ruby base,
|
|
|
|
* nullptr if no separate base nsLineLayout is needed.
|
|
|
|
*/
|
2004-08-01 03:15:21 +04:00
|
|
|
nsLineLayout(nsPresContext* aPresContext,
|
2009-01-05 03:39:54 +03:00
|
|
|
nsFloatManager* aFloatManager,
|
2007-01-18 04:20:09 +03:00
|
|
|
const nsHTMLReflowState* aOuterReflowState,
|
2014-12-06 02:05:51 +03:00
|
|
|
const nsLineList::iterator* aLine,
|
|
|
|
nsLineLayout* aBaseLineLayout);
|
1998-09-15 04:19:49 +04:00
|
|
|
~nsLineLayout();
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
void Init(nsBlockReflowState* aState, nscoord aMinLineBSize,
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t aLineNumber) {
|
1999-03-19 00:03:25 +03:00
|
|
|
mBlockRS = aState;
|
2014-03-12 00:23:50 +04:00
|
|
|
mMinLineBSize = aMinLineBSize;
|
1999-08-28 01:49:12 +04:00
|
|
|
mLineNumber = aLineNumber;
|
1998-08-05 01:17:56 +04:00
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetLineNumber() const {
|
1999-03-19 00:03:25 +03:00
|
|
|
return mLineNumber;
|
1998-09-23 06:31:00 +04:00
|
|
|
}
|
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
void BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
|
|
|
nscoord aISize, nscoord aBSize,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool aImpactedByFloats,
|
2011-10-18 16:51:58 +04:00
|
|
|
bool aIsTopOfPage,
|
2014-03-12 00:23:50 +04:00
|
|
|
mozilla::WritingMode aWritingMode,
|
2015-02-11 12:43:03 +03:00
|
|
|
const nsSize& aContainerSize);
|
1998-10-27 19:52:10 +03:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
void EndLineReflow();
|
1998-09-30 02:32:04 +04:00
|
|
|
|
2008-06-11 03:53:22 +04:00
|
|
|
/**
|
|
|
|
* Called when a float has been placed. This method updates the
|
|
|
|
* inline frame and span data to account for any change in positions
|
|
|
|
* due to available space for the line boxes changing.
|
|
|
|
* @param aX/aY/aWidth/aHeight are the new available
|
|
|
|
* space rectangle, relative to the containing block.
|
|
|
|
* @param aFloatFrame the float frame that was placed.
|
|
|
|
*/
|
2014-10-22 02:16:13 +04:00
|
|
|
void UpdateBand(mozilla::WritingMode aWM,
|
|
|
|
const mozilla::LogicalRect& aNewAvailableSpace,
|
2003-10-14 01:51:02 +04:00
|
|
|
nsIFrame* aFloatFrame);
|
1998-09-30 02:32:04 +04:00
|
|
|
|
2013-02-23 14:38:15 +04:00
|
|
|
void BeginSpan(nsIFrame* aFrame, const nsHTMLReflowState* aSpanReflowState,
|
|
|
|
nscoord aLeftEdge, nscoord aRightEdge, nscoord* aBaseline);
|
1998-10-10 02:58:25 +04:00
|
|
|
|
2007-12-13 00:51:18 +03:00
|
|
|
// Returns the width of the span
|
|
|
|
nscoord EndSpan(nsIFrame* aFrame);
|
1999-09-03 07:47:49 +04:00
|
|
|
|
2014-12-10 01:49:45 +03:00
|
|
|
// This method attaches the last frame reflowed in this line layout
|
|
|
|
// to that in the base line layout.
|
|
|
|
void AttachLastFrameToBaseLineLayout()
|
|
|
|
{
|
|
|
|
AttachFrameToBaseLineLayout(LastFrame());
|
|
|
|
}
|
|
|
|
|
|
|
|
// This method attaches the root frame of this line layout to the
|
|
|
|
// last reflowed frame in the base line layout.
|
|
|
|
void AttachRootFrameToBaseLineLayout()
|
|
|
|
{
|
|
|
|
AttachFrameToBaseLineLayout(mRootSpan->mFrame);
|
|
|
|
}
|
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t GetCurrentSpanCount() const;
|
1998-10-10 02:58:25 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
void SplitLineTo(int32_t aNewCount);
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
bool IsZeroBSize();
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2011-10-17 18:59:28 +04:00
|
|
|
// Reflows the frame and returns the reflow status. aPushedFrame is true
|
2014-05-13 04:47:53 +04:00
|
|
|
// if the frame is pushed to the next line because it doesn't fit.
|
|
|
|
void ReflowFrame(nsIFrame* aFrame,
|
|
|
|
nsReflowStatus& aReflowStatus,
|
|
|
|
nsHTMLReflowMetrics* aMetrics,
|
|
|
|
bool& aPushedFrame);
|
1998-06-18 20:25:41 +04:00
|
|
|
|
2013-02-23 14:38:15 +04:00
|
|
|
void AddBulletFrame(nsIFrame* aFrame, const nsHTMLReflowMetrics& aMetrics);
|
1998-10-20 04:22:48 +04:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
void RemoveBulletFrame(nsIFrame* aFrame) {
|
|
|
|
PushFrame(aFrame);
|
1998-10-10 08:35:01 +04:00
|
|
|
}
|
|
|
|
|
2014-06-17 18:41:33 +04:00
|
|
|
/**
|
|
|
|
* Place frames in the block direction (CSS property vertical-align)
|
|
|
|
*/
|
|
|
|
void VerticalAlignLine();
|
1998-10-10 08:35:01 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool TrimTrailingWhiteSpace();
|
1998-10-10 08:35:01 +04:00
|
|
|
|
2014-06-17 18:41:33 +04:00
|
|
|
/**
|
|
|
|
* Place frames in the inline direction (CSS property text-align).
|
|
|
|
*/
|
|
|
|
void TextAlignLine(nsLineBox* aLine, bool aIsLastLine);
|
1998-10-10 08:35:01 +04:00
|
|
|
|
2003-07-23 04:14:16 +04:00
|
|
|
/**
|
|
|
|
* Handle all the relative positioning in the line, compute the
|
|
|
|
* combined area (== overflow area) for the line, and handle view
|
2009-04-06 04:31:50 +04:00
|
|
|
* sizing/positioning and the setting of the overflow rect.
|
2003-07-23 04:14:16 +04:00
|
|
|
*/
|
2015-01-15 07:52:27 +03:00
|
|
|
void RelativePositionFrames(nsOverflowAreas& aOverflowAreas)
|
|
|
|
{
|
|
|
|
RelativePositionFrames(mRootSpan, aOverflowAreas);
|
|
|
|
}
|
1998-10-10 08:35:01 +04:00
|
|
|
|
2007-10-02 06:36:26 +04:00
|
|
|
// Support methods for word-wrapping during line reflow
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2014-11-10 04:25:17 +03:00
|
|
|
void SetJustificationInfo(const mozilla::JustificationInfo& aInfo)
|
|
|
|
{
|
|
|
|
mJustificationInfo = aInfo;
|
1998-06-25 20:33:10 +04:00
|
|
|
}
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2008-06-14 12:28:07 +04:00
|
|
|
/**
|
|
|
|
* @return true if so far during reflow no non-empty content has been
|
2010-03-10 03:14:14 +03:00
|
|
|
* placed in the line (according to nsIFrame::IsEmpty())
|
2008-06-14 12:28:07 +04:00
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool LineIsEmpty() const
|
2008-06-14 12:28:07 +04:00
|
|
|
{
|
2012-09-28 05:56:40 +04:00
|
|
|
return mLineIsEmpty;
|
2008-06-14 12:28:07 +04:00
|
|
|
}
|
1998-10-10 08:35:01 +04:00
|
|
|
|
2010-03-10 03:14:14 +03:00
|
|
|
/**
|
|
|
|
* @return true if so far during reflow no non-empty leaf content
|
|
|
|
* (non-collapsed whitespace, replaced element, inline-block, etc) has been
|
|
|
|
* placed in the line
|
|
|
|
*/
|
2011-09-29 10:19:26 +04:00
|
|
|
bool LineAtStart() const
|
2010-03-10 03:14:14 +03:00
|
|
|
{
|
2012-09-28 05:56:40 +04:00
|
|
|
return mLineAtStart;
|
2010-03-10 03:14:14 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool LineIsBreakable() const;
|
1999-03-21 04:14:05 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetLineEndsInBR() const
|
2000-04-17 18:40:46 +04:00
|
|
|
{
|
2012-09-28 05:56:40 +04:00
|
|
|
return mLineEndsInBR;
|
2000-04-17 18:40:46 +04:00
|
|
|
}
|
1999-10-29 18:33:26 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetLineEndsInBR(bool aOn)
|
2000-04-17 18:40:46 +04:00
|
|
|
{
|
2012-09-28 05:56:40 +04:00
|
|
|
mLineEndsInBR = aOn;
|
2000-04-17 18:40:46 +04:00
|
|
|
}
|
1999-10-29 18:33:26 +04:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
//----------------------------------------
|
|
|
|
// Inform the line-layout about the presence of a floating frame
|
|
|
|
// XXX get rid of this: use get-frame-type?
|
2014-10-22 02:16:13 +04:00
|
|
|
bool AddFloat(nsIFrame* aFloat, nscoord aAvailableISize)
|
2009-08-31 22:25:35 +04:00
|
|
|
{
|
2014-11-26 07:52:49 +03:00
|
|
|
// When reflowing ruby text frames, no block reflow state is
|
|
|
|
// provided to the line layout. However, floats should never be
|
|
|
|
// associated with ruby text containers, hence this method should
|
|
|
|
// not be called in that case.
|
2015-02-10 01:34:50 +03:00
|
|
|
MOZ_ASSERT(mBlockRS,
|
|
|
|
"Should not call this method if there is no block reflow state "
|
|
|
|
"available");
|
2014-10-22 02:16:13 +04:00
|
|
|
return mBlockRS->AddFloat(this, aFloat, aAvailableISize);
|
2001-05-01 08:22:57 +04:00
|
|
|
}
|
1998-06-25 20:33:10 +04:00
|
|
|
|
2014-10-22 02:16:11 +04:00
|
|
|
void SetTrimmableISize(nscoord aTrimmableISize) {
|
|
|
|
mTrimmableISize = aTrimmableISize;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
//----------------------------------------
|
1998-06-28 02:56:09 +04:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetFirstLetterStyleOK() const {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mFirstLetterStyleOK;
|
1998-11-05 22:30:31 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetFirstLetterStyleOK(bool aSetting) {
|
2012-09-28 05:56:40 +04:00
|
|
|
mFirstLetterStyleOK = aSetting;
|
1998-11-05 22:30:31 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetInFirstLetter() const {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mInFirstLetter;
|
2009-01-05 03:36:56 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetInFirstLetter(bool aSetting) {
|
2012-09-28 05:56:40 +04:00
|
|
|
mInFirstLetter = aSetting;
|
2009-01-05 03:36:56 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetInFirstLine() const {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mInFirstLine;
|
2007-01-18 04:20:09 +03:00
|
|
|
}
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
void SetInFirstLine(bool aSetting) {
|
2012-09-28 05:56:40 +04:00
|
|
|
mInFirstLine = aSetting;
|
2007-01-18 04:20:09 +03:00
|
|
|
}
|
|
|
|
|
2009-10-27 04:43:56 +03:00
|
|
|
// Calling this during block reflow ensures that the next line of inlines
|
|
|
|
// will be marked dirty, if there is one.
|
|
|
|
void SetDirtyNextLine() {
|
2012-09-28 05:56:40 +04:00
|
|
|
mDirtyNextLine = true;
|
2009-10-27 04:43:56 +03:00
|
|
|
}
|
2011-09-29 10:19:26 +04:00
|
|
|
bool GetDirtyNextLine() {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mDirtyNextLine;
|
2009-10-27 04:43:56 +03:00
|
|
|
}
|
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
//----------------------------------------
|
|
|
|
|
2004-08-01 03:15:21 +04:00
|
|
|
nsPresContext* mPresContext;
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2006-10-19 05:47:47 +04:00
|
|
|
/**
|
|
|
|
* Record where an optional break could have been placed. During line reflow,
|
|
|
|
* frames containing optional break points (e.g., whitespace in text frames)
|
|
|
|
* can call SetLastOptionalBreakPosition to record where a break could
|
2007-02-21 04:52:03 +03:00
|
|
|
* have been made, but wasn't because we decided to place more content on
|
2014-11-14 08:41:14 +03:00
|
|
|
* the line. For non-text frames, offset 0 means before the frame, offset
|
|
|
|
* INT32_MAX means after the frame.
|
2006-10-19 05:47:47 +04:00
|
|
|
*
|
|
|
|
* Currently this is used to handle cases where a single word comprises
|
|
|
|
* multiple frames, and the first frame fits on the line but the whole word
|
|
|
|
* doesn't. We look back to the last optional break position and
|
|
|
|
* reflow the whole line again, forcing a break at that position. The last
|
|
|
|
* optional break position could be in a text frame or else after a frame
|
|
|
|
* that cannot be part of a text run, so those are the positions we record.
|
2014-11-14 08:41:14 +03:00
|
|
|
*
|
|
|
|
* @param aFrame the frame which contains the optional break position.
|
2006-10-19 05:47:47 +04:00
|
|
|
*
|
2007-02-21 04:52:03 +03:00
|
|
|
* @param aFits set to true if the break position is within the available width.
|
2006-10-19 05:47:47 +04:00
|
|
|
*
|
2008-07-24 11:16:18 +04:00
|
|
|
* @param aPriority the priority of the break opportunity. If we are
|
|
|
|
* prioritizing break opportunities, we will not set a break if we have
|
|
|
|
* already set a break with a higher priority. @see gfxBreakPriority.
|
|
|
|
*
|
2011-10-17 18:59:28 +04:00
|
|
|
* @return true if we are actually reflowing with forced break position and we
|
2006-10-19 05:47:47 +04:00
|
|
|
* should break here
|
|
|
|
*/
|
2014-11-14 08:41:14 +03:00
|
|
|
bool NotifyOptionalBreakPosition(nsIFrame* aFrame, int32_t aOffset,
|
|
|
|
bool aFits, gfxBreakPriority aPriority) {
|
2012-09-28 05:56:40 +04:00
|
|
|
NS_ASSERTION(!aFits || !mNeedBackup,
|
2007-12-07 12:17:19 +03:00
|
|
|
"Shouldn't be updating the break position with a break that fits after we've already flagged an overrun");
|
2007-02-21 04:52:03 +03:00
|
|
|
// Remember the last break position that fits; if there was no break that fit,
|
|
|
|
// just remember the first break
|
2008-07-24 11:16:18 +04:00
|
|
|
if ((aFits && aPriority >= mLastOptionalBreakPriority) ||
|
2014-11-14 08:41:14 +03:00
|
|
|
!mLastOptionalBreakFrame) {
|
|
|
|
mLastOptionalBreakFrame = aFrame;
|
|
|
|
mLastOptionalBreakFrameOffset = aOffset;
|
2008-07-24 11:16:18 +04:00
|
|
|
mLastOptionalBreakPriority = aPriority;
|
2007-02-21 04:52:03 +03:00
|
|
|
}
|
2014-11-14 08:41:14 +03:00
|
|
|
return aFrame && mForceBreakFrame == aFrame &&
|
|
|
|
mForceBreakFrameOffset == aOffset;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
|
|
|
/**
|
2012-09-28 05:56:40 +04:00
|
|
|
* Like NotifyOptionalBreakPosition, but here it's OK for mNeedBackup
|
2006-10-19 05:47:47 +04:00
|
|
|
* to be set, because the caller is merely pruning some saved break position(s)
|
|
|
|
* that are actually not feasible.
|
|
|
|
*/
|
2014-11-14 08:41:14 +03:00
|
|
|
void RestoreSavedBreakPosition(nsIFrame* aFrame, int32_t aOffset,
|
2008-07-24 11:16:18 +04:00
|
|
|
gfxBreakPriority aPriority) {
|
2014-11-14 08:41:14 +03:00
|
|
|
mLastOptionalBreakFrame = aFrame;
|
|
|
|
mLastOptionalBreakFrameOffset = aOffset;
|
2008-07-24 11:16:18 +04:00
|
|
|
mLastOptionalBreakPriority = aPriority;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
2007-02-21 04:52:03 +03:00
|
|
|
/**
|
|
|
|
* Signal that no backing up will be required after all.
|
|
|
|
*/
|
2006-10-19 05:47:47 +04:00
|
|
|
void ClearOptionalBreakPosition() {
|
2012-09-28 05:56:40 +04:00
|
|
|
mNeedBackup = false;
|
2014-11-14 08:41:14 +03:00
|
|
|
mLastOptionalBreakFrame = nullptr;
|
|
|
|
mLastOptionalBreakFrameOffset = -1;
|
2014-01-23 22:26:39 +04:00
|
|
|
mLastOptionalBreakPriority = gfxBreakPriority::eNoBreak;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
|
|
|
// Retrieve last set optional break position. When this returns null, no
|
|
|
|
// optional break has been recorded (which means that the line can't break yet).
|
2014-11-14 08:41:14 +03:00
|
|
|
nsIFrame* GetLastOptionalBreakPosition(int32_t* aOffset,
|
|
|
|
gfxBreakPriority* aPriority) {
|
|
|
|
*aOffset = mLastOptionalBreakFrameOffset;
|
2008-07-24 11:16:18 +04:00
|
|
|
*aPriority = mLastOptionalBreakPriority;
|
2014-11-14 08:41:14 +03:00
|
|
|
return mLastOptionalBreakFrame;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
2015-02-11 02:26:56 +03:00
|
|
|
// Whether any optional break position has been recorded.
|
|
|
|
bool HasOptionalBreakPosition() const
|
|
|
|
{
|
|
|
|
return mLastOptionalBreakFrame != nullptr;
|
|
|
|
}
|
2015-03-11 06:14:48 +03:00
|
|
|
// Get the priority of the last optional break position recorded.
|
|
|
|
gfxBreakPriority LastOptionalBreakPriority() const
|
|
|
|
{
|
|
|
|
return mLastOptionalBreakPriority;
|
|
|
|
}
|
2006-10-19 05:47:47 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check whether frames overflowed the available width and CanPlaceFrame
|
|
|
|
* requested backing up to a saved break position.
|
|
|
|
*/
|
2012-09-28 05:56:40 +04:00
|
|
|
bool NeedsBackup() { return mNeedBackup; }
|
2006-10-19 05:47:47 +04:00
|
|
|
|
|
|
|
// Line layout may place too much content on a line, overflowing its available
|
|
|
|
// width. When that happens, if SetLastOptionalBreakPosition has been
|
|
|
|
// used to record an optional break that wasn't taken, we can reflow the line
|
|
|
|
// again and force the break to happen at that point (i.e., backtracking
|
|
|
|
// to the last choice point).
|
|
|
|
|
|
|
|
// Record that we want to break at the given content+offset (which
|
|
|
|
// should have been previously returned by GetLastOptionalBreakPosition
|
|
|
|
// from another nsLineLayout).
|
2014-11-14 08:41:14 +03:00
|
|
|
void ForceBreakAtPosition(nsIFrame* aFrame, int32_t aOffset) {
|
|
|
|
mForceBreakFrame = aFrame;
|
|
|
|
mForceBreakFrameOffset = aOffset;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
2014-11-14 08:41:14 +03:00
|
|
|
bool HaveForcedBreakPosition() { return mForceBreakFrame != nullptr; }
|
|
|
|
int32_t GetForcedBreakPosition(nsIFrame* aFrame) {
|
|
|
|
return mForceBreakFrame == aFrame ? mForceBreakFrameOffset : -1;
|
2006-10-19 05:47:47 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This can't be null. It usually returns a block frame but may return
|
|
|
|
* some other kind of frame when inline frames are reflowed in a non-block
|
2008-07-30 09:11:26 +04:00
|
|
|
* context (e.g. MathML or floating first-letter).
|
2006-10-19 05:47:47 +04:00
|
|
|
*/
|
2013-04-23 05:45:26 +04:00
|
|
|
nsIFrame* LineContainerFrame() const { return mBlockReflowState->frame; }
|
|
|
|
const nsHTMLReflowState* LineContainerRS() const { return mBlockReflowState; }
|
2007-01-18 04:20:09 +03:00
|
|
|
const nsLineList::iterator* GetLine() const {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mGotLineBox ? &mLineBox : nullptr;
|
2007-01-18 04:20:09 +03:00
|
|
|
}
|
2010-08-06 08:59:20 +04:00
|
|
|
nsLineList::iterator* GetLine() {
|
2012-09-28 05:56:40 +04:00
|
|
|
return mGotLineBox ? &mLineBox : nullptr;
|
2010-08-06 08:59:20 +04:00
|
|
|
}
|
2007-05-21 07:44:26 +04:00
|
|
|
|
|
|
|
/**
|
2008-06-20 08:39:56 +04:00
|
|
|
* Returns the accumulated advance width of frames before the current frame
|
|
|
|
* on the line, plus the line container's left border+padding.
|
|
|
|
* This is always positive, the advance width is measured from
|
2007-05-21 07:44:26 +04:00
|
|
|
* the right edge for RTL blocks and from the left edge for LTR blocks.
|
2008-06-20 08:39:56 +04:00
|
|
|
* In other words, the current frame's distance from the line container's
|
|
|
|
* start content edge is:
|
2014-03-12 00:23:50 +04:00
|
|
|
* <code>GetCurrentFrameInlineDistanceFromBlock() - lineContainer->GetUsedBorderAndPadding().left</code>
|
2008-06-20 08:39:56 +04:00
|
|
|
* Note the use of <code>.left</code> for both LTR and RTL line containers.
|
2007-05-21 07:44:26 +04:00
|
|
|
*/
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord GetCurrentFrameInlineDistanceFromBlock();
|
2007-01-18 04:20:09 +03:00
|
|
|
|
2014-08-15 21:34:20 +04:00
|
|
|
/**
|
|
|
|
* Move the inline position where the next frame will be reflowed forward by
|
|
|
|
* aAmount.
|
|
|
|
*/
|
2015-01-15 07:52:27 +03:00
|
|
|
void AdvanceICoord(nscoord aAmount) { mCurrentSpan->mICoord += aAmount; }
|
2014-08-15 21:34:20 +04:00
|
|
|
/**
|
|
|
|
* Returns the writing mode for the root span.
|
|
|
|
*/
|
2015-01-15 07:52:27 +03:00
|
|
|
mozilla::WritingMode GetWritingMode() { return mRootSpan->mWritingMode; }
|
2014-08-15 21:34:20 +04:00
|
|
|
/**
|
|
|
|
* Returns the inline position where the next frame will be reflowed.
|
|
|
|
*/
|
2015-01-15 07:52:27 +03:00
|
|
|
nscoord GetCurrentICoord() { return mCurrentSpan->mICoord; }
|
2014-08-15 21:34:20 +04:00
|
|
|
|
2015-02-18 07:20:02 +03:00
|
|
|
void SetSuppressLineWrap(bool aEnabled) { mSuppressLineWrap = aEnabled; }
|
|
|
|
|
1998-06-28 02:56:09 +04:00
|
|
|
protected:
|
1999-03-19 00:03:25 +03:00
|
|
|
// This state is constant for a given block frame doing line layout
|
2009-01-05 03:39:54 +03:00
|
|
|
nsFloatManager* mFloatManager;
|
2001-10-25 05:08:40 +04:00
|
|
|
const nsStyleText* mStyleText; // for the block
|
1999-03-19 00:03:25 +03:00
|
|
|
const nsHTMLReflowState* mBlockReflowState;
|
2002-09-25 02:13:20 +04:00
|
|
|
|
2015-01-13 07:14:46 +03:00
|
|
|
// The line layout for the base text. It is usually nullptr.
|
|
|
|
// It becomes not null when the current line layout is for ruby
|
|
|
|
// annotations. When there is nested ruby inside annotation, it
|
|
|
|
// forms a linked list from the inner annotation to the outermost
|
|
|
|
// line layout. The outermost line layout, which has this member
|
|
|
|
// being nullptr, is responsible for managing the life cycle of
|
|
|
|
// per-frame data and per-span data, and handling floats.
|
2014-12-06 02:05:51 +03:00
|
|
|
nsLineLayout* const mBaseLineLayout;
|
|
|
|
|
2015-01-13 07:14:46 +03:00
|
|
|
nsLineLayout* GetOutermostLineLayout() {
|
|
|
|
nsLineLayout* lineLayout = this;
|
|
|
|
while (lineLayout->mBaseLineLayout) {
|
|
|
|
lineLayout = lineLayout->mBaseLineLayout;
|
|
|
|
}
|
|
|
|
return lineLayout;
|
|
|
|
}
|
|
|
|
|
2014-11-14 08:41:14 +03:00
|
|
|
nsIFrame* mLastOptionalBreakFrame;
|
|
|
|
nsIFrame* mForceBreakFrame;
|
2006-10-19 05:47:47 +04:00
|
|
|
|
2002-09-25 02:13:20 +04:00
|
|
|
// XXX remove this when landing bug 154892 (splitting absolute positioned frames)
|
|
|
|
friend class nsInlineFrame;
|
|
|
|
|
2014-11-26 07:52:49 +03:00
|
|
|
// XXX Take care that nsRubyBaseContainer would give nullptr to this
|
|
|
|
// member. It should not be a problem currently, since the only
|
|
|
|
// code use it is handling float, which does not affect ruby.
|
|
|
|
// See comment in nsLineLayout::AddFloat
|
2015-11-19 10:00:25 +03:00
|
|
|
nsBlockReflowState* mBlockRS;/* XXX hack! */
|
|
|
|
|
2007-01-18 04:20:09 +03:00
|
|
|
nsLineList::iterator mLineBox;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
// Per-frame data recorded by the line-layout reflow logic. This
|
|
|
|
// state is the state needed to post-process the line after reflow
|
2014-03-12 00:23:50 +04:00
|
|
|
// has completed (block-direction alignment, inline-direction alignment,
|
1999-03-19 00:03:25 +03:00
|
|
|
// justification and relative positioning).
|
1999-03-31 08:21:53 +04:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
struct PerSpanData;
|
1999-04-13 00:12:15 +04:00
|
|
|
struct PerFrameData;
|
|
|
|
friend struct PerSpanData;
|
|
|
|
friend struct PerFrameData;
|
2014-03-12 00:23:50 +04:00
|
|
|
struct PerFrameData
|
|
|
|
{
|
2014-09-01 07:36:37 +04:00
|
|
|
explicit PerFrameData(mozilla::WritingMode aWritingMode)
|
2014-03-12 00:23:50 +04:00
|
|
|
: mBounds(aWritingMode)
|
|
|
|
, mMargin(aWritingMode)
|
|
|
|
, mBorderPadding(aWritingMode)
|
|
|
|
, mOffsets(aWritingMode)
|
|
|
|
{}
|
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
// link to next/prev frame in same span
|
|
|
|
PerFrameData* mNext;
|
|
|
|
PerFrameData* mPrev;
|
|
|
|
|
2014-12-06 02:57:12 +03:00
|
|
|
// Link to the frame of next ruby annotation. It is a linked list
|
|
|
|
// through this pointer from ruby base to all its annotations. It
|
|
|
|
// could be nullptr if there is no more annotation.
|
|
|
|
// If PFD_ISLINKEDTOBASE is set, the current PFD is one of the ruby
|
|
|
|
// annotations in the base's list, otherwise it is the ruby base,
|
|
|
|
// and its mNextAnnotation is the start of the linked list.
|
|
|
|
PerFrameData* mNextAnnotation;
|
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
// pointer to child span data if this is an inline container frame
|
|
|
|
PerSpanData* mSpan;
|
|
|
|
|
2009-02-20 00:55:48 +03:00
|
|
|
// The frame
|
1999-03-19 00:03:25 +03:00
|
|
|
nsIFrame* mFrame;
|
|
|
|
|
|
|
|
// From metrics
|
2007-01-23 07:06:56 +03:00
|
|
|
nscoord mAscent;
|
2014-03-12 00:23:50 +04:00
|
|
|
// note that mBounds is a logical rect in the *line*'s writing mode.
|
|
|
|
// When setting frame coordinates, we have to convert to the frame's
|
|
|
|
// writing mode
|
|
|
|
mozilla::LogicalRect mBounds;
|
2010-10-07 08:25:45 +04:00
|
|
|
nsOverflowAreas mOverflowAreas;
|
1999-03-19 00:03:25 +03:00
|
|
|
|
|
|
|
// From reflow-state
|
2014-11-13 11:58:02 +03:00
|
|
|
mozilla::LogicalMargin mMargin; // in *line* writing mode
|
|
|
|
mozilla::LogicalMargin mBorderPadding; // in *line* writing mode
|
|
|
|
mozilla::LogicalMargin mOffsets; // in *frame* writing mode
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2000-04-17 18:40:46 +04:00
|
|
|
// state for text justification
|
2014-12-15 01:57:36 +03:00
|
|
|
// Note that, although all frames would have correct inner
|
|
|
|
// opportunities computed after ComputeFrameJustification, start
|
|
|
|
// and end justifiable info are not reliable for non-text frames.
|
2014-11-10 04:25:17 +03:00
|
|
|
mozilla::JustificationInfo mJustificationInfo;
|
|
|
|
mozilla::JustificationAssignment mJustificationAssignment;
|
2002-11-06 05:03:43 +03:00
|
|
|
|
2014-12-23 02:22:26 +03:00
|
|
|
// PerFrameData flags
|
|
|
|
bool mRelativePos : 1;
|
|
|
|
bool mIsTextFrame : 1;
|
|
|
|
bool mIsNonEmptyTextFrame : 1;
|
|
|
|
bool mIsNonWhitespaceTextFrame : 1;
|
|
|
|
bool mIsLetterFrame : 1;
|
|
|
|
bool mRecomputeOverflow : 1;
|
|
|
|
bool mIsBullet : 1;
|
|
|
|
bool mSkipWhenTrimmingWhitespace : 1;
|
|
|
|
bool mIsEmpty : 1;
|
|
|
|
bool mIsLinkedToBase : 1;
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2014-11-10 04:25:17 +03:00
|
|
|
// Other state we use
|
|
|
|
uint8_t mBlockDirAlign;
|
|
|
|
|
1999-09-21 04:14:22 +04:00
|
|
|
PerFrameData* Last() {
|
|
|
|
PerFrameData* pfd = this;
|
|
|
|
while (pfd->mNext) {
|
|
|
|
pfd = pfd->mNext;
|
|
|
|
}
|
|
|
|
return pfd;
|
|
|
|
}
|
2014-11-10 04:25:17 +03:00
|
|
|
|
|
|
|
bool IsStartJustifiable() const
|
|
|
|
{
|
|
|
|
return mJustificationInfo.mIsStartJustifiable;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IsEndJustifiable() const
|
|
|
|
{
|
|
|
|
return mJustificationInfo.mIsEndJustifiable;
|
|
|
|
}
|
|
|
|
|
2015-01-07 04:47:09 +03:00
|
|
|
bool ParticipatesInJustification() const;
|
1999-03-19 00:03:25 +03:00
|
|
|
};
|
2002-08-14 17:00:16 +04:00
|
|
|
PerFrameData* mFrameFreeList;
|
1999-03-19 00:03:25 +03:00
|
|
|
|
|
|
|
struct PerSpanData {
|
2002-08-14 17:00:16 +04:00
|
|
|
union {
|
|
|
|
PerSpanData* mParent;
|
|
|
|
PerSpanData* mNextFreeSpan;
|
|
|
|
};
|
1999-03-19 00:03:25 +03:00
|
|
|
PerFrameData* mFrame;
|
|
|
|
PerFrameData* mFirstFrame;
|
|
|
|
PerFrameData* mLastFrame;
|
|
|
|
|
|
|
|
const nsHTMLReflowState* mReflowState;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mNoWrap;
|
2014-03-12 00:23:50 +04:00
|
|
|
mozilla::WritingMode mWritingMode;
|
2011-09-29 10:19:26 +04:00
|
|
|
bool mContainsFloat;
|
|
|
|
bool mHasNonemptyContent;
|
1999-03-22 23:45:09 +03:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord mIStart;
|
|
|
|
nscoord mICoord;
|
|
|
|
nscoord mIEnd;
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord mBStartLeading, mBEndLeading;
|
|
|
|
nscoord mLogicalBSize;
|
|
|
|
nscoord mMinBCoord, mMaxBCoord;
|
2011-08-03 22:30:58 +04:00
|
|
|
nscoord* mBaseline;
|
1999-03-19 00:03:25 +03:00
|
|
|
|
|
|
|
void AppendFrame(PerFrameData* pfd) {
|
2012-07-30 18:20:58 +04:00
|
|
|
if (nullptr == mLastFrame) {
|
1999-03-19 00:03:25 +03:00
|
|
|
mFirstFrame = pfd;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
mLastFrame->mNext = pfd;
|
|
|
|
pfd->mPrev = mLastFrame;
|
|
|
|
}
|
|
|
|
mLastFrame = pfd;
|
|
|
|
}
|
|
|
|
};
|
2002-08-14 17:00:16 +04:00
|
|
|
PerSpanData* mSpanFreeList;
|
1999-03-19 00:03:25 +03:00
|
|
|
PerSpanData* mRootSpan;
|
|
|
|
PerSpanData* mCurrentSpan;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2015-07-16 12:07:57 +03:00
|
|
|
// The container size to use when converting between logical and
|
2014-10-22 16:14:41 +04:00
|
|
|
// physical coordinates for frames in this span. For the root span
|
2015-07-16 12:07:57 +03:00
|
|
|
// this is the size of the block cached in mContainerSize; for
|
|
|
|
// child spans it's the size of the root span.
|
|
|
|
nsSize ContainerSizeForSpan(PerSpanData* aPSD) {
|
2014-10-22 16:14:41 +04:00
|
|
|
return (aPSD == mRootSpan)
|
2015-07-16 12:07:57 +03:00
|
|
|
? mContainerSize
|
|
|
|
: aPSD->mFrame->mBounds.Size(mRootSpan->mWritingMode).
|
|
|
|
GetPhysicalSize(mRootSpan->mWritingMode);
|
2014-10-22 16:14:41 +04:00
|
|
|
}
|
|
|
|
|
2009-05-12 12:53:06 +04:00
|
|
|
gfxBreakPriority mLastOptionalBreakPriority;
|
2014-11-14 08:41:14 +03:00
|
|
|
int32_t mLastOptionalBreakFrameOffset;
|
|
|
|
int32_t mForceBreakFrameOffset;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord mMinLineBSize;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
|
|
|
// The amount of text indent that we applied to this line, needed for
|
|
|
|
// max-element-size calculation.
|
|
|
|
nscoord mTextIndent;
|
|
|
|
|
|
|
|
// This state varies during the reflow of a line but is line
|
|
|
|
// "global" state not span "local" state.
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mLineNumber;
|
2014-11-10 04:25:17 +03:00
|
|
|
mozilla::JustificationInfo mJustificationInfo;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mTotalPlacedFrames;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord mBStartEdge;
|
|
|
|
nscoord mMaxStartBoxBSize;
|
|
|
|
nscoord mMaxEndBoxBSize;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2011-11-24 06:48:23 +04:00
|
|
|
nscoord mInflationMinFontSize;
|
|
|
|
|
2014-06-17 18:41:33 +04:00
|
|
|
// Final computed line-bSize value after VerticalAlignFrames for
|
2009-05-12 12:53:06 +04:00
|
|
|
// the block has been called.
|
2014-03-12 00:23:50 +04:00
|
|
|
nscoord mFinalLineBSize;
|
2009-05-12 12:53:06 +04:00
|
|
|
|
2014-10-22 02:16:11 +04:00
|
|
|
// Amount of trimmable whitespace inline size for the trailing text
|
|
|
|
// frame, if any
|
|
|
|
nscoord mTrimmableISize;
|
2009-05-12 12:53:06 +04: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; }
|
2014-03-12 00:23:50 +04:00
|
|
|
|
2012-09-28 05:56:40 +04:00
|
|
|
bool mFirstLetterStyleOK : 1;
|
|
|
|
bool mIsTopOfPage : 1;
|
|
|
|
bool mImpactedByFloats : 1;
|
|
|
|
bool mLastFloatWasLetterFrame : 1;
|
|
|
|
bool mLineIsEmpty : 1;
|
|
|
|
bool mLineEndsInBR : 1;
|
|
|
|
bool mNeedBackup : 1;
|
|
|
|
bool mInFirstLine : 1;
|
|
|
|
bool mGotLineBox : 1;
|
|
|
|
bool mInFirstLetter : 1;
|
|
|
|
bool mHasBullet : 1;
|
|
|
|
bool mDirtyNextLine : 1;
|
|
|
|
bool mLineAtStart : 1;
|
2014-12-13 03:48:30 +03:00
|
|
|
bool mHasRuby : 1;
|
2015-02-18 07:20:02 +03:00
|
|
|
bool mSuppressLineWrap : 1;
|
2012-09-28 05:56:40 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mSpanDepth;
|
2002-08-14 17:00:16 +04:00
|
|
|
#ifdef DEBUG
|
2012-08-22 19:56:38 +04:00
|
|
|
int32_t mSpansAllocated, mSpansFreed;
|
|
|
|
int32_t mFramesAllocated, mFramesFreed;
|
2002-08-14 17:00:16 +04:00
|
|
|
#endif
|
2009-05-12 12:53:06 +04:00
|
|
|
PLArenaPool mArena; // Per span and per frame data, 4 byte aligned
|
|
|
|
|
2013-02-23 14:38:15 +04:00
|
|
|
/**
|
|
|
|
* Allocate a PerFrameData from the mArena pool. The allocation is infallible.
|
|
|
|
*/
|
2014-03-12 00:23:50 +04:00
|
|
|
PerFrameData* NewPerFrameData(nsIFrame* aFrame);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2013-02-23 14:38:15 +04:00
|
|
|
/**
|
|
|
|
* Allocate a PerSpanData from the mArena pool. The allocation is infallible.
|
|
|
|
*/
|
|
|
|
PerSpanData* NewPerSpanData();
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2014-12-10 01:49:45 +03:00
|
|
|
PerFrameData* LastFrame() const { return mCurrentSpan->mLastFrame; }
|
|
|
|
|
2014-12-09 01:14:49 +03:00
|
|
|
/**
|
|
|
|
* Unlink the given PerFrameData and all the siblings after it from
|
|
|
|
* the span. The unlinked PFDs are usually freed immediately.
|
|
|
|
* However, if PFD_ISLINKEDTOBASE is set, it won't be freed until
|
|
|
|
* the frame of its base is unlinked.
|
|
|
|
*/
|
|
|
|
void UnlinkFrame(PerFrameData* pfd);
|
|
|
|
|
2014-12-09 01:30:23 +03:00
|
|
|
/**
|
|
|
|
* Free the given PerFrameData.
|
|
|
|
*/
|
|
|
|
void FreeFrame(PerFrameData* pfd);
|
|
|
|
|
2002-08-14 17:00:16 +04:00
|
|
|
void FreeSpan(PerSpanData* psd);
|
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool InBlockContext() const {
|
1999-03-19 00:03:25 +03:00
|
|
|
return mSpanDepth == 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void PushFrame(nsIFrame* aFrame);
|
|
|
|
|
2014-05-20 18:04:54 +04:00
|
|
|
void AllowForStartMargin(PerFrameData* pfd,
|
|
|
|
nsHTMLReflowState& aReflowState);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2015-02-17 04:25:18 +03:00
|
|
|
void SyncAnnotationBounds(PerFrameData* aRubyFrame);
|
2015-01-07 04:47:09 +03:00
|
|
|
|
2011-09-29 10:19:26 +04:00
|
|
|
bool CanPlaceFrame(PerFrameData* pfd,
|
|
|
|
bool aNotSafeToBreak,
|
|
|
|
bool aFrameCanContinueTextRun,
|
|
|
|
bool aCanRollBackBeforeFrame,
|
1999-03-19 00:03:25 +03:00
|
|
|
nsHTMLReflowMetrics& aMetrics,
|
2007-12-07 12:17:19 +03:00
|
|
|
nsReflowStatus& aStatus,
|
2011-09-29 10:19:26 +04:00
|
|
|
bool* aOptionalBreakAfterFits);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
|
|
|
void PlaceFrame(PerFrameData* pfd,
|
|
|
|
nsHTMLReflowMetrics& aMetrics);
|
|
|
|
|
2014-06-17 18:41:33 +04:00
|
|
|
void VerticalAlignFrames(PerSpanData* psd);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2014-06-17 18:41:33 +04:00
|
|
|
void PlaceTopBottomFrames(PerSpanData* psd,
|
|
|
|
nscoord aDistanceFromStart,
|
|
|
|
nscoord aLineBSize);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2015-01-13 12:04:41 +03:00
|
|
|
void ApplyRelativePositioning(PerFrameData* aPFD);
|
|
|
|
|
2015-01-13 12:04:41 +03:00
|
|
|
void RelativePositionAnnotations(PerSpanData* aRubyPSD,
|
|
|
|
nsOverflowAreas& aOverflowAreas);
|
|
|
|
|
2010-10-07 08:25:45 +04:00
|
|
|
void RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflowAreas);
|
1999-03-19 00:03:25 +03:00
|
|
|
|
2014-03-12 00:23:50 +04:00
|
|
|
bool TrimTrailingWhiteSpaceIn(PerSpanData* psd, nscoord* aDeltaISize);
|
1999-09-21 04:14:22 +04:00
|
|
|
|
2014-11-10 04:25:17 +03:00
|
|
|
struct JustificationComputationState;
|
2015-02-17 08:01:49 +03:00
|
|
|
|
|
|
|
static int AssignInterframeJustificationGaps(
|
|
|
|
PerFrameData* aFrame, JustificationComputationState& aState);
|
|
|
|
|
2014-11-10 04:25:17 +03:00
|
|
|
int32_t ComputeFrameJustification(PerSpanData* psd,
|
|
|
|
JustificationComputationState& aState);
|
2006-04-12 05:07:01 +04:00
|
|
|
|
2014-12-09 09:43:24 +03:00
|
|
|
void AdvanceAnnotationInlineBounds(PerFrameData* aPFD,
|
2015-07-16 12:07:57 +03:00
|
|
|
const nsSize& aContainerSize,
|
2014-12-09 09:43:24 +03:00
|
|
|
nscoord aDeltaICoord,
|
|
|
|
nscoord aDeltaISize);
|
|
|
|
|
|
|
|
void ApplyLineJustificationToAnnotations(PerFrameData* aPFD,
|
|
|
|
nscoord aDeltaICoord,
|
|
|
|
nscoord aDeltaISize);
|
|
|
|
|
2006-04-12 05:07:01 +04:00
|
|
|
// Apply justification. The return value is the amount by which the width of
|
|
|
|
// the span corresponding to aPSD got increased due to justification.
|
2014-11-10 04:25:17 +03:00
|
|
|
nscoord ApplyFrameJustification(
|
|
|
|
PerSpanData* aPSD, mozilla::JustificationApplicationState& aState);
|
2000-04-17 18:40:46 +04:00
|
|
|
|
2014-12-15 02:33:59 +03:00
|
|
|
void ExpandRubyBox(PerFrameData* aFrame, nscoord aReservedISize,
|
2015-07-16 12:07:57 +03:00
|
|
|
const nsSize& aContainerSize);
|
2014-12-15 02:33:59 +03:00
|
|
|
|
|
|
|
void ExpandRubyBoxWithAnnotations(PerFrameData* aFrame,
|
2015-07-16 12:07:57 +03:00
|
|
|
const nsSize& aContainerSize);
|
2014-12-15 02:33:59 +03:00
|
|
|
|
|
|
|
void ExpandInlineRubyBoxes(PerSpanData* aSpan);
|
|
|
|
|
2014-12-10 01:49:45 +03:00
|
|
|
void AttachFrameToBaseLineLayout(PerFrameData* aFrame);
|
2000-04-17 18:40:46 +04:00
|
|
|
|
1999-03-19 00:03:25 +03:00
|
|
|
#ifdef DEBUG
|
2012-08-22 19:56:38 +04:00
|
|
|
void DumpPerSpanData(PerSpanData* psd, int32_t aIndent);
|
1999-03-19 00:03:25 +03:00
|
|
|
#endif
|
1998-06-18 20:25:41 +04:00
|
|
|
};
|
|
|
|
|
1998-09-15 04:19:49 +04:00
|
|
|
#endif /* nsLineLayout_h___ */
|