зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1141931 part 3 - Adjust some parameters of functions in nsBidiPresUtils. r=jfkthame
Includes two changes: * aContainerSize of ReorderFrames, RepositionInlineFrames, RepositionFrame are changed to aContainerISize; * the type of aContainuationStates in the functions above is changed to const pointer. --HG-- extra : source : 41336b712d88a843b15015321cae9f878aa08427
This commit is contained in:
Родитель
9576de22a9
Коммит
e581fcaf13
|
@ -1223,11 +1223,11 @@ nsBidiPresUtils::ResolveParagraphWithinBlock(nsBlockFrame* aBlockFrame,
|
|||
}
|
||||
|
||||
void
|
||||
nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
WritingMode aLineWM,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart)
|
||||
nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
WritingMode aLineWM,
|
||||
nscoord aContainerISize,
|
||||
nscoord aStart)
|
||||
{
|
||||
// If this line consists of a line frame, reorder the line frame's children.
|
||||
if (aFirstFrameOnLine->GetType() == nsGkAtoms::lineFrame) {
|
||||
|
@ -1241,7 +1241,7 @@ nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
|||
|
||||
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
|
||||
RepositionInlineFrames(&bld, aFirstFrameOnLine, aLineWM,
|
||||
aContainerSize, aStart);
|
||||
aContainerISize, aStart);
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
|
@ -1281,11 +1281,11 @@ nsBidiPresUtils::GetFrameBaseLevel(nsIFrame* aFrame)
|
|||
}
|
||||
|
||||
void
|
||||
nsBidiPresUtils::IsFirstOrLast(nsIFrame* aFrame,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
bool aSpanDirMatchesLineDir,
|
||||
bool& aIsFirst /* out */,
|
||||
bool& aIsLast /* out */)
|
||||
nsBidiPresUtils::IsFirstOrLast(nsIFrame* aFrame,
|
||||
const nsContinuationStates* aContinuationStates,
|
||||
bool aSpanDirMatchesLineDir,
|
||||
bool& aIsFirst /* out */,
|
||||
bool& aIsLast /* out */)
|
||||
{
|
||||
/*
|
||||
* Since we lay out frames in the line's direction, visiting a frame with
|
||||
|
@ -1397,12 +1397,12 @@ nsBidiPresUtils::IsFirstOrLast(nsIFrame* aFrame,
|
|||
}
|
||||
|
||||
void
|
||||
nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
bool aIsEvenLevel,
|
||||
nscoord& aStart,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
WritingMode aContainerWM,
|
||||
const nsSize& aContainerSize)
|
||||
nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
bool aIsEvenLevel,
|
||||
nscoord& aStart,
|
||||
const nsContinuationStates* aContinuationStates,
|
||||
WritingMode aContainerWM,
|
||||
nscoord aContainerISize)
|
||||
{
|
||||
if (!aFrame)
|
||||
return;
|
||||
|
@ -1467,7 +1467,7 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
|||
iCoord,
|
||||
aContinuationStates,
|
||||
frameWM,
|
||||
aFrame->GetSize());
|
||||
aFrame->ISize());
|
||||
index++;
|
||||
frame = reverseOrder ?
|
||||
childList[childList.Length() - index - 1] :
|
||||
|
@ -1483,12 +1483,11 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
|||
// in vertical writing modes with right-to-left direction (Bug 1131451).
|
||||
// This does the correct calculation ad hoc pending the fix for that.
|
||||
nsRect rect = aFrame->GetRect();
|
||||
nscoord lineSize = aContainerWM.IsVertical()
|
||||
? aContainerSize.height : aContainerSize.width;
|
||||
NS_ASSERTION(aContainerWM.IsBidiLTR() || lineSize != NS_UNCONSTRAINEDSIZE,
|
||||
NS_ASSERTION(aContainerWM.IsBidiLTR() || aContainerISize != NS_UNCONSTRAINEDSIZE,
|
||||
"Unconstrained inline line size in bidi frame reordering");
|
||||
|
||||
nscoord frameIStart = aContainerWM.IsBidiLTR() ? start : lineSize - aStart;
|
||||
nscoord frameIStart =
|
||||
aContainerWM.IsBidiLTR() ? start : aContainerISize - aStart;
|
||||
nscoord frameISize = aStart - start;
|
||||
|
||||
(aContainerWM.IsVertical() ? rect.y : rect.x) = frameIStart;
|
||||
|
@ -1523,7 +1522,7 @@ void
|
|||
nsBidiPresUtils::RepositionInlineFrames(BidiLineData *aBld,
|
||||
nsIFrame* aFirstChild,
|
||||
WritingMode aLineWM,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aContainerISize,
|
||||
nscoord aStart)
|
||||
{
|
||||
nscoord start = aStart;
|
||||
|
@ -1556,7 +1555,7 @@ nsBidiPresUtils::RepositionInlineFrames(BidiLineData *aBld,
|
|||
start,
|
||||
&continuationStates,
|
||||
aLineWM,
|
||||
aContainerSize);
|
||||
aContainerISize);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -159,11 +159,11 @@ public:
|
|||
*
|
||||
* @lina 05/02/2000
|
||||
*/
|
||||
static void ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
static void ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
mozilla::WritingMode aLineWM,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart);
|
||||
nscoord aContainerISize,
|
||||
nscoord aStart);
|
||||
|
||||
/**
|
||||
* Format Unicode text, taking into account bidi capabilities
|
||||
|
@ -426,12 +426,12 @@ private:
|
|||
* (after adding its inline-end margin)
|
||||
* @param aContinuationStates A map from nsIFrame* to nsFrameContinuationState
|
||||
*/
|
||||
static void RepositionFrame(nsIFrame* aFrame,
|
||||
bool aIsEvenLevel,
|
||||
nscoord& aStart,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
mozilla::WritingMode aContainerWM,
|
||||
const nsSize& aContainerSize);
|
||||
static void RepositionFrame(nsIFrame* aFrame,
|
||||
bool aIsEvenLevel,
|
||||
nscoord& aStart,
|
||||
const nsContinuationStates* aContinuationStates,
|
||||
mozilla::WritingMode aContainerWM,
|
||||
nscoord aContainerISize);
|
||||
|
||||
/*
|
||||
* Initialize the continuation state(nsFrameContinuationState) to
|
||||
|
@ -468,11 +468,11 @@ private:
|
|||
* @param[out] aIsLast TRUE means aFrame is last frame
|
||||
* or continuation
|
||||
*/
|
||||
static void IsFirstOrLast(nsIFrame* aFrame,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
bool aSpanInLineOrder /* in */,
|
||||
bool& aIsFirst /* out */,
|
||||
bool& aIsLast /* out */);
|
||||
static void IsFirstOrLast(nsIFrame* aFrame,
|
||||
const nsContinuationStates* aContinuationStates,
|
||||
bool aSpanInLineOrder /* in */,
|
||||
bool& aIsFirst /* out */,
|
||||
bool& aIsLast /* out */);
|
||||
|
||||
/**
|
||||
* Adjust frame positions following their visual order
|
||||
|
@ -484,7 +484,7 @@ private:
|
|||
static void RepositionInlineFrames(BidiLineData* aBld,
|
||||
nsIFrame* aFirstChild,
|
||||
mozilla::WritingMode aLineWM,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aContainerISize,
|
||||
nscoord aStart);
|
||||
|
||||
/**
|
||||
|
|
|
@ -3172,9 +3172,11 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
|||
|
||||
if (mPresContext->BidiEnabled() &&
|
||||
(!mPresContext->IsVisualMode() || !lineWM.IsBidiLTR())) {
|
||||
nscoord containerISize = lineWM.IsVertical() ?
|
||||
ContainerHeight() : ContainerWidth();
|
||||
nsBidiPresUtils::ReorderFrames(psd->mFirstFrame->mFrame,
|
||||
aLine->GetChildCount(),
|
||||
lineWM, mContainerSize,
|
||||
lineWM, containerISize,
|
||||
psd->mIStart + mTextIndent + dx);
|
||||
if (dx) {
|
||||
aLine->IndentBy(dx, ContainerWidth());
|
||||
|
|
Загрузка…
Ссылка в новой задаче