зеркало из https://github.com/mozilla/gecko-dev.git
Bug 645647 part 4 - Add an 'm' prefix to some members to follow our naming conventions. r=dholbert
This commit is contained in:
Родитель
a568757842
Коммит
d4dfb9f81d
|
@ -5588,10 +5588,10 @@ nsLayoutUtils::MinISizeFromInline(nsIFrame* aFrame,
|
|||
"should not be container for font size inflation");
|
||||
|
||||
nsIFrame::InlineMinISizeData data;
|
||||
DISPLAY_MIN_WIDTH(aFrame, data.prevLines);
|
||||
DISPLAY_MIN_WIDTH(aFrame, data.mPrevLines);
|
||||
aFrame->AddInlineMinISize(aRenderingContext, &data);
|
||||
data.ForceBreak();
|
||||
return data.prevLines;
|
||||
return data.mPrevLines;
|
||||
}
|
||||
|
||||
/* static */ nscoord
|
||||
|
@ -5602,10 +5602,10 @@ nsLayoutUtils::PrefISizeFromInline(nsIFrame* aFrame,
|
|||
"should not be container for font size inflation");
|
||||
|
||||
nsIFrame::InlinePrefISizeData data;
|
||||
DISPLAY_PREF_WIDTH(aFrame, data.prevLines);
|
||||
DISPLAY_PREF_WIDTH(aFrame, data.mPrevLines);
|
||||
aFrame->AddInlinePrefISize(aRenderingContext, &data);
|
||||
data.ForceBreak();
|
||||
return data.prevLines;
|
||||
return data.mPrevLines;
|
||||
}
|
||||
|
||||
static nscolor
|
||||
|
|
|
@ -715,7 +715,7 @@ nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|||
#endif
|
||||
if (line->IsBlock()) {
|
||||
data.ForceBreak();
|
||||
data.currentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
line->mFirstChild, nsLayoutUtils::MIN_ISIZE);
|
||||
data.ForceBreak();
|
||||
} else {
|
||||
|
@ -726,11 +726,11 @@ nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|||
// behavior for calc(10%-3px).
|
||||
const nsStyleCoord &indent = StyleText()->mTextIndent;
|
||||
if (indent.ConvertsToLength())
|
||||
data.currentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
}
|
||||
// XXX Bug NNNNNN Should probably handle percentage text-indent.
|
||||
|
||||
data.line = &line;
|
||||
data.mLine = &line;
|
||||
data.SetLineContainer(curFrame);
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
for (int32_t i = 0, i_end = line->GetChildCount(); i != i_end;
|
||||
|
@ -742,14 +742,14 @@ nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
|||
if (gNoisyIntrinsic) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("min: [prevLines=%d currentLine=%d]\n",
|
||||
data.prevLines, data.currentLine);
|
||||
data.mPrevLines, data.mCurrentLine);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
data.ForceBreak();
|
||||
|
||||
mMinWidth = data.prevLines;
|
||||
mMinWidth = data.mPrevLines;
|
||||
return mMinWidth;
|
||||
}
|
||||
|
||||
|
@ -803,7 +803,7 @@ nsBlockFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||
#endif
|
||||
if (line->IsBlock()) {
|
||||
data.ForceBreak();
|
||||
data.currentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
line->mFirstChild, nsLayoutUtils::PREF_ISIZE);
|
||||
data.ForceBreak();
|
||||
} else {
|
||||
|
@ -814,11 +814,11 @@ nsBlockFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||
// behavior for calc(10%-3px).
|
||||
const nsStyleCoord &indent = StyleText()->mTextIndent;
|
||||
if (indent.ConvertsToLength())
|
||||
data.currentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
}
|
||||
// XXX Bug NNNNNN Should probably handle percentage text-indent.
|
||||
|
||||
data.line = &line;
|
||||
data.mLine = &line;
|
||||
data.SetLineContainer(curFrame);
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
for (int32_t i = 0, i_end = line->GetChildCount(); i != i_end;
|
||||
|
@ -830,14 +830,14 @@ nsBlockFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
|||
if (gNoisyIntrinsic) {
|
||||
IndentBy(stdout, gNoiseIndent);
|
||||
printf("pref: [prevLines=%d currentLine=%d]\n",
|
||||
data.prevLines, data.currentLine);
|
||||
data.mPrevLines, data.mCurrentLine);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
data.ForceBreak();
|
||||
|
||||
mPrefWidth = data.prevLines;
|
||||
mPrefWidth = data.mPrevLines;
|
||||
return mPrefWidth;
|
||||
}
|
||||
|
||||
|
@ -887,12 +887,12 @@ nsBlockFrame::GetPrefWidthTightBounds(nsRenderingContext* aRenderingContext,
|
|||
// behavior for calc(10%-3px).
|
||||
const nsStyleCoord &indent = StyleText()->mTextIndent;
|
||||
if (indent.ConvertsToLength()) {
|
||||
data.currentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
|
||||
}
|
||||
}
|
||||
// XXX Bug NNNNNN Should probably handle percentage text-indent.
|
||||
|
||||
data.line = &line;
|
||||
data.mLine = &line;
|
||||
data.SetLineContainer(curFrame);
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
for (int32_t i = 0, i_end = line->GetChildCount(); i != i_end;
|
||||
|
@ -900,8 +900,8 @@ nsBlockFrame::GetPrefWidthTightBounds(nsRenderingContext* aRenderingContext,
|
|||
rv = kid->GetPrefWidthTightBounds(aRenderingContext, &childX,
|
||||
&childXMost);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
*aX = std::min(*aX, data.currentLine + childX);
|
||||
*aXMost = std::max(*aXMost, data.currentLine + childXMost);
|
||||
*aX = std::min(*aX, data.mCurrentLine + childX);
|
||||
*aXMost = std::max(*aXMost, data.mCurrentLine + childXMost);
|
||||
kid->AddInlinePrefISize(aRenderingContext, &data);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -860,7 +860,7 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
|||
styleBorder->GetComputedBorderWidth(startSide) +
|
||||
GetCoord(styleMargin->mMargin.Get(startSide), 0);
|
||||
if (MOZ_LIKELY(sliceBreak)) {
|
||||
aData->currentLine += startPBM;
|
||||
aData->mCurrentLine += startPBM;
|
||||
} else {
|
||||
clonePBM = startPBM;
|
||||
}
|
||||
|
@ -875,14 +875,14 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
|||
clonePBM += endPBM;
|
||||
}
|
||||
|
||||
const nsLineList_iterator* savedLine = aData->line;
|
||||
const nsLineList_iterator* savedLine = aData->mLine;
|
||||
nsIFrame* const savedLineContainer = aData->LineContainer();
|
||||
|
||||
nsContainerFrame *lastInFlow;
|
||||
for (nsContainerFrame *nif = this; nif;
|
||||
nif = static_cast<nsContainerFrame*>(nif->GetNextInFlow())) {
|
||||
if (aData->currentLine == 0) {
|
||||
aData->currentLine = clonePBM;
|
||||
if (aData->mCurrentLine == 0) {
|
||||
aData->mCurrentLine = clonePBM;
|
||||
}
|
||||
for (nsIFrame* kid : nif->mFrames) {
|
||||
if (aType == nsLayoutUtils::MIN_ISIZE)
|
||||
|
@ -895,13 +895,13 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
|||
|
||||
// After we advance to our next-in-flow, the stored line and line container
|
||||
// may no longer be correct. Just forget them.
|
||||
aData->line = nullptr;
|
||||
aData->mLine = nullptr;
|
||||
aData->SetLineContainer(nullptr);
|
||||
|
||||
lastInFlow = nif;
|
||||
}
|
||||
|
||||
aData->line = savedLine;
|
||||
aData->mLine = savedLine;
|
||||
aData->SetLineContainer(savedLineContainer);
|
||||
|
||||
// This goes at the end no matter how things are broken and how
|
||||
|
@ -912,7 +912,7 @@ nsContainerFrame::DoInlineIntrinsicISize(nsRenderingContext *aRenderingContext,
|
|||
// continuation, in which case that continuation should handle
|
||||
// the endSide border.
|
||||
if (MOZ_LIKELY(!lastInFlow->GetNextContinuation() && sliceBreak)) {
|
||||
aData->currentLine += endPBM;
|
||||
aData->mCurrentLine += endPBM;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4296,10 +4296,10 @@ nsIFrame::InlineMinISizeData::DefaultAddInlineMinISize(nsIFrame* aFrame,
|
|||
if (mayBreak) {
|
||||
OptionallyBreak();
|
||||
}
|
||||
trailingWhitespace = 0;
|
||||
skipWhitespace = false;
|
||||
currentLine += aISize;
|
||||
atStartOfLine = false;
|
||||
mTrailingWhitespace = 0;
|
||||
mSkipWhitespace = false;
|
||||
mCurrentLine += aISize;
|
||||
mAtStartOfLine = false;
|
||||
if (mayBreak) {
|
||||
OptionallyBreak();
|
||||
}
|
||||
|
@ -4308,25 +4308,25 @@ nsIFrame::InlineMinISizeData::DefaultAddInlineMinISize(nsIFrame* aFrame,
|
|||
void
|
||||
nsIFrame::InlinePrefISizeData::DefaultAddInlinePrefISize(nscoord aISize)
|
||||
{
|
||||
currentLine = NSCoordSaturatingAdd(currentLine, aISize);
|
||||
trailingWhitespace = 0;
|
||||
skipWhitespace = false;
|
||||
mCurrentLine = NSCoordSaturatingAdd(mCurrentLine, aISize);
|
||||
mTrailingWhitespace = 0;
|
||||
mSkipWhitespace = false;
|
||||
}
|
||||
|
||||
void
|
||||
nsIFrame::InlineMinISizeData::ForceBreak()
|
||||
{
|
||||
currentLine -= trailingWhitespace;
|
||||
prevLines = std::max(prevLines, currentLine);
|
||||
currentLine = trailingWhitespace = 0;
|
||||
mCurrentLine -= mTrailingWhitespace;
|
||||
mPrevLines = std::max(mPrevLines, mCurrentLine);
|
||||
mCurrentLine = mTrailingWhitespace = 0;
|
||||
|
||||
for (uint32_t i = 0, i_end = floats.Length(); i != i_end; ++i) {
|
||||
nscoord float_min = floats[i].Width();
|
||||
if (float_min > prevLines)
|
||||
prevLines = float_min;
|
||||
for (uint32_t i = 0, i_end = mFloats.Length(); i != i_end; ++i) {
|
||||
nscoord float_min = mFloats[i].Width();
|
||||
if (float_min > mPrevLines)
|
||||
mPrevLines = float_min;
|
||||
}
|
||||
floats.Clear();
|
||||
skipWhitespace = true;
|
||||
mFloats.Clear();
|
||||
mSkipWhitespace = true;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -4337,16 +4337,16 @@ nsIFrame::InlineMinISizeData::OptionallyBreak(nscoord aHyphenWidth)
|
|||
// text-indent or negative margin), don't break. Otherwise, do the
|
||||
// same as ForceBreak. it doesn't really matter when we accumulate
|
||||
// floats.
|
||||
if (currentLine + aHyphenWidth < 0 || atStartOfLine)
|
||||
if (mCurrentLine + aHyphenWidth < 0 || mAtStartOfLine)
|
||||
return;
|
||||
currentLine += aHyphenWidth;
|
||||
mCurrentLine += aHyphenWidth;
|
||||
ForceBreak();
|
||||
}
|
||||
|
||||
void
|
||||
nsIFrame::InlinePrefISizeData::ForceBreak()
|
||||
{
|
||||
if (floats.Length() != 0) {
|
||||
if (mFloats.Length() != 0) {
|
||||
// preferred widths accumulated for floats that have already
|
||||
// been cleared past
|
||||
nscoord floats_done = 0,
|
||||
|
@ -4355,10 +4355,10 @@ nsIFrame::InlinePrefISizeData::ForceBreak()
|
|||
floats_cur_left = 0,
|
||||
floats_cur_right = 0;
|
||||
|
||||
for (uint32_t i = 0, i_end = floats.Length(); i != i_end; ++i) {
|
||||
const FloatInfo& floatInfo = floats[i];
|
||||
const nsStyleDisplay *floatDisp = floatInfo.Frame()->StyleDisplay();
|
||||
uint8_t breakType = floatDisp->PhysicalBreakType(lineContainerWM);
|
||||
for (uint32_t i = 0, i_end = mFloats.Length(); i != i_end; ++i) {
|
||||
const FloatInfo& floatInfo = mFloats[i];
|
||||
const nsStyleDisplay* floatDisp = floatInfo.Frame()->StyleDisplay();
|
||||
uint8_t breakType = floatDisp->PhysicalBreakType(mLineContainerWM);
|
||||
if (breakType == NS_STYLE_CLEAR_LEFT ||
|
||||
breakType == NS_STYLE_CLEAR_RIGHT ||
|
||||
breakType == NS_STYLE_CLEAR_BOTH) {
|
||||
|
@ -4375,7 +4375,7 @@ nsIFrame::InlinePrefISizeData::ForceBreak()
|
|||
}
|
||||
}
|
||||
|
||||
uint8_t floatStyle = floatDisp->PhysicalFloats(lineContainerWM);
|
||||
uint8_t floatStyle = floatDisp->PhysicalFloats(mLineContainerWM);
|
||||
nscoord& floats_cur = floatStyle == NS_STYLE_FLOAT_LEFT
|
||||
? floats_cur_left : floats_cur_right;
|
||||
nscoord floatWidth = floatInfo.Width();
|
||||
|
@ -4390,16 +4390,16 @@ nsIFrame::InlinePrefISizeData::ForceBreak()
|
|||
if (floats_cur > floats_done)
|
||||
floats_done = floats_cur;
|
||||
|
||||
currentLine = NSCoordSaturatingAdd(currentLine, floats_done);
|
||||
mCurrentLine = NSCoordSaturatingAdd(mCurrentLine, floats_done);
|
||||
|
||||
floats.Clear();
|
||||
mFloats.Clear();
|
||||
}
|
||||
|
||||
currentLine =
|
||||
NSCoordSaturatingSubtract(currentLine, trailingWhitespace, nscoord_MAX);
|
||||
prevLines = std::max(prevLines, currentLine);
|
||||
currentLine = trailingWhitespace = 0;
|
||||
skipWhitespace = true;
|
||||
mCurrentLine =
|
||||
NSCoordSaturatingSubtract(mCurrentLine, mTrailingWhitespace, nscoord_MAX);
|
||||
mPrevLines = std::max(mPrevLines, mCurrentLine);
|
||||
mCurrentLine = mTrailingWhitespace = 0;
|
||||
mSkipWhitespace = true;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -1680,58 +1680,58 @@ public:
|
|||
*/
|
||||
struct InlineIntrinsicISizeData {
|
||||
InlineIntrinsicISizeData()
|
||||
: line(nullptr)
|
||||
, lineContainer(nullptr)
|
||||
, prevLines(0)
|
||||
, currentLine(0)
|
||||
, trailingWhitespace(0)
|
||||
, skipWhitespace(true)
|
||||
: mLine(nullptr)
|
||||
, mLineContainer(nullptr)
|
||||
, mPrevLines(0)
|
||||
, mCurrentLine(0)
|
||||
, mTrailingWhitespace(0)
|
||||
, mSkipWhitespace(true)
|
||||
{}
|
||||
|
||||
// The line. This may be null if the inlines are not associated with
|
||||
// a block or if we just don't know the line.
|
||||
const nsLineList_iterator* line;
|
||||
const nsLineList_iterator* mLine;
|
||||
|
||||
// The line container. Private, to ensure we always use SetLineContainer
|
||||
// to update it (so that we have a chance to store the lineContainerWM).
|
||||
// to update it (so that we have a chance to store the mLineContainerWM).
|
||||
//
|
||||
// Note that nsContainerFrame::DoInlineIntrinsicISize will clear the
|
||||
// |line| and |lineContainer| fields when following a next-in-flow link,
|
||||
// |mLine| and |mLineContainer| fields when following a next-in-flow link,
|
||||
// so we must not assume these can always be dereferenced.
|
||||
private:
|
||||
nsIFrame* lineContainer;
|
||||
nsIFrame* mLineContainer;
|
||||
|
||||
// Setter and getter for the lineContainer field:
|
||||
public:
|
||||
void SetLineContainer(nsIFrame* aLineContainer)
|
||||
{
|
||||
lineContainer = aLineContainer;
|
||||
if (lineContainer) {
|
||||
lineContainerWM = lineContainer->GetWritingMode();
|
||||
mLineContainer = aLineContainer;
|
||||
if (mLineContainer) {
|
||||
mLineContainerWM = mLineContainer->GetWritingMode();
|
||||
}
|
||||
}
|
||||
nsIFrame* LineContainer() const { return lineContainer; }
|
||||
nsIFrame* LineContainer() const { return mLineContainer; }
|
||||
|
||||
// The maximum intrinsic width for all previous lines.
|
||||
nscoord prevLines;
|
||||
nscoord mPrevLines;
|
||||
|
||||
// The maximum intrinsic width for the current line. At a line
|
||||
// break (mandatory for preferred width; allowed for minimum width),
|
||||
// the caller should call |Break()|.
|
||||
nscoord currentLine;
|
||||
nscoord mCurrentLine;
|
||||
|
||||
// This contains the width of the trimmable whitespace at the end of
|
||||
// |currentLine|; it is zero if there is no such whitespace.
|
||||
nscoord trailingWhitespace;
|
||||
// |mCurrentLine|; it is zero if there is no such whitespace.
|
||||
nscoord mTrailingWhitespace;
|
||||
|
||||
// True if initial collapsable whitespace should be skipped. This
|
||||
// should be true at the beginning of a block, after hard breaks
|
||||
// and when the last text ended with whitespace.
|
||||
bool skipWhitespace;
|
||||
bool mSkipWhitespace;
|
||||
|
||||
// Writing mode of the line container (stored here so that we don't
|
||||
// lose track of it if the lineContainer field is reset).
|
||||
mozilla::WritingMode lineContainerWM;
|
||||
// lose track of it if the mLineContainer field is reset).
|
||||
mozilla::WritingMode mLineContainerWM;
|
||||
|
||||
// Floats encountered in the lines.
|
||||
class FloatInfo {
|
||||
|
@ -1747,12 +1747,12 @@ public:
|
|||
nscoord mWidth;
|
||||
};
|
||||
|
||||
nsTArray<FloatInfo> floats;
|
||||
nsTArray<FloatInfo> mFloats;
|
||||
};
|
||||
|
||||
struct InlineMinISizeData : public InlineIntrinsicISizeData {
|
||||
InlineMinISizeData()
|
||||
: atStartOfLine(true)
|
||||
: mAtStartOfLine(true)
|
||||
{}
|
||||
|
||||
// The default implementation for nsIFrame::AddInlineMinISize.
|
||||
|
@ -1773,7 +1773,7 @@ public:
|
|||
// Whether we're currently at the start of the line. If we are, we
|
||||
// can't break (for example, between the text-indent and the first
|
||||
// word).
|
||||
bool atStartOfLine;
|
||||
bool mAtStartOfLine;
|
||||
};
|
||||
|
||||
struct InlinePrefISizeData : public InlineIntrinsicISizeData {
|
||||
|
@ -1791,7 +1791,7 @@ public:
|
|||
*
|
||||
* All *allowed* breakpoints within the frame determine what counts as
|
||||
* a line for the |InlineIntrinsicISizeData|. This means that
|
||||
* |aData->trailingWhitespace| will always be zero (unlike for
|
||||
* |aData->mTrailingWhitespace| will always be zero (unlike for
|
||||
* AddInlinePrefISize).
|
||||
*
|
||||
* All the comments for |GetMinISize| apply, except that this function
|
||||
|
|
|
@ -66,9 +66,9 @@ nsPlaceholderFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext,
|
|||
nsIFrame::InlineMinISizeData* aData)
|
||||
{
|
||||
// Override AddInlineMinWith so that *nothing* happens. In
|
||||
// particular, we don't want to zero out |aData->trailingWhitespace|,
|
||||
// particular, we don't want to zero out |aData->mTrailingWhitespace|,
|
||||
// since nsLineLayout skips placeholders when trimming trailing
|
||||
// whitespace, and we don't want to set aData->skipWhitespace to
|
||||
// whitespace, and we don't want to set aData->mSkipWhitespace to
|
||||
// false.
|
||||
|
||||
// ...but push floats onto the list
|
||||
|
@ -77,7 +77,7 @@ nsPlaceholderFrame::AddInlineMinISize(nsRenderingContext* aRenderingContext,
|
|||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
mOutOfFlowFrame,
|
||||
nsLayoutUtils::MIN_ISIZE);
|
||||
aData->floats.AppendElement(
|
||||
aData->mFloats.AppendElement(
|
||||
InlineIntrinsicISizeData::FloatInfo(mOutOfFlowFrame, floatWidth));
|
||||
}
|
||||
}
|
||||
|
@ -87,9 +87,9 @@ nsPlaceholderFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext,
|
|||
nsIFrame::InlinePrefISizeData* aData)
|
||||
{
|
||||
// Override AddInlinePrefWith so that *nothing* happens. In
|
||||
// particular, we don't want to zero out |aData->trailingWhitespace|,
|
||||
// particular, we don't want to zero out |aData->mTrailingWhitespace|,
|
||||
// since nsLineLayout skips placeholders when trimming trailing
|
||||
// whitespace, and we don't want to set aData->skipWhitespace to
|
||||
// whitespace, and we don't want to set aData->mSkipWhitespace to
|
||||
// false.
|
||||
|
||||
// ...but push floats onto the list
|
||||
|
@ -98,7 +98,7 @@ nsPlaceholderFrame::AddInlinePrefISize(nsRenderingContext* aRenderingContext,
|
|||
nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
|
||||
mOutOfFlowFrame,
|
||||
nsLayoutUtils::PREF_ISIZE);
|
||||
aData->floats.AppendElement(
|
||||
aData->mFloats.AppendElement(
|
||||
InlineIntrinsicISizeData::FloatInfo(mOutOfFlowFrame, floatWidth));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -148,19 +148,19 @@ CalculateColumnPrefISize(nsRenderingContext* aRenderingContext,
|
|||
nsIFrame::InlinePrefISizeData data;
|
||||
if (i == 0) {
|
||||
data.SetLineContainer(aBaseISizeData->LineContainer());
|
||||
data.skipWhitespace = aBaseISizeData->skipWhitespace;
|
||||
data.trailingWhitespace = aBaseISizeData->trailingWhitespace;
|
||||
data.mSkipWhitespace = aBaseISizeData->mSkipWhitespace;
|
||||
data.mTrailingWhitespace = aBaseISizeData->mTrailingWhitespace;
|
||||
} else {
|
||||
// The line container of ruby text frames is their parent,
|
||||
// ruby text container frame.
|
||||
data.SetLineContainer(frame->GetParent());
|
||||
}
|
||||
frame->AddInlinePrefISize(aRenderingContext, &data);
|
||||
MOZ_ASSERT(data.prevLines == 0, "Shouldn't have prev lines");
|
||||
max = std::max(max, data.currentLine);
|
||||
MOZ_ASSERT(data.mPrevLines == 0, "Shouldn't have prev lines");
|
||||
max = std::max(max, data.mCurrentLine);
|
||||
if (i == 0) {
|
||||
aBaseISizeData->skipWhitespace = data.skipWhitespace;
|
||||
aBaseISizeData->trailingWhitespace = data.trailingWhitespace;
|
||||
aBaseISizeData->mSkipWhitespace = data.mSkipWhitespace;
|
||||
aBaseISizeData->mTrailingWhitespace = data.mTrailingWhitespace;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,22 +182,22 @@ nsRubyBaseContainerFrame::AddInlineMinISize(
|
|||
// directly if there is any span.
|
||||
nsIFrame::InlinePrefISizeData data;
|
||||
data.SetLineContainer(aData->LineContainer());
|
||||
data.skipWhitespace = aData->skipWhitespace;
|
||||
data.trailingWhitespace = aData->trailingWhitespace;
|
||||
data.mSkipWhitespace = aData->mSkipWhitespace;
|
||||
data.mTrailingWhitespace = aData->mTrailingWhitespace;
|
||||
AddInlinePrefISize(aRenderingContext, &data);
|
||||
aData->currentLine += data.currentLine;
|
||||
if (data.currentLine > 0) {
|
||||
aData->atStartOfLine = false;
|
||||
aData->mCurrentLine += data.mCurrentLine;
|
||||
if (data.mCurrentLine > 0) {
|
||||
aData->mAtStartOfLine = false;
|
||||
}
|
||||
aData->skipWhitespace = data.skipWhitespace;
|
||||
aData->trailingWhitespace = data.trailingWhitespace;
|
||||
aData->mSkipWhitespace = data.mSkipWhitespace;
|
||||
aData->mTrailingWhitespace = data.mTrailingWhitespace;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
bool firstFrame = true;
|
||||
bool allowInitialLineBreak, allowLineBreak;
|
||||
GetIsLineBreakAllowed(this, !aData->atStartOfLine,
|
||||
GetIsLineBreakAllowed(this, !aData->mAtStartOfLine,
|
||||
&allowInitialLineBreak, &allowLineBreak);
|
||||
for (nsIFrame* frame = this; frame; frame = frame->GetNextInFlow()) {
|
||||
RubyColumnEnumerator enumerator(
|
||||
|
@ -217,9 +217,9 @@ nsRubyBaseContainerFrame::AddInlineMinISize(
|
|||
firstFrame = false;
|
||||
nscoord isize = CalculateColumnPrefISize(aRenderingContext,
|
||||
enumerator, aData);
|
||||
aData->currentLine += isize;
|
||||
aData->mCurrentLine += isize;
|
||||
if (isize > 0) {
|
||||
aData->atStartOfLine = false;
|
||||
aData->mAtStartOfLine = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,11 +244,11 @@ nsRubyBaseContainerFrame::AddInlinePrefISize(
|
|||
nsIFrame* frame = textContainers[i]->PrincipalChildList().FirstChild();
|
||||
nsIFrame::InlinePrefISizeData data;
|
||||
frame->AddInlinePrefISize(aRenderingContext, &data);
|
||||
MOZ_ASSERT(data.prevLines == 0, "Shouldn't have prev lines");
|
||||
sum = std::max(sum, data.currentLine);
|
||||
MOZ_ASSERT(data.mPrevLines == 0, "Shouldn't have prev lines");
|
||||
sum = std::max(sum, data.mCurrentLine);
|
||||
}
|
||||
}
|
||||
aData->currentLine += sum;
|
||||
aData->mCurrentLine += sum;
|
||||
}
|
||||
|
||||
/* virtual */ bool
|
||||
|
|
|
@ -7689,7 +7689,7 @@ FindStartAfterSkippingWhitespace(PropertyProvider* aProvider,
|
|||
gfxSkipCharsIterator* aIterator,
|
||||
uint32_t aFlowEndInTextRun)
|
||||
{
|
||||
if (aData->skipWhitespace) {
|
||||
if (aData->mSkipWhitespace) {
|
||||
while (aIterator->GetSkippedOffset() < aFlowEndInTextRun &&
|
||||
IsTrimmableSpace(aProvider->GetFragment(), aIterator->GetOriginalOffset(), aTextStyle)) {
|
||||
aIterator->AdvanceOriginal(1);
|
||||
|
@ -7739,7 +7739,7 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
uint32_t flowEndInTextRun;
|
||||
gfxSkipCharsIterator iter =
|
||||
EnsureTextRun(aTextRunType, aRenderingContext->GetDrawTarget(),
|
||||
aData->LineContainer(), aData->line, &flowEndInTextRun);
|
||||
aData->LineContainer(), aData->mLine, &flowEndInTextRun);
|
||||
gfxTextRun *textRun = GetTextRun(aTextRunType);
|
||||
if (!textRun)
|
||||
return;
|
||||
|
@ -7805,34 +7805,34 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
nscoord width = NSToCoordCeilClamped(
|
||||
textRun->GetAdvanceWidth(Range(wordStart, i), &provider));
|
||||
width = std::max(0, width);
|
||||
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
|
||||
aData->atStartOfLine = false;
|
||||
aData->mCurrentLine = NSCoordSaturatingAdd(aData->mCurrentLine, width);
|
||||
aData->mAtStartOfLine = false;
|
||||
|
||||
if (collapseWhitespace) {
|
||||
uint32_t trimStart = GetEndOfTrimmedText(frag, textStyle, wordStart, i, &iter);
|
||||
if (trimStart == start) {
|
||||
// This is *all* trimmable whitespace, so whatever trailingWhitespace
|
||||
// we saw previously is still trailing...
|
||||
aData->trailingWhitespace += width;
|
||||
aData->mTrailingWhitespace += width;
|
||||
} else {
|
||||
// Some non-whitespace so the old trailingWhitespace is no longer trailing
|
||||
nscoord wsWidth = NSToCoordCeilClamped(
|
||||
textRun->GetAdvanceWidth(Range(trimStart, i), &provider));
|
||||
aData->trailingWhitespace = std::max(0, wsWidth);
|
||||
aData->mTrailingWhitespace = std::max(0, wsWidth);
|
||||
}
|
||||
} else {
|
||||
aData->trailingWhitespace = 0;
|
||||
aData->mTrailingWhitespace = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (preformattedTab) {
|
||||
PropertyProvider::Spacing spacing;
|
||||
provider.GetSpacing(Range(i, i + 1), &spacing);
|
||||
aData->currentLine += nscoord(spacing.mBefore);
|
||||
aData->mCurrentLine += nscoord(spacing.mBefore);
|
||||
gfxFloat afterTab =
|
||||
AdvanceToNextTab(aData->currentLine, this,
|
||||
AdvanceToNextTab(aData->mCurrentLine, this,
|
||||
textRun, &tabWidth);
|
||||
aData->currentLine = nscoord(afterTab + spacing.mAfter);
|
||||
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
||||
wordStart = i + 1;
|
||||
} else if (i < flowEndInTextRun ||
|
||||
(i == textRun->GetLength() &&
|
||||
|
@ -7851,7 +7851,7 @@ nsTextFrame::AddInlineMinISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
|
||||
if (start < flowEndInTextRun) {
|
||||
// Check if we have collapsible whitespace at the end
|
||||
aData->skipWhitespace =
|
||||
aData->mSkipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
|
@ -7891,7 +7891,7 @@ nsTextFrame::AddInlineMinISize(nsRenderingContext *aRenderingContext,
|
|||
aData->LineContainer() != (lc = FindLineContainer(f))) {
|
||||
NS_ASSERTION(f != this, "wrong InlineMinISizeData container"
|
||||
" for first continuation");
|
||||
aData->line = nullptr;
|
||||
aData->mLine = nullptr;
|
||||
aData->SetLineContainer(lc);
|
||||
}
|
||||
|
||||
|
@ -7912,7 +7912,7 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
uint32_t flowEndInTextRun;
|
||||
gfxSkipCharsIterator iter =
|
||||
EnsureTextRun(aTextRunType, aRenderingContext->GetDrawTarget(),
|
||||
aData->LineContainer(), aData->line, &flowEndInTextRun);
|
||||
aData->LineContainer(), aData->mLine, &flowEndInTextRun);
|
||||
gfxTextRun *textRun = GetTextRun(aTextRunType);
|
||||
if (!textRun)
|
||||
return;
|
||||
|
@ -7958,33 +7958,33 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
nscoord width = NSToCoordCeilClamped(
|
||||
textRun->GetAdvanceWidth(Range(lineStart, i), &provider));
|
||||
width = std::max(0, width);
|
||||
aData->currentLine = NSCoordSaturatingAdd(aData->currentLine, width);
|
||||
aData->mCurrentLine = NSCoordSaturatingAdd(aData->mCurrentLine, width);
|
||||
|
||||
if (collapseWhitespace) {
|
||||
uint32_t trimStart = GetEndOfTrimmedText(frag, textStyle, lineStart, i, &iter);
|
||||
if (trimStart == start) {
|
||||
// This is *all* trimmable whitespace, so whatever trailingWhitespace
|
||||
// we saw previously is still trailing...
|
||||
aData->trailingWhitespace += width;
|
||||
aData->mTrailingWhitespace += width;
|
||||
} else {
|
||||
// Some non-whitespace so the old trailingWhitespace is no longer trailing
|
||||
nscoord wsWidth = NSToCoordCeilClamped(
|
||||
textRun->GetAdvanceWidth(Range(trimStart, i), &provider));
|
||||
aData->trailingWhitespace = std::max(0, wsWidth);
|
||||
aData->mTrailingWhitespace = std::max(0, wsWidth);
|
||||
}
|
||||
} else {
|
||||
aData->trailingWhitespace = 0;
|
||||
aData->mTrailingWhitespace = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (preformattedTab) {
|
||||
PropertyProvider::Spacing spacing;
|
||||
provider.GetSpacing(Range(i, i + 1), &spacing);
|
||||
aData->currentLine += nscoord(spacing.mBefore);
|
||||
aData->mCurrentLine += nscoord(spacing.mBefore);
|
||||
gfxFloat afterTab =
|
||||
AdvanceToNextTab(aData->currentLine, this,
|
||||
AdvanceToNextTab(aData->mCurrentLine, this,
|
||||
textRun, &tabWidth);
|
||||
aData->currentLine = nscoord(afterTab + spacing.mAfter);
|
||||
aData->mCurrentLine = nscoord(afterTab + spacing.mAfter);
|
||||
lineStart = i + 1;
|
||||
} else if (preformattedNewline) {
|
||||
aData->ForceBreak();
|
||||
|
@ -7994,7 +7994,7 @@ nsTextFrame::AddInlinePrefISizeForFlow(nsRenderingContext *aRenderingContext,
|
|||
|
||||
// Check if we have collapsible whitespace at the end
|
||||
if (start < flowEndInTextRun) {
|
||||
aData->skipWhitespace =
|
||||
aData->mSkipWhitespace =
|
||||
IsTrimmableSpace(provider.GetFragment(),
|
||||
iter.ConvertSkippedToOriginal(flowEndInTextRun - 1),
|
||||
textStyle);
|
||||
|
@ -8030,7 +8030,7 @@ nsTextFrame::AddInlinePrefISize(nsRenderingContext *aRenderingContext,
|
|||
aData->LineContainer() != (lc = FindLineContainer(f))) {
|
||||
NS_ASSERTION(f != this, "wrong InlinePrefISizeData container"
|
||||
" for first continuation");
|
||||
aData->line = nullptr;
|
||||
aData->mLine = nullptr;
|
||||
aData->SetLineContainer(lc);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче