Bug 1107721 - Link line layouts of ruby annotations to those of their ruby base. r=dbaron

--HG--
extra : source : 40765e88bed63f79923291cff4af4e74d86b1681
extra : histedit_source : 75244b84b9bcbdfe0f06b452cb6de7ab65b11e79
This commit is contained in:
Xidorn Quan 2014-12-10 10:04:15 +11:00
parent 3672bdd40e
commit 968c81c13e

View File

@ -310,8 +310,10 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
aPresContext, *aReflowState.parentReflowState, textContainer, availSize);
reflowStates.AppendElement(reflowState);
reflowStateArray->AppendElement(reflowState);
nsLineLayout* lineLayout = new nsLineLayout(
aPresContext, reflowState->mFloatManager, reflowState, nullptr, nullptr);
nsLineLayout* lineLayout = new nsLineLayout(aPresContext,
reflowState->mFloatManager,
reflowState, nullptr,
aReflowState.mLineLayout);
lineLayouts.AppendElement(lineLayout);
// Line number is useless for ruby text
@ -329,6 +331,7 @@ nsRubyBaseContainerFrame::Reflow(nsPresContext* aPresContext,
reflowState->ComputedISize(),
NS_UNCONSTRAINEDSIZE,
false, false, lineWM, containerWidth);
lineLayout->AttachRootFrameToBaseLineLayout();
}
WritingMode frameWM = aReflowState.GetWritingMode();
@ -573,6 +576,9 @@ nsRubyBaseContainerFrame::ReflowOnePair(nsPresContext* aPresContext,
for (uint32_t i = 0; i < rtcCount; i++) {
nsLineLayout* lineLayout = aReflowStates[i]->mLineLayout;
lineLayout->AdvanceICoord(icoord - lineLayout->GetCurrentICoord());
if (aBaseFrame && aTextFrames[i]) {
lineLayout->AttachLastFrameToBaseLineLayout();
}
}
mPairCount++;