зеркало из https://github.com/mozilla/pjs.git
Bug 491547. Special case creating a bidi continuation inside a floating first letter frame. r=roc,smontagu
--HG-- extra : rebase_source : 20d1d90542c7b78583e1ceff35669f25383e2380
This commit is contained in:
Родитель
4cb694dec5
Коммит
f21e11f649
|
@ -205,6 +205,38 @@ CreateBidiContinuation(nsIFrame* aFrame,
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Have to special case floating first letter frames because the continuation
|
||||||
|
// doesn't go in the first letter frame. The continuation goes with the rest
|
||||||
|
// of the text that the first letter frame was made out of.
|
||||||
|
if (parent->GetType() == nsGkAtoms::letterFrame &&
|
||||||
|
parent->GetStyleDisplay()->IsFloating()) {
|
||||||
|
nsIFrame* oldParent = parent;
|
||||||
|
nsPlaceholderFrame* placeholderFrame =
|
||||||
|
presShell->FrameManager()->GetPlaceholderFrameFor(parent);
|
||||||
|
parent = placeholderFrame->GetParent();
|
||||||
|
|
||||||
|
(*aNewFrame)->SetParent(parent);
|
||||||
|
nsHTMLContainerFrame::ReparentFrameView(aFrame->PresContext(), *aNewFrame,
|
||||||
|
oldParent, parent);
|
||||||
|
|
||||||
|
// The continuation will have gotten the first letter style from it's prev
|
||||||
|
// continuation, so we need to repair the style context so it doesn't have
|
||||||
|
// the first letter styling.
|
||||||
|
nsStyleContext* parentSC = oldParent->GetStyleContext()->GetParent();
|
||||||
|
if (parentSC) {
|
||||||
|
nsRefPtr<nsStyleContext> newSC;
|
||||||
|
newSC = presShell->StyleSet()->ResolveStyleForNonElement(parentSC);
|
||||||
|
if (newSC) {
|
||||||
|
(*aNewFrame)->SetStyleContext(newSC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// The list name nsGkAtoms::nextBidi would indicate we don't want reflow
|
||||||
|
nsFrameList temp(*aNewFrame, *aNewFrame);
|
||||||
|
rv = parent->InsertFrames(nsGkAtoms::nextBidi, placeholderFrame, temp);
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
// The list name nsGkAtoms::nextBidi would indicate we don't want reflow
|
// The list name nsGkAtoms::nextBidi would indicate we don't want reflow
|
||||||
// XXXbz this needs higher-level framelist love
|
// XXXbz this needs higher-level framelist love
|
||||||
nsFrameList temp(*aNewFrame, *aNewFrame);
|
nsFrameList temp(*aNewFrame, *aNewFrame);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче