mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1131013
: when setting the position of inline frames in vertical writing modes with right-to-left direction, subtract the inline start from the container height to get the correct vertical position. r=jfkthame
This commit is contained in:
parent
5a597f0338
commit
9cdb41a6f4
@ -1222,11 +1222,11 @@ nsBidiPresUtils::ResolveParagraphWithinBlock(nsBlockFrame* aBlockFrame,
|
||||
}
|
||||
|
||||
void
|
||||
nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
WritingMode aLineWM,
|
||||
nscoord aLineWidth,
|
||||
nscoord aStart)
|
||||
nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
WritingMode aLineWM,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart)
|
||||
{
|
||||
// If this line consists of a line frame, reorder the line frame's children.
|
||||
if (aFirstFrameOnLine->GetType() == nsGkAtoms::lineFrame) {
|
||||
@ -1239,7 +1239,8 @@ nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
}
|
||||
|
||||
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);
|
||||
RepositionInlineFrames(&bld, aFirstFrameOnLine, aLineWM, aLineWidth, aStart);
|
||||
RepositionInlineFrames(&bld, aFirstFrameOnLine, aLineWM,
|
||||
aContainerSize, aStart);
|
||||
}
|
||||
|
||||
nsIFrame*
|
||||
@ -1400,7 +1401,7 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
nscoord& aStart,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
WritingMode aContainerWM,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
if (!aFrame)
|
||||
return;
|
||||
@ -1465,7 +1466,7 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
iCoord,
|
||||
aContinuationStates,
|
||||
frameWM,
|
||||
aFrame->GetLogicalSize(aContainerWM).Width(aContainerWM));
|
||||
aFrame->GetSize());
|
||||
index++;
|
||||
frame = reverseOrder ?
|
||||
childList[childList.Length() - index - 1] :
|
||||
@ -1477,11 +1478,22 @@ nsBidiPresUtils::RepositionFrame(nsIFrame* aFrame,
|
||||
aStart += aFrame->ISize(aContainerWM);
|
||||
}
|
||||
|
||||
LogicalRect logicalRect = aFrame->GetLogicalRect(aContainerWM,
|
||||
aContainerWidth);
|
||||
logicalRect.IStart(aContainerWM) = start;
|
||||
logicalRect.ISize(aContainerWM) = aStart - start;
|
||||
aFrame->SetRect(aContainerWM, logicalRect, aContainerWidth);
|
||||
// LogicalRect doesn't correctly calculate the vertical position
|
||||
// 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,
|
||||
"Unconstrained inline line size in bidi frame reordering");
|
||||
|
||||
nscoord frameIStart = aContainerWM.IsBidiLTR() ? start : lineSize - aStart;
|
||||
nscoord frameISize = aStart - start;
|
||||
|
||||
(aContainerWM.IsVertical() ? rect.y : rect.x) = frameIStart;
|
||||
(aContainerWM.IsVertical() ? rect.height : rect.width) = frameISize;
|
||||
|
||||
aFrame->SetRect(rect);
|
||||
|
||||
aStart += margin.IEnd(aContainerWM);
|
||||
}
|
||||
@ -1510,7 +1522,7 @@ void
|
||||
nsBidiPresUtils::RepositionInlineFrames(BidiLineData *aBld,
|
||||
nsIFrame* aFirstChild,
|
||||
WritingMode aLineWM,
|
||||
nscoord aLineWidth,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart)
|
||||
{
|
||||
nscoord start = aStart;
|
||||
@ -1543,7 +1555,7 @@ nsBidiPresUtils::RepositionInlineFrames(BidiLineData *aBld,
|
||||
start,
|
||||
&continuationStates,
|
||||
aLineWM,
|
||||
aLineWidth);
|
||||
aContainerSize);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@ class nsPresContext;
|
||||
class nsRenderingContext;
|
||||
class nsBlockInFlowLineIterator;
|
||||
class nsStyleContext;
|
||||
struct nsSize;
|
||||
template<class T> class nsTHashtable;
|
||||
namespace mozilla { class WritingMode; }
|
||||
|
||||
@ -161,7 +162,7 @@ public:
|
||||
static void ReorderFrames(nsIFrame* aFirstFrameOnLine,
|
||||
int32_t aNumFramesOnLine,
|
||||
mozilla::WritingMode aLineWM,
|
||||
nscoord aLineWidth,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart);
|
||||
|
||||
/**
|
||||
@ -430,7 +431,7 @@ private:
|
||||
nscoord& aStart,
|
||||
nsContinuationStates* aContinuationStates,
|
||||
mozilla::WritingMode aContainerWM,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
/*
|
||||
* Initialize the continuation state(nsFrameContinuationState) to
|
||||
@ -483,7 +484,7 @@ private:
|
||||
static void RepositionInlineFrames(BidiLineData* aBld,
|
||||
nsIFrame* aFirstChild,
|
||||
mozilla::WritingMode aLineWM,
|
||||
nscoord aLineWidth,
|
||||
const nsSize& aContainerSize,
|
||||
nscoord aStart);
|
||||
|
||||
/**
|
||||
|
@ -1262,7 +1262,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
// physical origins.
|
||||
if (wm.IsVerticalRL()) {
|
||||
nscoord containerWidth = aMetrics.Width();
|
||||
nscoord deltaX = containerWidth - state.mContainerWidth;
|
||||
nscoord deltaX = containerWidth - state.ContainerWidth();
|
||||
if (deltaX) {
|
||||
for (line_iterator line = begin_lines(), end = end_lines();
|
||||
line != end; line++) {
|
||||
@ -1923,7 +1923,7 @@ nsBlockFrame::PropagateFloatDamage(nsBlockReflowState& aState,
|
||||
// Scrollable overflow should be sufficient for things that affect
|
||||
// layout.
|
||||
WritingMode wm = aState.mReflowState.GetWritingMode();
|
||||
nscoord containerWidth = aState.mContainerWidth;
|
||||
nscoord containerWidth = aState.ContainerWidth();
|
||||
LogicalRect overflow = aLine->GetOverflowArea(eScrollableOverflow, wm,
|
||||
containerWidth);
|
||||
nscoord lineBCoordCombinedBefore = overflow.BStart(wm) + aDeltaBCoord;
|
||||
@ -2174,8 +2174,8 @@ nsBlockFrame::ReflowDirtyLines(nsBlockReflowState& aState)
|
||||
// If the container width has changed reset the container width. If the
|
||||
// line's writing mode is not ltr, or if the line is not left-aligned, also
|
||||
// mark the line dirty.
|
||||
if (aState.mContainerWidth != line->mContainerWidth) {
|
||||
line->mContainerWidth = aState.mContainerWidth;
|
||||
if (aState.ContainerWidth() != line->mContainerWidth) {
|
||||
line->mContainerWidth = aState.ContainerWidth();
|
||||
|
||||
bool isLastLine = line == mLines.back() &&
|
||||
!GetNextInFlow() &&
|
||||
@ -2812,7 +2812,7 @@ nsBlockFrame::SlideLine(nsBlockReflowState& aState,
|
||||
NS_PRECONDITION(aDeltaBCoord != 0, "why slide a line nowhere?");
|
||||
|
||||
// Adjust line state
|
||||
aLine->SlideBy(aDeltaBCoord, aState.mContainerWidth);
|
||||
aLine->SlideBy(aDeltaBCoord, aState.ContainerWidth());
|
||||
|
||||
// Adjust the frames in the line
|
||||
MoveChildFramesOfLine(aLine, aDeltaBCoord);
|
||||
@ -3699,7 +3699,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
||||
WritingMode lineWM = GetWritingMode(aLine->mFirstChild);
|
||||
LogicalRect lineRect =
|
||||
aFloatAvailableSpace.mRect.ConvertTo(lineWM, outerWM,
|
||||
aState.mContainerWidth);
|
||||
aState.ContainerWidth());
|
||||
|
||||
nscoord iStart = lineRect.IStart(lineWM);
|
||||
nscoord availISize = lineRect.ISize(lineWM);
|
||||
@ -3720,7 +3720,7 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState,
|
||||
availISize, availBSize,
|
||||
aFloatAvailableSpace.mHasFloats,
|
||||
false, /*XXX isTopOfPage*/
|
||||
lineWM, aState.mContainerWidth);
|
||||
lineWM, aState.mContainerSize);
|
||||
|
||||
aState.SetFlag(BRS_LINE_LAYOUT_EMPTY, false);
|
||||
|
||||
@ -7045,7 +7045,7 @@ nsBlockFrame::ReflowBullet(nsIFrame* aBulletFrame,
|
||||
aBulletFrame->SetRect(wm, LogicalRect(wm, iStart, bStart,
|
||||
aMetrics.ISize(wm),
|
||||
aMetrics.BSize(wm)),
|
||||
aState.mContainerWidth);
|
||||
aState.ContainerWidth());
|
||||
aBulletFrame->DidReflow(aState.mPresContext, &aState.mReflowState,
|
||||
nsDidReflowStatus::FINISHED);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
|
||||
{
|
||||
mFrame = aFrameRS.frame;
|
||||
mWritingMode = aState.mReflowState.GetWritingMode();
|
||||
mContainerWidth = aState.mContainerWidth;
|
||||
mContainerWidth = aState.ContainerWidth();
|
||||
mSpace = aSpace;
|
||||
|
||||
if (!aIsAdjacentWithBStart) {
|
||||
|
@ -65,19 +65,27 @@ nsBlockReflowState::nsBlockReflowState(const nsHTMLReflowState& aReflowState,
|
||||
aFrame->GetLogicalSkipSides(&aReflowState);
|
||||
mBorderPadding.ApplySkipSides(logicalSkipSides);
|
||||
|
||||
// Note that mContainerWidth is the physical width, needed to convert
|
||||
// logical block-coordinates in vertical-rl writing mode (measured from a
|
||||
// RHS origin) to physical coordinates within the containing block.
|
||||
// If aReflowState doesn't have a constrained ComputedWidth(), we set it to
|
||||
// zero, which means lines will be positioned (physically) incorrectly;
|
||||
// we will fix them up at the end of nsBlockFrame::Reflow, after we know
|
||||
// the total block-size of the frame.
|
||||
mContainerWidth = aReflowState.ComputedWidth();
|
||||
if (mContainerWidth == NS_UNCONSTRAINEDSIZE) {
|
||||
mContainerWidth = 0;
|
||||
// Note that mContainerSize is the physical size, needed to
|
||||
// convert logical block-coordinates in vertical-rl writing mode
|
||||
// (measured from a RHS origin) to physical coordinates within the
|
||||
// containing block.
|
||||
// If aReflowState doesn't have a constrained ComputedWidth(), we set
|
||||
// mContainerSize.width to zero, which means lines will be positioned
|
||||
// (physically) incorrectly; we will fix them up at the end of
|
||||
// nsBlockFrame::Reflow, after we know the total block-size of the
|
||||
// frame.
|
||||
mContainerSize.width = aReflowState.ComputedWidth();
|
||||
if (mContainerSize.width == NS_UNCONSTRAINEDSIZE) {
|
||||
mContainerSize.width = 0;
|
||||
}
|
||||
|
||||
mContainerWidth += mBorderPadding.LeftRight(wm);
|
||||
mContainerSize.width += mBorderPadding.LeftRight(wm);
|
||||
|
||||
// For now at least, we don't do that fix-up for mContainerHeight.
|
||||
// It's only used in nsBidiUtils::ReorderFrames for vertical rtl
|
||||
// writing modes, which aren't fully supported for the time being.
|
||||
mContainerSize.height = aReflowState.ComputedHeight() +
|
||||
mBorderPadding.TopBottom(wm);
|
||||
|
||||
if ((aBStartMarginRoot && !logicalSkipSides.BStart()) ||
|
||||
0 != mBorderPadding.BStart(wm)) {
|
||||
@ -320,7 +328,7 @@ nsBlockReflowState::GetFloatAvailableSpaceWithState(
|
||||
nsFlowAreaRect result =
|
||||
mFloatManager->GetFlowArea(wm, aBCoord, nsFloatManager::BAND_FROM_POINT,
|
||||
blockSize, mContentArea, aState,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
// Keep the inline size >= 0 for compatibility with nsSpaceManager.
|
||||
if (result.mRect.ISize(wm) < 0) {
|
||||
result.mRect.ISize(wm) = 0;
|
||||
@ -357,7 +365,7 @@ nsBlockReflowState::GetFloatAvailableSpaceForBSize(
|
||||
#endif
|
||||
nsFlowAreaRect result =
|
||||
mFloatManager->GetFlowArea(wm, aBCoord, nsFloatManager::WIDTH_WITHIN_HEIGHT,
|
||||
aBSize, mContentArea, aState, mContainerWidth);
|
||||
aBSize, mContentArea, aState, ContainerWidth());
|
||||
// Keep the width >= 0 for compatibility with nsSpaceManager.
|
||||
if (result.mRect.ISize(wm) < 0) {
|
||||
result.mRect.ISize(wm) = 0;
|
||||
@ -488,7 +496,7 @@ nsBlockReflowState::RecoverFloats(nsLineList::iterator aLine,
|
||||
mFloatManagerOrigin.B(mFloatManagerWM));
|
||||
nsFrame::ListTag(stdout, floatFrame);
|
||||
LogicalRect region = nsFloatManager::GetRegionFor(wm, floatFrame,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
printf(" aDeltaBCoord=%d region={%d,%d,%d,%d}\n",
|
||||
aDeltaBCoord, region.IStart(wm), region.BStart(wm),
|
||||
region.ISize(wm), region.BSize(wm));
|
||||
@ -496,13 +504,13 @@ nsBlockReflowState::RecoverFloats(nsLineList::iterator aLine,
|
||||
#endif
|
||||
mFloatManager->AddFloat(floatFrame,
|
||||
nsFloatManager::GetRegionFor(wm, floatFrame,
|
||||
mContainerWidth),
|
||||
wm, mContainerWidth);
|
||||
ContainerWidth()),
|
||||
wm, ContainerWidth());
|
||||
fc = fc->Next();
|
||||
}
|
||||
} else if (aLine->IsBlock()) {
|
||||
nsBlockFrame::RecoverFloatsFor(aLine->mFirstChild, *mFloatManager, wm,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
}
|
||||
mFloatManager->Untranslate(oldWM, oPt);
|
||||
}
|
||||
@ -696,7 +704,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
|
||||
// The float's old region, so we can propagate damage.
|
||||
LogicalRect oldRegion = nsFloatManager::GetRegionFor(wm, aFloat,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
|
||||
// Enforce CSS2 9.5.1 rule [2], i.e., make sure that a float isn't
|
||||
// ``above'' another float that preceded it in the flow.
|
||||
@ -704,7 +712,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// set the origin to our writing mode
|
||||
LogicalPoint oPt(wm);
|
||||
WritingMode oldWM = mFloatManager->Translate(wm, oPt);
|
||||
mBCoord = std::max(mFloatManager->GetLowestFloatTop(wm, mContainerWidth),
|
||||
mBCoord = std::max(mFloatManager->GetLowestFloatTop(wm, ContainerWidth()),
|
||||
mBCoord);
|
||||
|
||||
// See if the float should clear any preceding floats...
|
||||
@ -918,14 +926,14 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
|
||||
// If float is relatively positioned, factor that in as well
|
||||
nsHTMLReflowState::ApplyRelativePositioning(aFloat, wm, floatOffsets,
|
||||
&origin, mContainerWidth);
|
||||
&origin, ContainerWidth());
|
||||
|
||||
// Position the float and make sure and views are properly
|
||||
// positioned. We need to explicitly position its child views as
|
||||
// well, since we're moving the float after flowing it.
|
||||
bool moved = aFloat->GetLogicalPosition(wm, mContainerWidth) != origin;
|
||||
bool moved = aFloat->GetLogicalPosition(wm, ContainerWidth()) != origin;
|
||||
if (moved) {
|
||||
aFloat->SetPosition(wm, origin, mContainerWidth);
|
||||
aFloat->SetPosition(wm, origin, ContainerWidth());
|
||||
nsContainerFrame::PositionFrameView(aFloat);
|
||||
nsContainerFrame::PositionChildViews(aFloat);
|
||||
}
|
||||
@ -939,7 +947,7 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
// calculate region
|
||||
LogicalRect region =
|
||||
nsFloatManager::CalculateRegionFor(wm, aFloat, floatMargin,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
// if the float split, then take up all of the vertical height
|
||||
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus) &&
|
||||
(NS_UNCONSTRAINEDSIZE != ContentBSize())) {
|
||||
@ -947,10 +955,10 @@ nsBlockReflowState::FlowAndPlaceFloat(nsIFrame* aFloat)
|
||||
ContentBSize() - floatPos.B(wm));
|
||||
}
|
||||
DebugOnly<nsresult> rv = mFloatManager->AddFloat(aFloat, region, wm,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv), "bad float placement");
|
||||
// store region
|
||||
nsFloatManager::StoreRegionFor(wm, aFloat, region, mContainerWidth);
|
||||
nsFloatManager::StoreRegionFor(wm, aFloat, region, ContainerWidth());
|
||||
|
||||
// If the float's dimensions have changed, note the damage in the
|
||||
// float manager.
|
||||
@ -1078,7 +1086,7 @@ nsBlockReflowState::ClearFloats(nscoord aBCoord, uint8_t aBreakType,
|
||||
|
||||
if (aBreakType != NS_STYLE_CLEAR_NONE) {
|
||||
newBCoord = mFloatManager->ClearFloats(wm, newBCoord, aBreakType,
|
||||
mContainerWidth, aFlags);
|
||||
ContainerWidth(), aFlags);
|
||||
}
|
||||
|
||||
if (aReplacedBlock) {
|
||||
|
@ -206,8 +206,10 @@ public:
|
||||
return mContentArea.Size(wm).ConvertTo(aWM, wm);
|
||||
}
|
||||
|
||||
// Physical width. Use only for physical <-> logical coordinate conversion.
|
||||
nscoord mContainerWidth;
|
||||
// Physical size. Use only for physical <-> logical coordinate conversion.
|
||||
nsSize mContainerSize;
|
||||
nscoord ContainerWidth() const { return mContainerSize.width; }
|
||||
nscoord ContainerHeight() const { return mContainerSize.height; }
|
||||
|
||||
// Continuation out-of-flow float frames that need to move to our
|
||||
// next in flow are placed here during reflow. It's a pointer to
|
||||
|
@ -199,7 +199,8 @@ nsFirstLetterFrame::Reflow(nsPresContext* aPresContext,
|
||||
ll.BeginLineReflow(bp.IStart(wm), bp.BStart(wm),
|
||||
availSize.ISize(wm), NS_UNCONSTRAINEDSIZE,
|
||||
false, true, kidWritingMode,
|
||||
aReflowState.AvailableWidth());
|
||||
nsSize(aReflowState.AvailableWidth(),
|
||||
aReflowState.AvailableHeight()));
|
||||
rs.mLineLayout = ≪
|
||||
ll.SetInFirstLetter(true);
|
||||
ll.SetFirstLetterStyleOK(true);
|
||||
|
@ -152,7 +152,7 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
||||
bool aImpactedByFloats,
|
||||
bool aIsTopOfPage,
|
||||
WritingMode aWritingMode,
|
||||
nscoord aContainerWidth)
|
||||
const nsSize& aContainerSize)
|
||||
{
|
||||
NS_ASSERTION(nullptr == mRootSpan, "bad linelayout user");
|
||||
NS_WARN_IF_FALSE(aISize != NS_UNCONSTRAINEDSIZE,
|
||||
@ -207,7 +207,7 @@ nsLineLayout::BeginLineReflow(nscoord aICoord, nscoord aBCoord,
|
||||
psd->mIStart = aICoord;
|
||||
psd->mICoord = aICoord;
|
||||
psd->mIEnd = aICoord + aISize;
|
||||
mContainerWidth = aContainerWidth;
|
||||
mContainerSize = aContainerSize;
|
||||
|
||||
// If we're in a constrained height frame, then we don't allow a
|
||||
// max line box width to take effect.
|
||||
@ -321,7 +321,7 @@ nsLineLayout::UpdateBand(WritingMode aWM,
|
||||
// need to convert to our writing mode, because we might have a different
|
||||
// mode from the caller due to dir: auto
|
||||
LogicalRect availSpace = aNewAvailSpace.ConvertTo(lineWM, aWM,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
#ifdef REALLY_NOISY_REFLOW
|
||||
printf("nsLL::UpdateBand %d, %d, %d, %d, (converted to %d, %d, %d, %d); frame=%p\n will set mImpacted to true\n",
|
||||
aNewAvailSpace.x, aNewAvailSpace.y,
|
||||
@ -1488,7 +1488,7 @@ nsLineLayout::AddBulletFrame(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
// Note: block-coord value will be updated during block-direction alignment
|
||||
pfd->mBounds = LogicalRect(lineWM, aFrame->GetRect(), mContainerWidth);
|
||||
pfd->mBounds = LogicalRect(lineWM, aFrame->GetRect(), ContainerWidth());
|
||||
pfd->mOverflowAreas = aMetrics.mOverflowAreas;
|
||||
}
|
||||
|
||||
@ -1504,7 +1504,7 @@ nsLineLayout::DumpPerSpanData(PerSpanData* psd, int32_t aIndent)
|
||||
nsFrame::IndentBy(stdout, aIndent+1);
|
||||
nsFrame::ListTag(stdout, pfd->mFrame);
|
||||
nsRect rect = pfd->mBounds.GetPhysicalRect(psd->mWritingMode,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
printf(" %d,%d,%d,%d\n", rect.x, rect.y, rect.width, rect.height);
|
||||
if (pfd->mSpan) {
|
||||
DumpPerSpanData(pfd->mSpan, aIndent + 1);
|
||||
@ -1593,7 +1593,7 @@ nsLineLayout::VerticalAlignLine()
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
if (pfd->mBlockDirAlign == VALIGN_OTHER) {
|
||||
pfd->mBounds.BStart(lineWM) += baselineBCoord;
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, mContainerWidth);
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidth());
|
||||
}
|
||||
}
|
||||
PlaceTopBottomFrames(psd, -mBStartEdge, lineBSize);
|
||||
@ -1604,7 +1604,7 @@ nsLineLayout::VerticalAlignLine()
|
||||
mLineBox->SetBounds(lineWM,
|
||||
psd->mIStart, mBStartEdge,
|
||||
psd->mICoord - psd->mIStart, lineBSize,
|
||||
mContainerWidth);
|
||||
ContainerWidth());
|
||||
|
||||
mLineBox->SetLogicalAscent(baselineBCoord - mBStartEdge);
|
||||
#ifdef NOISY_BLOCKDIR_ALIGN
|
||||
@ -3037,17 +3037,17 @@ nsLineLayout::TextAlignLine(nsLineBox* aLine,
|
||||
(!mPresContext->IsVisualMode() || !lineWM.IsBidiLTR())) {
|
||||
nsBidiPresUtils::ReorderFrames(psd->mFirstFrame->mFrame,
|
||||
aLine->GetChildCount(),
|
||||
lineWM, mContainerWidth,
|
||||
lineWM, mContainerSize,
|
||||
psd->mIStart + mTextIndent + dx);
|
||||
if (dx) {
|
||||
aLine->IndentBy(dx, mContainerWidth);
|
||||
aLine->IndentBy(dx, ContainerWidth());
|
||||
}
|
||||
} else if (dx) {
|
||||
for (PerFrameData* pfd = psd->mFirstFrame; pfd; pfd = pfd->mNext) {
|
||||
pfd->mBounds.IStart(lineWM) += dx;
|
||||
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerWidthForSpan(psd));
|
||||
}
|
||||
aLine->IndentBy(dx, mContainerWidth);
|
||||
aLine->IndentBy(dx, ContainerWidth());
|
||||
}
|
||||
}
|
||||
|
||||
@ -3061,13 +3061,13 @@ nsLineLayout::ApplyRelativePositioning(PerFrameData* aPFD)
|
||||
|
||||
nsIFrame* frame = aPFD->mFrame;
|
||||
WritingMode frameWM = frame->GetWritingMode();
|
||||
LogicalPoint origin = frame->GetLogicalPosition(mContainerWidth);
|
||||
LogicalPoint origin = frame->GetLogicalPosition(ContainerWidth());
|
||||
// right and bottom are handled by
|
||||
// nsHTMLReflowState::ComputeRelativeOffsets
|
||||
nsHTMLReflowState::ApplyRelativePositioning(frame, frameWM,
|
||||
aPFD->mOffsets, &origin,
|
||||
mContainerWidth);
|
||||
frame->SetPosition(frameWM, origin, mContainerWidth);
|
||||
ContainerWidth());
|
||||
frame->SetPosition(frameWM, origin, ContainerWidth());
|
||||
}
|
||||
|
||||
// This method do relative positioning for ruby annotations.
|
||||
@ -3120,7 +3120,7 @@ nsLineLayout::RelativePositionFrames(PerSpanData* psd, nsOverflowAreas& aOverflo
|
||||
// children of the block starts at the upper left corner of the
|
||||
// line and is sized to match the size of the line's bounding box
|
||||
// (the same size as the values returned from VerticalAlignFrames)
|
||||
overflowAreas.VisualOverflow() = rect.GetPhysicalRect(wm, mContainerWidth);
|
||||
overflowAreas.VisualOverflow() = rect.GetPhysicalRect(wm, ContainerWidth());
|
||||
overflowAreas.ScrollableOverflow() = overflowAreas.VisualOverflow();
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
bool aImpactedByFloats,
|
||||
bool aIsTopOfPage,
|
||||
mozilla::WritingMode aWritingMode,
|
||||
nscoord aContainerWidth);
|
||||
const nsSize& aContainerSize);
|
||||
|
||||
void EndLineReflow();
|
||||
|
||||
@ -549,11 +549,11 @@ protected:
|
||||
|
||||
// The container width to use when converting between logical and
|
||||
// physical coordinates for frames in this span. For the root span
|
||||
// this is the width of the block cached in mContainerWidth; for
|
||||
// this is the width of the block cached in mContainerSize.width; for
|
||||
// child spans it's the width of the root span
|
||||
nscoord ContainerWidthForSpan(PerSpanData* aPSD) {
|
||||
return (aPSD == mRootSpan)
|
||||
? mContainerWidth
|
||||
? ContainerWidth()
|
||||
: aPSD->mFrame->mBounds.Width(mRootSpan->mWritingMode);
|
||||
}
|
||||
|
||||
@ -588,8 +588,10 @@ protected:
|
||||
// frame, if any
|
||||
nscoord mTrimmableISize;
|
||||
|
||||
// Physical width. Use only for physical <-> logical coordinate conversion.
|
||||
nscoord mContainerWidth;
|
||||
// Physical size. Use only for physical <-> logical coordinate conversion.
|
||||
nsSize mContainerSize;
|
||||
nscoord ContainerWidth() const { return mContainerSize.width; }
|
||||
nscoord ContainerHeight() const { return mContainerSize.height; }
|
||||
|
||||
bool mFirstLetterStyleOK : 1;
|
||||
bool mIsTopOfPage : 1;
|
||||
|
@ -387,10 +387,10 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
|
||||
// Border and padding are suppressed on ruby text containers.
|
||||
// If the writing mode is vertical-rl, the horizontal position of
|
||||
// rt frames will be updated when reflowing this text container,
|
||||
// hence leave container width 0 here for now.
|
||||
// hence leave container size 0 here for now.
|
||||
lineLayout->BeginLineReflow(0, 0, reflowState->ComputedISize(),
|
||||
NS_UNCONSTRAINEDSIZE,
|
||||
false, false, lineWM, 0);
|
||||
false, false, lineWM, nsSize(0, 0));
|
||||
lineLayout->AttachRootFrameToBaseLineLayout();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user