# HG changeset patch # User Simon Montagu # Date 1334855010 -10800 # Node ID faa9c4a0b25d1b7a586745f41a716d605ab06ee0 # Parent 27dbee415590883a8e6b45e5eaf77e76e9ecda97 imported patch 746987 diff --git a/layout/base/nsBidiPresUtils.cpp b/layout/base/nsBidiPresUtils.cpp --- a/layout/base/nsBidiPresUtils.cpp +++ b/layout/base/nsBidiPresUtils.cpp @@ -159,22 +159,28 @@ struct BidiParagraphData { mReset = true; mLogicalFrames.Clear(); mLinePerFrame.Clear(); mContentToFrameIndex.Clear(); mBuffer.SetLength(0); mPrevFrame = aBpd->mPrevFrame; mParagraphDepth = aBpd->mParagraphDepth + 1; + const nsStyleTextReset* text = aBDIFrame->GetStyleTextReset(); bool isRTL = (NS_STYLE_DIRECTION_RTL == aBDIFrame->GetStyleVisibility()->mDirection); - mParaLevel = mParagraphDepth * 2; - if (isRTL) ++mParaLevel; - if (aBDIFrame->GetStyleTextReset()->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_OVERRIDE) { + if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_PLAINTEXT) { + mParaLevel = NSBIDI_DEFAULT_LTR; + } else { + mParaLevel = mParagraphDepth * 2; + if (isRTL) ++mParaLevel; + } + + if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_OVERRIDE) { PushBidiControl(isRTL ? kRLO : kLRO); } } nsresult SetPara() { return mBidiEngine->SetPara(mBuffer.get(), BufferLength(), mParaLevel, nsnull); @@ -1136,17 +1142,18 @@ nsBidiPresUtils::TraverseFrames(nsBlockF } } } else { // For a non-leaf frame, recurse into TraverseFrames nsIFrame* kid = frame->GetFirstPrincipalChild(); if (kid) { const nsStyleTextReset* text = frame->GetStyleTextReset(); - if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE) { + if (text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_ISOLATE || + text->mUnicodeBidi & NS_STYLE_UNICODE_BIDI_PLAINTEXT) { // css "unicode-bidi: isolate" and html5 bdi: // resolve the element as a separate paragraph BidiParagraphData* subParagraph = aBpd->GetSubParagraph(); /* * As at the beginning of the loop, it's important to check for * next-continuations before handling the frame. If we do * TraverseFrames and *then* do GetNextContinuation on the original