Only substitute real frame for placeholder frame when it is an inline container. Bug 394239, r+sr+a=roc
authorsmontagu@smontagu.org
Mon, 03 Sep 2007 07:30:38 -0700
changeset 5596 87ab46047ebf93f29d920298580354424f1e754f
parent 5595 0034fde158df702116234f9d217522136b65293e
child 5597 7c1d32b11d1bd9572a290f5f53077f445223360d
push idunknown
push userunknown
push dateunknown
bugs394239
milestone1.9a8pre
Only substitute real frame for placeholder frame when it is an inline container. Bug 394239, r+sr+a=roc
layout/base/nsBidiPresUtils.cpp
--- a/layout/base/nsBidiPresUtils.cpp
+++ b/layout/base/nsBidiPresUtils.cpp
@@ -482,18 +482,27 @@ void
 nsBidiPresUtils::InitLogicalArray(nsIFrame*       aCurrentFrame)
 {
   nsIPresShell* shell = aCurrentFrame->PresContext()->PresShell();
   nsStyleContext* styleContext;
 
   for (nsIFrame* childFrame = aCurrentFrame; childFrame;
        childFrame = childFrame->GetNextSibling()) {
 
-    nsIFrame* frame = (nsGkAtoms::placeholderFrame == childFrame->GetType()) ?
-      nsPlaceholderFrame::GetRealFrameFor(childFrame) : childFrame;
+    // 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.
+    nsIFrame* frame = childFrame;
+    if (nsGkAtoms::placeholderFrame == childFrame->GetType()) {
+      nsIFrame* realFrame =
+        nsPlaceholderFrame::GetRealFrameForPlaceholder(childFrame);
+      if (realFrame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
+        frame = realFrame;
+      }
+    }
 
     PRUnichar ch = 0;
     if (frame->IsFrameOfType(nsIFrame::eBidiInlineContainer)) {
       const nsStyleVisibility* vis = frame->GetStyleVisibility();
       const nsStyleTextReset* text = frame->GetStyleTextReset();
       switch (text->mUnicodeBidi) {
         case NS_STYLE_UNICODE_BIDI_NORMAL:
           break;