Don't include floats in bidi resolution and reordering, unless they are first-letters. Bug 588739, r+a=roc

This commit is contained in:
Simon Montagu 2010-09-06 17:33:18 +03:00
Родитель 81990e4947
Коммит 4421d80c31
1 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -627,14 +627,14 @@ nsBidiPresUtils::InitLogicalArray(nsIFrame* aCurrentFrame)
for (nsIFrame* childFrame = aCurrentFrame; childFrame;
childFrame = childFrame->GetNextSibling()) {
// If the real frame for a placeholder is an inline container, we need to
// drill down into it and include its contents in Bidi resolution. If it
// isn't an inline container, we just use the placeholder.
// If the real frame for a placeholder is a first letter frame, we need to
// drill down into it and include its contents in Bidi resolution.
// If not, we just use the placeholder.
nsIFrame* frame = childFrame;
if (nsGkAtoms::placeholderFrame == childFrame->GetType()) {
nsIFrame* realFrame =
nsPlaceholderFrame::GetRealFrameForPlaceholder(childFrame);
if (realFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
if (realFrame->GetType() == nsGkAtoms::letterFrame) {
frame = realFrame;
}
}
@ -843,8 +843,10 @@ nsBidiPresUtils::GetFrameEmbeddingLevel(nsIFrame* aFrame)
{
nsIFrame* firstLeaf = aFrame;
while (!IsBidiLeaf(firstLeaf)) {
firstLeaf =
nsPlaceholderFrame::GetRealFrameFor(firstLeaf->GetFirstChild(nsnull));
nsIFrame* firstChild = firstLeaf->GetFirstChild(nsnull);
nsIFrame* realFrame = nsPlaceholderFrame::GetRealFrameFor(firstChild);
firstLeaf = (realFrame->GetType() == nsGkAtoms::letterFrame) ?
realFrame : firstChild;
}
return NS_GET_EMBEDDING_LEVEL(firstLeaf);
}