remove ifdef IBMBIDI in content/, r+sr=roc+moz, bug 89203

This commit is contained in:
cbiesinger%web.de 2003-01-17 12:09:23 +00:00
Родитель d8658d7ac9
Коммит 23130b6148
35 изменённых файлов: 7 добавлений и 269 удалений

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

@ -189,7 +189,6 @@ public:
*/
NS_IMETHOD GetContentLanguage(nsAString& aContentLanguage) const = 0;
#ifdef IBMBIDI
// The state BidiEnabled should persist across multiple views (screen, print)
// of the same document.
@ -206,7 +205,6 @@ public:
* the document no longer contains bidi data.
*/
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled) = 0;
#endif // IBMBIDI
/**
* Return the Line Breaker for the document

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

@ -131,9 +131,7 @@
#include "nsIRadioVisitor.h"
#include "nsIFormControl.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID);
static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID);
@ -518,9 +516,7 @@ nsDocument::nsDocument() : mSubDocuments(nsnull),
mNextContentID = NS_CONTENT_ID_COUNTER_BASE;
mBoxObjectTable = nsnull;
mNumCapturers = 0;
#ifdef IBMBIDI
mBidiEnabled = PR_FALSE;
#endif // IBMBIDI
// Force initialization.
mBindingManager = do_CreateInstance("@mozilla.org/xbl/binding-manager;1");
@ -2903,7 +2899,6 @@ nsDocument::SetBoxObjectFor(nsIDOMElement* aElement, nsIBoxObject* aBoxObject)
return NS_OK;
}
#ifdef IBMBIDI
struct DirTable {
const char* mName;
PRUint8 mValue;
@ -2913,7 +2908,6 @@ static const DirTable dirAttributes[] = {
{"rtl", IBMBIDI_TEXTDIRECTION_RTL},
{0}
};
#endif // IBMBIDI
/**
* Retrieve the "direction" property of the document.
@ -2923,7 +2917,6 @@ static const DirTable dirAttributes[] = {
NS_IMETHODIMP
nsDocument::GetDir(nsAString& aDirection)
{
#ifdef IBMBIDI
nsCOMPtr<nsIPresShell> shell = (nsIPresShell*)mPresShells.SafeElementAt(0);
if (shell) {
nsCOMPtr<nsIPresContext> context;
@ -2939,9 +2932,7 @@ nsDocument::GetDir(nsAString& aDirection)
}
}
}
#else
aDirection.Assign(NS_LITERAL_STRING("ltr"));
#endif // IBMBIDI
return NS_OK;
}
@ -2953,7 +2944,6 @@ nsDocument::GetDir(nsAString& aDirection)
NS_IMETHODIMP
nsDocument::SetDir(const nsAString& aDirection)
{
#ifdef IBMBIDI
if (mPresShells.Count() != 0) {
nsCOMPtr<nsIPresShell> shell = (nsIPresShell*)mPresShells.ElementAt(0);
if (shell) {
@ -2974,7 +2964,6 @@ nsDocument::SetDir(const nsAString& aDirection)
}
}
}
#endif // IBMBIDI
return NS_OK;
}
@ -3926,7 +3915,6 @@ nsDocument::WalkRadioGroup(const nsAString& aName,
return rv;
}
#ifdef IBMBIDI
/**
* Check if bidi enabled (set depending on the presence of RTL
* characters). If enabled, we should apply the Unicode Bidi Algorithm
@ -3952,4 +3940,3 @@ nsDocument::SetBidiEnabled(PRBool aBidiEnabled)
mBidiEnabled = aBidiEnabled;
return NS_OK;
}
#endif // IBMBIDI

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

@ -364,7 +364,6 @@ public:
*/
NS_IMETHOD RemoveCharSetObserver(nsIObserver* aObserver);
#ifdef IBMBIDI
/**
* Check if the document contains bidi data.
* If so, we have to apply the Unicode Bidi Algorithm.
@ -374,7 +373,6 @@ public:
* Indicate the document contains RTL characters.
*/
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled);
#endif // IBMBIDI
/**
* Return the Line Breaker for the document
@ -664,9 +662,7 @@ protected:
nsHashtable mRadioGroups;
#ifdef IBMBIDI
PRBool mBidiEnabled;
#endif // IBMBIDI
nsCOMPtr<nsIBindingManager> mBindingManager;
nsCOMPtr<nsINodeInfoManager> mNodeInfoManager;

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

@ -191,9 +191,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printset
#include "nsIDOMFocusListener.h"
#include "nsISelectionController.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
static NS_DEFINE_CID(kPresShellCID, NS_PRESSHELL_CID);
static NS_DEFINE_CID(kGalleyContextCID, NS_GALLEYCONTEXT_CID);
@ -2499,193 +2497,161 @@ NS_IMETHODIMP DocumentViewerImpl::SetHintCharacterSet(const PRUnichar* aHintChar
return CallChildren(SetChildHintCharacterSet, (void*) aHintCharacterSet);
}
#ifdef IBMBIDI
static void
SetChildBidiOptions(nsIMarkupDocumentViewer* aChild, void* aClosure)
{
aChild->SetBidiOptions(NS_PTR_TO_INT32(aClosure));
}
#endif // IBMBIDI
NS_IMETHODIMP DocumentViewerImpl::SetBidiTextDirection(PRUint8 aTextDirection)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_DIRECTION(bidiOptions, aTextDirection);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiTextDirection(PRUint8* aTextDirection)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aTextDirection) {
GetBidiOptions(&bidiOptions);
*aTextDirection = GET_BIDI_OPTION_DIRECTION(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiTextType(PRUint8 aTextType)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_TEXTTYPE(bidiOptions, aTextType);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiTextType(PRUint8* aTextType)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aTextType) {
GetBidiOptions(&bidiOptions);
*aTextType = GET_BIDI_OPTION_TEXTTYPE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiControlsTextMode(PRUint8 aControlsTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions, aControlsTextMode);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiControlsTextMode(PRUint8* aControlsTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aControlsTextMode) {
GetBidiOptions(&bidiOptions);
*aControlsTextMode = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiClipboardTextMode(PRUint8 aClipboardTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions, aClipboardTextMode);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiClipboardTextMode(PRUint8* aClipboardTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aClipboardTextMode) {
GetBidiOptions(&bidiOptions);
*aClipboardTextMode = GET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiNumeral(PRUint8 aNumeral)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_NUMERAL(bidiOptions, aNumeral);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiNumeral(PRUint8* aNumeral)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aNumeral) {
GetBidiOptions(&bidiOptions);
*aNumeral = GET_BIDI_OPTION_NUMERAL(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiSupport(PRUint8 aSupport)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_SUPPORT(bidiOptions, aSupport);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiSupport(PRUint8* aSupport)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aSupport) {
GetBidiOptions(&bidiOptions);
*aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiCharacterSet(PRUint8 aCharacterSet)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CHARACTERSET(bidiOptions, aCharacterSet);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiCharacterSet(PRUint8* aCharacterSet)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aCharacterSet) {
GetBidiOptions(&bidiOptions);
*aCharacterSet = GET_BIDI_OPTION_CHARACTERSET(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions)
{
#ifdef IBMBIDI
if (mPresContext) {
#if 1
// forcing reflow will cause bug 80352. Temp turn off force reflow and
@ -2697,13 +2663,11 @@ NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions)
}
// now set bidi on all children of mContainer
CallChildren(SetChildBidiOptions, (void*) aBidiOptions);
#endif // IBMBIDI
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions)
{
#ifdef IBMBIDI
if (aBidiOptions) {
if (mPresContext) {
mPresContext->GetBidi(aBidiOptions);
@ -2711,7 +2675,6 @@ NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions)
else
*aBidiOptions = IBMBIDI_DEFAULT_BIDI_OPTIONS;
}
#endif // IBMBIDI
return NS_OK;
}

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

@ -652,11 +652,9 @@ nsGenericDOMDataNode::SetDocument(nsIDocument* aDocument, PRBool aDeep,
{
mDocument = aDocument;
#ifdef IBMBIDI
if (mDocument && mText.IsBidi()) {
mDocument->SetBidiEnabled(PR_TRUE);
}
#endif
return NS_OK;
}
@ -1206,9 +1204,7 @@ nsGenericDOMDataNode::SetText(const PRUnichar* aBuffer,
mText.SetTo(aBuffer, aLength);
#ifdef IBMBIDI
SetBidiStatus();
#endif // IBMBIDI
if (mDocument && nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED)) {
nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(this));
@ -1287,9 +1283,7 @@ nsGenericDOMDataNode::SetText(const nsAString& aStr,
mText = aStr;
#ifdef IBMBIDI
SetBidiStatus();
#endif // IBMBIDI
if (mDocument && nsGenericElement::HasMutationListeners(this, NS_EVENT_BITS_MUTATION_CHARACTERDATAMODIFIED)) {
nsCOMPtr<nsIDOMEventTarget> node(do_QueryInterface(this));
@ -1404,7 +1398,6 @@ nsGenericDOMDataNode::LookupRangeList() const
return nsnull;
}
#ifdef IBMBIDI
void nsGenericDOMDataNode::SetBidiStatus()
{
if (mDocument) {
@ -1425,4 +1418,3 @@ void nsGenericDOMDataNode::SetBidiStatus()
mDocument->SetBidiEnabled(PR_TRUE);
}
}
#endif // IBMBIDI

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

@ -267,9 +267,7 @@ private:
void LookupListenerManager(nsIEventListenerManager **aListenerManager) const;
nsVoidArray *LookupRangeList() const;
#ifdef IBMBIDI
void SetBidiStatus();
#endif
typedef long PtrBits;

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

@ -2506,7 +2506,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData,
text->mTextDecoration = parentText->mTextDecoration;
}
#ifdef IBMBIDI
// unicode-bidi: enum, normal, inherit
if (eCSSUnit_Normal == textData.mUnicodeBidi.GetUnit() ) {
text->mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL;
@ -2518,7 +2517,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData,
inherited = PR_TRUE;
text->mUnicodeBidi = parentText->mUnicodeBidi;
}
#endif // IBMBIDI
if (inherited)
// We inherited, and therefore can't be cached in the rule node. We have to be put right on the
@ -3058,10 +3056,8 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct,
// direction: enum, inherit
if (eCSSUnit_Enumerated == displayData.mDirection.GetUnit()) {
visibility->mDirection = displayData.mDirection.GetIntValue();
#ifdef IBMBIDI
if (NS_STYLE_DIRECTION_RTL == visibility->mDirection)
mPresContext->SetBidiEnabled(PR_TRUE);
#endif // IBMBIDI
}
else if (eCSSUnit_Inherit == displayData.mDirection.GetUnit()) {
inherited = PR_TRUE;

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

@ -253,10 +253,8 @@ public:
nsDirection GetDirection(){return mDirection;}
void SetDirection(nsDirection aDir){mDirection = aDir;}
#ifdef IBMBIDI
PRBool GetTrueDirection() {return mTrueDirection;}
void SetTrueDirection(PRBool aBool){mTrueDirection = aBool;}
#endif
NS_IMETHOD CopyRangeToAnchorFocus(nsIDOMRange *aRange);
@ -310,9 +308,7 @@ private:
SelectionType mType;//type of this nsTypedSelection;
nsAutoScrollTimer *mAutoScrollTimer; // timer for autoscrolling.
nsCOMArray<nsISelectionListener> mSelectionListeners;
#ifdef IBMBIDI
PRBool mTrueDirection;
#endif
nsCOMPtr<nsIEventQueue> mEventQueue;
PRBool mScrollEventPosted;
};
@ -389,7 +385,6 @@ public:
NS_IMETHOD GetLimiter(nsIContent **aLimiterContent);
NS_IMETHOD SetMouseDoubleDown(PRBool aDoubleDown);
NS_IMETHOD GetMouseDoubleDown(PRBool *aDoubleDown);
#ifdef IBMBIDI
NS_IMETHOD GetPrevNextBidiLevels(nsIPresContext *aPresContext,
nsIContent *aNode,
PRUint32 aContentOffset,
@ -403,7 +398,6 @@ public:
PRUint8 aBidiLevel,
nsIFrame **aFrameOut);
#endif // IBMBIDI
/*END nsIFrameSelection interfacse*/
@ -421,7 +415,6 @@ private:
NS_IMETHOD TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset,
PRBool aContinueSelection, PRBool aMultipleSelection);
#ifdef IBMBIDI
void BidiLevelFromMove(nsIPresContext* aContext,
nsIPresShell* aPresShell,
nsIContent *aNode,
@ -452,7 +445,6 @@ private:
PRInt32 aCurrentOffset,
nsPeekOffsetStruct aPos);
#endif // VISUALSELECTION
#endif // IBMBIDI
//post and pop reasons for notifications. we may stack these later
void PostReason(short aReason){mReason = aReason;}
@ -1560,7 +1552,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
// SetDesiredX(desiredX);
}
#ifdef IBMBIDI
nsCOMPtr<nsICaret> caret;
nsCOMPtr<nsIPresShell> shell;
result = context->GetShell(getter_AddRefs(shell));
@ -1569,7 +1560,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
result = shell->GetCaret(getter_AddRefs(caret));
if (NS_FAILED(result) || !caret)
return 0;
#endif
offsetused = mDomSelections[index]->FetchFocusOffset();
weakNodeUsed = mDomSelections[index]->FetchFocusNode();
@ -1645,7 +1635,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent)
{
tHint = (HINT)pos.mPreferLeft;
#ifdef IBMBIDI
PRBool bidiEnabled = PR_FALSE;
context->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
@ -1715,7 +1704,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
#else
}
#endif // VISUALSELECTION
#endif // IBMBIDI
result = TakeFocus(pos.mResultContent, pos.mContentOffset, pos.mContentOffset, aContinue, PR_FALSE);
}
if (NS_SUCCEEDED(result))
@ -1846,7 +1834,6 @@ nsTypedSelection::GetInterlinePosition(PRBool *aHintRight)
return rv;
}
#ifdef IBMBIDI
nsDirection ReverseDirection(nsDirection aDirection)
{
return (eDirNext == aDirection) ? eDirPrevious : eDirNext;
@ -2580,7 +2567,6 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset)
(void**)&frameLevel, sizeof(frameLevel) );
shell->SetCaretBidiLevel(frameLevel);
}
#endif //IBMBIDI
NS_IMETHODIMP
nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset,
@ -2595,9 +2581,7 @@ nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset,
// Don't take focus when dragging off of a table
if (!mDragSelectingCells)
{
#ifdef IBMBIDI
BidiLevelFromClick(aNewFocus, aContentOffset);
#endif
PostReason(nsISelectionListener::MOUSEDOWN_REASON + nsISelectionListener::DRAG_REASON);
return TakeFocus(aNewFocus, aContentOffset, aContentEndOffset, aContinueSelection, aMultipleSelection);
}
@ -2709,7 +2693,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
if (NS_SUCCEEDED(result))
{
#ifdef IBMBIDI
#ifdef VISUALSELECTION
PRBool bidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&bidiEnabled);
@ -2736,7 +2719,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
}
else
#endif // VISUALSELECTION
#endif // IBMBIDI
result = HandleClick(newContent, startPos, contentOffsetEnd, PR_TRUE,
PR_FALSE, beginOfContent);
}
@ -2816,12 +2798,8 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset,
mBatching = batching;
mChangesDuringBatching = changes;
}
#ifdef IBMBIDI
if (aContentEndOffset != aContentOffset)
#else
if (aContentEndOffset > aContentOffset)
#endif // IBMBIDI
mDomSelections[index]->Extend(domNode,aContentEndOffset);
mDomSelections[index]->Extend(domNode,aContentEndOffset);
//find out if we are inside a table. if so, find out which one and which cell
//once we do that, the next time we get a takefocus, check the parent tree.
@ -7855,7 +7833,6 @@ nsTypedSelection::DeleteFromDocument()
NS_IMETHODIMP
nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
{
#ifdef IBMBIDI
nsresult result;
nsCOMPtr<nsIDOMNode> focusNode;
nsCOMPtr<nsIContent> focusContent;
@ -7927,6 +7904,5 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
else
shell->SetCaretBidiLevel(levelAfter);
}
#endif // IBMBIDI
return NS_OK;
}

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

