Merge Bug 366774
authorPhilip Chee <philip.chee@gmail.com>
Mon, 25 Apr 2011 02:19:44 +0800
changeset 68488 8db1df84708ca997c2d1ba1851324405a3f3d6c3
parent 68486 e49949eeaef3052429a3309548b8e9778f1bbb51 (current diff)
parent 68487 2928c63ffb5bedba9cecbf3c01e49aca5d4e439b (diff)
child 68490 54b9f7d8db85cafbde935402b6429530ba459366
push id19661
push userphilip.chee@gmail.com
push dateSun, 24 Apr 2011 18:25:41 +0000
treeherdermozilla-central@8302f5191d92 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs366774
milestone6.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge Bug 366774
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -3196,16 +3196,37 @@ NS_IMETHODIMP DocumentViewerImpl::GetBid
 
   if (aSupport) {
     GetBidiOptions(&bidiOptions);
     *aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions);
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP DocumentViewerImpl::SetBidiCharacterSet(PRUint8 aCharacterSet)
+{
+  PRUint32 bidiOptions;
+
+  GetBidiOptions(&bidiOptions);
+  SET_BIDI_OPTION_CHARACTERSET(bidiOptions, aCharacterSet);
+  SetBidiOptions(bidiOptions);
+  return NS_OK;
+}
+
+NS_IMETHODIMP DocumentViewerImpl::GetBidiCharacterSet(PRUint8* aCharacterSet)
+{
+  PRUint32 bidiOptions;
+
+  if (aCharacterSet) {
+    GetBidiOptions(&bidiOptions);
+    *aCharacterSet = GET_BIDI_OPTION_CHARACTERSET(bidiOptions);
+  }
+  return NS_OK;
+}
+
 NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions)
 {
   if (mPresContext) {
     mPresContext->SetBidi(aBidiOptions, PR_TRUE); // could cause reflow
   }
   // now set bidi on all children of mContainer
   CallChildren(SetChildBidiOptions, NS_INT32_TO_PTR(aBidiOptions));
   return NS_OK;
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -759,16 +759,21 @@ nsPresContext::GetUserPreferences()
                                GET_BIDI_OPTION_NUMERAL(bidiOptions));
   SET_BIDI_OPTION_NUMERAL(bidiOptions, prefInt);
 
   prefInt =
     nsContentUtils::GetIntPref(IBMBIDI_SUPPORTMODE_STR,
                                GET_BIDI_OPTION_SUPPORT(bidiOptions));
   SET_BIDI_OPTION_SUPPORT(bidiOptions, prefInt);
 
+  prefInt =
+    nsContentUtils::GetIntPref(IBMBIDI_CHARSET_STR,
+                               GET_BIDI_OPTION_CHARACTERSET(bidiOptions));
+  SET_BIDI_OPTION_CHARACTERSET(bidiOptions, prefInt);
+
   // We don't need to force reflow: either we are initializing a new
   // prescontext or we are being called from UpdateAfterPreferencesChanged()
   // which triggers a reflow anyway.
   SetBidi(bidiOptions, PR_FALSE);
 }
 
 void
 nsPresContext::AppUnitsPerDevPixelChanged()