Permalink
Browse files

Make unicode-bidi: [-moz-]plaintext apply to inline elements. Bug 746…

…987, r=roc
  • Loading branch information...
1 parent 4a434c8 commit 3b35f870a4649e43790ab22fa018b3c94d76411b @smontagu smontagu committed May 9, 2012
Showing with 11 additions and 4 deletions.
  1. +11 −4 layout/base/nsBidiPresUtils.cpp
@@ -164,12 +164,18 @@ struct BidiParagraphData {
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);
}
}
@@ -1131,7 +1137,8 @@ nsBidiPresUtils::TraverseFrames(nsBlockFrame* aBlockFrame,
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();

0 comments on commit 3b35f87

Please sign in to comment.