@ -139,7 +139,6 @@ public:
return mState.mIs2b;
}
#ifdef IBMBIDI
/**
* Return PR_TRUE if this fragment contains Bidi text
* For performance reasons this flag is not set automatically, but
@ -149,8 +148,6 @@ public:
{
return mState.mIsBidi;
}
#endif
/**
* Get a pointer to constant PRUnichar data.
@ -240,13 +237,11 @@ public:
return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]);
}
#ifdef IBMBIDI
/**
* Scan the contents of the fragment and turn on mState.mIsBidi if it
* includes any Bidi characters.
*/
void SetBidiFlag();
#endif
struct FragmentBits {
PRBool mInHeap : 1;

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

@ -65,15 +65,7 @@ static NS_DEFINE_CID(kCharsetConverterManagerCID,
#include "nsIStringBundle.h"
//BIDI
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#else
//
// Make BIDI stuff work when BIDI is off
//
#define GET_BIDI_OPTION_CONTROLSTEXTMODE(x) 0
#define GET_BIDI_OPTION_DIRECTION(x) 0
#endif
//end
@ -1154,10 +1146,8 @@ GetSubmissionFromForm(nsIHTMLContent* aForm,
// Get BIDI options
PRUint32 bidiOptions = 0;
PRUint8 ctrlsModAtSubmit = 0;
#ifdef IBMBIDI
aPresContext->GetBidi(&bidiOptions);
ctrlsModAtSubmit = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions);
#endif
// Get encoding type (default: urlencoded)
PRInt32 enctype = NS_FORM_ENCTYPE_URLENCODED;
@ -1293,7 +1283,6 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm,
rv = doc->GetDocumentCharacterSet(oCharset);
}
#ifdef IBMBIDI
if (aCtrlsModAtSubmit==IBMBIDI_CONTROLSTEXTMODE_VISUAL
&& oCharset.Equals(NS_LITERAL_STRING("windows-1256"),
nsCaseInsensitiveStringComparator())) {
@ -1316,7 +1305,6 @@ nsFormSubmission::GetSubmitCharset(nsIHTMLContent* aForm,
oCharset = NS_LITERAL_STRING("IBM864");
}
#endif
}
// JBK moved from nsFormFrame - bug 34297
@ -1355,7 +1343,6 @@ nsFormSubmission::UnicodeToNewBytes(const PRUnichar* aStr, PRUint32 aLen,
{
nsresult rv = NS_OK;
#ifdef IBMBIDI
PRUint8 ctrlsModAtSubmit = GET_BIDI_OPTION_CONTROLSTEXTMODE(mBidiOptions);
PRUint8 textDirAtSubmit = GET_BIDI_OPTION_DIRECTION(mBidiOptions);
//ahmed 15-1
@ -1409,7 +1396,6 @@ nsFormSubmission::UnicodeToNewBytes(const PRUnichar* aStr, PRUint32 aLen,
}
aStr = (PRUnichar*)temp.get();
}
#endif
char* res = nsnull;

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

@ -2568,7 +2568,6 @@ nsGenericHTMLElement::GetMappedAttributeImpact(const nsIAtom* aAttribute,
return NS_OK;
}
#ifdef IBMBIDI
/**
* Handle attributes on the BDO element
*/
@ -2582,17 +2581,14 @@ MapBdoAttributesInto(const nsIHTMLMappedAttributes* aAttributes,
}
nsGenericHTMLElement::MapCommonAttributesInto(aAttributes, aData);
}
#endif // IBMBIDI
NS_IMETHODIMP
nsGenericHTMLElement::GetAttributeMappingFunction(nsMapRuleToAttributesFunc& aMapRuleFunc) const
{
#ifdef IBMBIDI
if (mNodeInfo->Equals(nsHTMLAtoms::bdo))
aMapRuleFunc = &MapBdoAttributesInto;
else
#endif // IBMBIDI
aMapRuleFunc = &MapCommonAttributesInto;
aMapRuleFunc = &MapCommonAttributesInto;
return NS_OK;
}

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

@ -72,9 +72,7 @@ HTML_ATOM(axis, "axis")
HTML_ATOM(background, "background")
HTML_ATOM(base, "base")
HTML_ATOM(below, "below")
#ifdef IBMBIDI
HTML_ATOM(bdo, "bdo")
#endif
HTML_ATOM(bgcolor, "bgcolor")
HTML_ATOM(big, "big")
HTML_ATOM(blockquote, "blockquote")

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

@ -131,9 +131,7 @@
#include "nsIPrompt.h"
//AHMED 12-2
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
#include "nsIEditingSession.h"
@ -307,9 +305,7 @@ nsHTMLDocument::nsHTMLDocument()
mWriteLevel = 0;
mWyciwygSessionCnt = 0;
#ifdef IBMBIDI
mTexttype = IBMBIDI_TEXTTYPE_LOGICAL;
#endif
if (gRefCntRDFService++ == 0)
{
@ -875,7 +871,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
nsCOMPtr<nsIDocumentCharsetInfo> dcInfo;
docShell->GetDocumentCharsetInfo(getter_AddRefs(dcInfo));
#ifdef IBMBIDI
nsCOMPtr<nsIPresContext> cx;
docShell->GetPresContext(getter_AddRefs(cx));
if(cx){
@ -883,7 +878,6 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
cx->GetBidi(&mBidiOption);
mTexttype = GET_BIDI_OPTION_TEXTTYPE(mBidiOption);
}
#endif // IBMBIDI
//
// The following logic is mirrored in nsWebShell::Embed!
//
@ -975,11 +969,9 @@ nsHTMLDocument::StartDocumentLoad(const char* aCommand,
#endif
//ahmed
#ifdef IBMBIDI
// Check if 864 but in Implicit mode !
if( (mTexttype == IBMBIDI_TEXTTYPE_LOGICAL)&&(charset.EqualsIgnoreCase("ibm864")) )
charset.Assign(NS_LITERAL_STRING("IBM864i"));
#endif // IBMBIDI
SetDocumentCharacterSet(charset);
SetDocumentCharacterSetSource(charsetSource);

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

@ -274,9 +274,7 @@ protected:
PRInt32 mNumForms;
//ahmed 12-2
#ifdef IBMBIDI
PRInt32 mTexttype;
#endif
static nsrefcnt gRefCntRDFService;
static nsIRDFService* gRDF;

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

@ -2264,10 +2264,8 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRul
if (aText.mDecoration.GetUnit() == eCSSUnit_Null && ourText->mDecoration.GetUnit() != eCSSUnit_Null)
aText.mDecoration = ourText->mDecoration;
#ifdef IBMBIDI
if (aText.mUnicodeBidi.GetUnit() == eCSSUnit_Null && ourText->mUnicodeBidi.GetUnit() != eCSSUnit_Null)
aText.mUnicodeBidi = ourText->mUnicodeBidi;
#endif
}
return NS_OK;

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

@ -1757,7 +1757,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
#ifdef IBMBIDI
const nsStyleTextReset *text = nsnull;
GetStyleData(eStyleStruct_TextReset, (const nsStyleStruct*&)text, aFrame);
@ -1769,9 +1768,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
} else {
val->SetIdent(NS_LITERAL_STRING("normal"));
}
#else // IBMBIDI
val->SetIdent(NS_LITERAL_STRING("normal"));
#endif // IBMBIDI
return CallQueryInterface(val, aValue);
}

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

@ -29,6 +29,7 @@ include $(DEPTH)/config/autoconf.mk
MODULE = content
EXPORTS = \
nsBidiUtils.h \
nsChangeHint.h \
nsCSSAnonBoxList.h \
nsCSSAnonBoxes.h \
@ -63,8 +64,4 @@ ifdef MOZ_SVG
EXPORTS += nsSVGAtomList.h nsSVGAtoms.h
endif
ifdef IBMBIDI
EXPORTS += nsBidiUtils.h
endif
include $(topsrcdir)/config/rules.mk

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

@ -72,9 +72,7 @@ HTML_ATOM(axis, "axis")
HTML_ATOM(background, "background")
HTML_ATOM(base, "base")
HTML_ATOM(below, "below")
#ifdef IBMBIDI
HTML_ATOM(bdo, "bdo")
#endif
HTML_ATOM(bgcolor, "bgcolor")
HTML_ATOM(big, "big")
HTML_ATOM(blockquote, "blockquote")

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

@ -206,14 +206,12 @@ LAYOUT_ATOM(mozdirty, "_moz_dirty")
LAYOUT_ATOM(stylesheet, "stylesheet")
LAYOUT_ATOM(transform, "transform")
#ifdef IBMBIDI
LAYOUT_ATOM(directionalFrame, "DirectionalFrame")
LAYOUT_ATOM(baseLevel, "BaseLevel") // PRUint8
LAYOUT_ATOM(embeddingLevel, "EmbeddingLevel") // PRUint8
LAYOUT_ATOM(endsInDiacritic, "EndsInDiacritic") // PRUint32
LAYOUT_ATOM(nextBidi, "NextBidi") // nsIFrame*
LAYOUT_ATOM(charType, "charType") // PRUint8
#endif
#ifdef DEBUG
// Alphabetical list of atoms used by debugging code

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

@ -633,9 +633,7 @@ struct nsStyleTextReset : public nsStyleStruct {
nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const;
PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h
#ifdef IBMBIDI
PRUint8 mUnicodeBidi; // [reset] see nsStyleConsts.h
#endif // IBMBIDI
nsStyleCoord mVerticalAlign; // [reset] see nsStyleConsts.h for enums
};

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

@ -139,7 +139,6 @@ public:
return mState.mIs2b;
}
#ifdef IBMBIDI
/**
* Return PR_TRUE if this fragment contains Bidi text
* For performance reasons this flag is not set automatically, but
@ -149,8 +148,6 @@ public:
{
return mState.mIsBidi;
}
#endif
/**
* Get a pointer to constant PRUnichar data.
@ -240,13 +237,11 @@ public:
return mState.mIs2b ? m2b[aIndex] : PRUnichar(m1b[aIndex]);
}
#ifdef IBMBIDI
/**
* Scan the contents of the fragment and turn on mState.mIsBidi if it
* includes any Bidi characters.
*/
void SetBidiFlag();
#endif
struct FragmentBits {
PRBool mInHeap : 1;

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

@ -23,7 +23,6 @@
* Simon Montagu <smontagu@netscape.com>
* Roozbeh Pournader <roozbeh@sharif.edu>
*/
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#define FE_TO_06_OFFSET 0xfe70
@ -522,4 +521,3 @@ nsresult HandleNumbers(const nsString& aSrc, nsString& aDst)
return HandleNumbers((PRUnichar *)aDst.get(),aDst.Length(), IBMBIDI_NUMERAL_REGULAR);
}
#endif //IBMBIDI

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

@ -53,9 +53,7 @@
#include "nsLayoutAtoms.h"
#include "prenv.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
inline PRBool IsFixedUnit(nsStyleUnit aUnit, PRBool aEnumOK)
{
@ -1086,16 +1084,12 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
nsStyleVisibility::nsStyleVisibility(nsIPresContext* aPresContext)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
aPresContext->GetBidi(&bidiOptions);
if (GET_BIDI_OPTION_DIRECTION(bidiOptions) == IBMBIDI_TEXTDIRECTION_RTL)
mDirection = NS_STYLE_DIRECTION_RTL;
else
mDirection = NS_STYLE_DIRECTION_LTR;
#else
mDirection = NS_STYLE_DIRECTION_LTR;
#endif // IBMBIDI
aPresContext->GetLanguage(getter_AddRefs(mLanguage));
mVisible = NS_STYLE_VISIBILITY_VISIBLE;
@ -1280,9 +1274,7 @@ nsStyleTextReset::nsStyleTextReset(void)
{
mVerticalAlign.SetIntValue(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated);
mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE;
#ifdef IBMBIDI
mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL;
#endif // IBMBIDI
}
nsStyleTextReset::nsStyleTextReset(const nsStyleTextReset& aSource)
@ -1295,10 +1287,7 @@ nsStyleTextReset::~nsStyleTextReset(void) { }
nsChangeHint nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const
{
if (mVerticalAlign == aOther.mVerticalAlign
#ifdef IBMBIDI
&& mUnicodeBidi == aOther.mUnicodeBidi
#endif // IBMBIDI
) {
&& mUnicodeBidi == aOther.mUnicodeBidi) {
if (mTextDecoration != aOther.mTextDecoration)
return NS_STYLE_HINT_VISUAL;
return NS_STYLE_HINT_NONE;

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

@ -40,9 +40,7 @@
#include "nsCRT.h"
#include "nsReadableUtils.h"
#include "nsMemory.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
// Static buffer used for newline fragments
static unsigned char sNewLineCharacter = '\n';
@ -344,7 +342,6 @@ nsTextFragment::CopyTo(char *aDest, PRInt32 aOffset, PRInt32 aCount)
}
}
#ifdef IBMBIDI
// To save time we only do this when we really want to know, not during
// every allocation
void
@ -362,4 +359,3 @@ nsTextFragment::SetBidiFlag()
}
}
}
#endif

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

@ -429,9 +429,7 @@ nsXULDocument::nsXULDocument(void)
nsCOMPtr<nsIDocumentObserver> observer(do_QueryInterface(mBindingManager));
if (observer) // We must always be the first observer of the document.
mObservers.InsertElementAt(observer, 0);
#ifdef IBMBIDI
mBidiEnabled = PR_FALSE;
#endif // IBMBIDI
mSubDocuments = nsnull;
}
@ -6995,7 +6993,6 @@ nsXULDocument::GetFocusController(nsIFocusController** aFocusController)
*aFocusController = nsnull;
}
#ifdef IBMBIDI
/**
* Retrieve and get bidi state of the document
* set depending on presence of bidi data.
@ -7019,7 +7016,6 @@ nsXULDocument::SetBidiEnabled(PRBool aBidiEnabled)
}
return NS_OK;
}
#endif // IBMBIDI
//----------------------------------------------------------------------

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

@ -194,14 +194,12 @@ public:
NS_IMETHOD GetContentLanguage(nsAString& aContentLanguage) const;
#ifdef IBMBIDI
/**
* Retrieve and get bidi state of the document
* (set depending on presence of bidi data).
*/
NS_IMETHOD GetBidiEnabled(PRBool* aBidiEnabled) const;
NS_IMETHOD SetBidiEnabled(PRBool aBidiEnabled);
#endif // IBMBIDI
NS_IMETHOD AddCharSetObserver(nsIObserver* aObserver);
NS_IMETHOD RemoveCharSetObserver(nsIObserver* aObserver);
@ -592,9 +590,7 @@ protected:
PRInt32 mNextContentID;
PRInt32 mNumCapturers; //Number of capturing event handlers in doc. Used to optimize event delivery.
#ifdef IBMBIDI
PRBool mBidiEnabled;
#endif // IBMBIDI
/*
* XXX dr

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

@ -23,7 +23,6 @@
* Simon Montagu <smontagu@netscape.com>
* Roozbeh Pournader <roozbeh@sharif.edu>
*/
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#define FE_TO_06_OFFSET 0xfe70
@ -522,4 +521,3 @@ nsresult HandleNumbers(const nsString& aSrc, nsString& aDst)
return HandleNumbers((PRUnichar *)aDst.get(),aDst.Length(), IBMBIDI_NUMERAL_REGULAR);
}
#endif //IBMBIDI

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

@ -191,9 +191,7 @@ static const char sPrintOptionsContractID[] = "@mozilla.org/gfx/printset
#include "nsIDOMFocusListener.h"
#include "nsISelectionController.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
static NS_DEFINE_CID(kPresShellCID, NS_PRESSHELL_CID);
static NS_DEFINE_CID(kGalleyContextCID, NS_GALLEYCONTEXT_CID);
@ -2499,193 +2497,161 @@ NS_IMETHODIMP DocumentViewerImpl::SetHintCharacterSet(const PRUnichar* aHintChar
return CallChildren(SetChildHintCharacterSet, (void*) aHintCharacterSet);
}
#ifdef IBMBIDI
static void
SetChildBidiOptions(nsIMarkupDocumentViewer* aChild, void* aClosure)
{
aChild->SetBidiOptions(NS_PTR_TO_INT32(aClosure));
}
#endif // IBMBIDI
NS_IMETHODIMP DocumentViewerImpl::SetBidiTextDirection(PRUint8 aTextDirection)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_DIRECTION(bidiOptions, aTextDirection);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiTextDirection(PRUint8* aTextDirection)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aTextDirection) {
GetBidiOptions(&bidiOptions);
*aTextDirection = GET_BIDI_OPTION_DIRECTION(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiTextType(PRUint8 aTextType)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_TEXTTYPE(bidiOptions, aTextType);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiTextType(PRUint8* aTextType)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aTextType) {
GetBidiOptions(&bidiOptions);
*aTextType = GET_BIDI_OPTION_TEXTTYPE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiControlsTextMode(PRUint8 aControlsTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions, aControlsTextMode);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiControlsTextMode(PRUint8* aControlsTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aControlsTextMode) {
GetBidiOptions(&bidiOptions);
*aControlsTextMode = GET_BIDI_OPTION_CONTROLSTEXTMODE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiClipboardTextMode(PRUint8 aClipboardTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions, aClipboardTextMode);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiClipboardTextMode(PRUint8* aClipboardTextMode)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aClipboardTextMode) {
GetBidiOptions(&bidiOptions);
*aClipboardTextMode = GET_BIDI_OPTION_CLIPBOARDTEXTMODE(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiNumeral(PRUint8 aNumeral)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_NUMERAL(bidiOptions, aNumeral);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiNumeral(PRUint8* aNumeral)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aNumeral) {
GetBidiOptions(&bidiOptions);
*aNumeral = GET_BIDI_OPTION_NUMERAL(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiSupport(PRUint8 aSupport)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_SUPPORT(bidiOptions, aSupport);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiSupport(PRUint8* aSupport)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aSupport) {
GetBidiOptions(&bidiOptions);
*aSupport = GET_BIDI_OPTION_SUPPORT(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiCharacterSet(PRUint8 aCharacterSet)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
GetBidiOptions(&bidiOptions);
SET_BIDI_OPTION_CHARACTERSET(bidiOptions, aCharacterSet);
SetBidiOptions(bidiOptions);
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiCharacterSet(PRUint8* aCharacterSet)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
if (aCharacterSet) {
GetBidiOptions(&bidiOptions);
*aCharacterSet = GET_BIDI_OPTION_CHARACTERSET(bidiOptions);
}
#endif
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions)
{
#ifdef IBMBIDI
if (mPresContext) {
#if 1
// forcing reflow will cause bug 80352. Temp turn off force reflow and
@ -2697,13 +2663,11 @@ NS_IMETHODIMP DocumentViewerImpl::SetBidiOptions(PRUint32 aBidiOptions)
}
// now set bidi on all children of mContainer
CallChildren(SetChildBidiOptions, (void*) aBidiOptions);
#endif // IBMBIDI
return NS_OK;
}
NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions)
{
#ifdef IBMBIDI
if (aBidiOptions) {
if (mPresContext) {
mPresContext->GetBidi(aBidiOptions);
@ -2711,7 +2675,6 @@ NS_IMETHODIMP DocumentViewerImpl::GetBidiOptions(PRUint32* aBidiOptions)
else
*aBidiOptions = IBMBIDI_DEFAULT_BIDI_OPTIONS;
}
#endif // IBMBIDI
return NS_OK;
}

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

@ -206,14 +206,12 @@ LAYOUT_ATOM(mozdirty, "_moz_dirty")
LAYOUT_ATOM(stylesheet, "stylesheet")
LAYOUT_ATOM(transform, "transform")
#ifdef IBMBIDI
LAYOUT_ATOM(directionalFrame, "DirectionalFrame")
LAYOUT_ATOM(baseLevel, "BaseLevel") // PRUint8
LAYOUT_ATOM(embeddingLevel, "EmbeddingLevel") // PRUint8
LAYOUT_ATOM(endsInDiacritic, "EndsInDiacritic") // PRUint32
LAYOUT_ATOM(nextBidi, "NextBidi") // nsIFrame*
LAYOUT_ATOM(charType, "charType") // PRUint8
#endif
#ifdef DEBUG
// Alphabetical list of atoms used by debugging code

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

@ -253,10 +253,8 @@ public:
nsDirection GetDirection(){return mDirection;}
void SetDirection(nsDirection aDir){mDirection = aDir;}
#ifdef IBMBIDI
PRBool GetTrueDirection() {return mTrueDirection;}
void SetTrueDirection(PRBool aBool){mTrueDirection = aBool;}
#endif
NS_IMETHOD CopyRangeToAnchorFocus(nsIDOMRange *aRange);
@ -310,9 +308,7 @@ private:
SelectionType mType;//type of this nsTypedSelection;
nsAutoScrollTimer *mAutoScrollTimer; // timer for autoscrolling.
nsCOMArray<nsISelectionListener> mSelectionListeners;
#ifdef IBMBIDI
PRBool mTrueDirection;
#endif
nsCOMPtr<nsIEventQueue> mEventQueue;
PRBool mScrollEventPosted;
};
@ -389,7 +385,6 @@ public:
NS_IMETHOD GetLimiter(nsIContent **aLimiterContent);
NS_IMETHOD SetMouseDoubleDown(PRBool aDoubleDown);
NS_IMETHOD GetMouseDoubleDown(PRBool *aDoubleDown);
#ifdef IBMBIDI
NS_IMETHOD GetPrevNextBidiLevels(nsIPresContext *aPresContext,
nsIContent *aNode,
PRUint32 aContentOffset,
@ -403,7 +398,6 @@ public:
PRUint8 aBidiLevel,
nsIFrame **aFrameOut);
#endif // IBMBIDI
/*END nsIFrameSelection interfacse*/
@ -421,7 +415,6 @@ private:
NS_IMETHOD TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset, PRUint32 aContentEndOffset,
PRBool aContinueSelection, PRBool aMultipleSelection);
#ifdef IBMBIDI
void BidiLevelFromMove(nsIPresContext* aContext,
nsIPresShell* aPresShell,
nsIContent *aNode,
@ -452,7 +445,6 @@ private:
PRInt32 aCurrentOffset,
nsPeekOffsetStruct aPos);
#endif // VISUALSELECTION
#endif // IBMBIDI
//post and pop reasons for notifications. we may stack these later
void PostReason(short aReason){mReason = aReason;}
@ -1560,7 +1552,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
// SetDesiredX(desiredX);
}
#ifdef IBMBIDI
nsCOMPtr<nsICaret> caret;
nsCOMPtr<nsIPresShell> shell;
result = context->GetShell(getter_AddRefs(shell));
@ -1569,7 +1560,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
result = shell->GetCaret(getter_AddRefs(caret));
if (NS_FAILED(result) || !caret)
return 0;
#endif
offsetused = mDomSelections[index]->FetchFocusOffset();
weakNodeUsed = mDomSelections[index]->FetchFocusNode();
@ -1645,7 +1635,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
if (NS_SUCCEEDED(result) && NS_SUCCEEDED(result = frame->PeekOffset(context, &pos)) && pos.mResultContent)
{
tHint = (HINT)pos.mPreferLeft;
#ifdef IBMBIDI
PRBool bidiEnabled = PR_FALSE;
context->GetBidiEnabled(&bidiEnabled);
if (bidiEnabled)
@ -1715,7 +1704,6 @@ nsSelection::MoveCaret(PRUint32 aKeycode, PRBool aContinue, nsSelectionAmount aA
#else
}
#endif // VISUALSELECTION
#endif // IBMBIDI
result = TakeFocus(pos.mResultContent, pos.mContentOffset, pos.mContentOffset, aContinue, PR_FALSE);
}
if (NS_SUCCEEDED(result))
@ -1846,7 +1834,6 @@ nsTypedSelection::GetInterlinePosition(PRBool *aHintRight)
return rv;
}
#ifdef IBMBIDI
nsDirection ReverseDirection(nsDirection aDirection)
{
return (eDirNext == aDirection) ? eDirPrevious : eDirNext;
@ -2580,7 +2567,6 @@ void nsSelection::BidiLevelFromClick(nsIContent *aNode, PRUint32 aContentOffset)
(void**)&frameLevel, sizeof(frameLevel) );
shell->SetCaretBidiLevel(frameLevel);
}
#endif //IBMBIDI
NS_IMETHODIMP
nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset,
@ -2595,9 +2581,7 @@ nsSelection::HandleClick(nsIContent *aNewFocus, PRUint32 aContentOffset,
// Don't take focus when dragging off of a table
if (!mDragSelectingCells)
{
#ifdef IBMBIDI
BidiLevelFromClick(aNewFocus, aContentOffset);
#endif
PostReason(nsISelectionListener::MOUSEDOWN_REASON + nsISelectionListener::DRAG_REASON);
return TakeFocus(aNewFocus, aContentOffset, aContentEndOffset, aContinueSelection, aMultipleSelection);
}
@ -2709,7 +2693,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
if (NS_SUCCEEDED(result))
{
#ifdef IBMBIDI
#ifdef VISUALSELECTION
PRBool bidiEnabled = PR_FALSE;
aPresContext->GetBidiEnabled(&bidiEnabled);
@ -2736,7 +2719,6 @@ nsSelection::HandleDrag(nsIPresContext *aPresContext, nsIFrame *aFrame, nsPoint&
}
else
#endif // VISUALSELECTION
#endif // IBMBIDI
result = HandleClick(newContent, startPos, contentOffsetEnd, PR_TRUE,
PR_FALSE, beginOfContent);
}
@ -2816,12 +2798,8 @@ nsSelection::TakeFocus(nsIContent *aNewFocus, PRUint32 aContentOffset,
mBatching = batching;
mChangesDuringBatching = changes;
}
#ifdef IBMBIDI
if (aContentEndOffset != aContentOffset)
#else
if (aContentEndOffset > aContentOffset)
#endif // IBMBIDI
mDomSelections[index]->Extend(domNode,aContentEndOffset);
mDomSelections[index]->Extend(domNode,aContentEndOffset);
//find out if we are inside a table. if so, find out which one and which cell
//once we do that, the next time we get a takefocus, check the parent tree.
@ -7855,7 +7833,6 @@ nsTypedSelection::DeleteFromDocument()
NS_IMETHODIMP
nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
{
#ifdef IBMBIDI
nsresult result;
nsCOMPtr<nsIDOMNode> focusNode;
nsCOMPtr<nsIContent> focusContent;
@ -7927,6 +7904,5 @@ nsTypedSelection::SelectionLanguageChange(PRBool aLangRTL)
else
shell->SetCaretBidiLevel(levelAfter);
}
#endif // IBMBIDI
return NS_OK;
}

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

@ -2264,10 +2264,8 @@ MapTextForDeclaration(nsCSSDeclaration* aDecl, const nsStyleStructID& aID, nsRul
if (aText.mDecoration.GetUnit() == eCSSUnit_Null && ourText->mDecoration.GetUnit() != eCSSUnit_Null)
aText.mDecoration = ourText->mDecoration;
#ifdef IBMBIDI
if (aText.mUnicodeBidi.GetUnit() == eCSSUnit_Null && ourText->mUnicodeBidi.GetUnit() != eCSSUnit_Null)
aText.mUnicodeBidi = ourText->mUnicodeBidi;
#endif
}
return NS_OK;

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

@ -1757,7 +1757,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
nsROCSSPrimitiveValue *val = GetROCSSPrimitiveValue();
NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);
#ifdef IBMBIDI
const nsStyleTextReset *text = nsnull;
GetStyleData(eStyleStruct_TextReset, (const nsStyleStruct*&)text, aFrame);
@ -1769,9 +1768,6 @@ nsComputedDOMStyle::GetUnicodeBidi(nsIFrame *aFrame,
} else {
val->SetIdent(NS_LITERAL_STRING("normal"));
}
#else // IBMBIDI
val->SetIdent(NS_LITERAL_STRING("normal"));
#endif // IBMBIDI
return CallQueryInterface(val, aValue);
}

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

@ -2506,7 +2506,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData,
text->mTextDecoration = parentText->mTextDecoration;
}
#ifdef IBMBIDI
// unicode-bidi: enum, normal, inherit
if (eCSSUnit_Normal == textData.mUnicodeBidi.GetUnit() ) {
text->mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL;
@ -2518,7 +2517,6 @@ nsRuleNode::ComputeTextResetData(nsStyleStruct* aStartData,
inherited = PR_TRUE;
text->mUnicodeBidi = parentText->mUnicodeBidi;
}
#endif // IBMBIDI
if (inherited)
// We inherited, and therefore can't be cached in the rule node. We have to be put right on the
@ -3058,10 +3056,8 @@ nsRuleNode::ComputeVisibilityData(nsStyleStruct* aStartStruct,
// direction: enum, inherit
if (eCSSUnit_Enumerated == displayData.mDirection.GetUnit()) {
visibility->mDirection = displayData.mDirection.GetIntValue();
#ifdef IBMBIDI
if (NS_STYLE_DIRECTION_RTL == visibility->mDirection)
mPresContext->SetBidiEnabled(PR_TRUE);
#endif // IBMBIDI
}
else if (eCSSUnit_Inherit == displayData.mDirection.GetUnit()) {
inherited = PR_TRUE;

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

@ -53,9 +53,7 @@
#include "nsLayoutAtoms.h"
#include "prenv.h"
#ifdef IBMBIDI
#include "nsBidiUtils.h"
#endif
inline PRBool IsFixedUnit(nsStyleUnit aUnit, PRBool aEnumOK)
{
@ -1086,16 +1084,12 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
nsStyleVisibility::nsStyleVisibility(nsIPresContext* aPresContext)
{
#ifdef IBMBIDI
PRUint32 bidiOptions;
aPresContext->GetBidi(&bidiOptions);
if (GET_BIDI_OPTION_DIRECTION(bidiOptions) == IBMBIDI_TEXTDIRECTION_RTL)
mDirection = NS_STYLE_DIRECTION_RTL;
else
mDirection = NS_STYLE_DIRECTION_LTR;
#else
mDirection = NS_STYLE_DIRECTION_LTR;
#endif // IBMBIDI
aPresContext->GetLanguage(getter_AddRefs(mLanguage));
mVisible = NS_STYLE_VISIBILITY_VISIBLE;
@ -1280,9 +1274,7 @@ nsStyleTextReset::nsStyleTextReset(void)
{
mVerticalAlign.SetIntValue(NS_STYLE_VERTICAL_ALIGN_BASELINE, eStyleUnit_Enumerated);
mTextDecoration = NS_STYLE_TEXT_DECORATION_NONE;
#ifdef IBMBIDI
mUnicodeBidi = NS_STYLE_UNICODE_BIDI_NORMAL;
#endif // IBMBIDI
}
nsStyleTextReset::nsStyleTextReset(const nsStyleTextReset& aSource)
@ -1295,10 +1287,7 @@ nsStyleTextReset::~nsStyleTextReset(void) { }
nsChangeHint nsStyleTextReset::CalcDifference(const nsStyleTextReset& aOther) const
{
if (mVerticalAlign == aOther.mVerticalAlign
#ifdef IBMBIDI
&& mUnicodeBidi == aOther.mUnicodeBidi
#endif // IBMBIDI
) {
&& mUnicodeBidi == aOther.mUnicodeBidi) {
if (mTextDecoration != aOther.mTextDecoration)
return NS_STYLE_HINT_VISUAL;
return NS_STYLE_HINT_NONE;

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

@ -633,9 +633,7 @@ struct nsStyleTextReset : public nsStyleStruct {
nsChangeHint CalcDifference(const nsStyleTextReset& aOther) const;
PRUint8 mTextDecoration; // [reset] see nsStyleConsts.h
#ifdef IBMBIDI
PRUint8 mUnicodeBidi; // [reset] see nsStyleConsts.h
#endif // IBMBIDI
nsStyleCoord mVerticalAlign; // [reset] see nsStyleConsts.h for enums
};