viewer can set the compatibility mode

This commit is contained in:
karnaze%netscape.com 1998-09-23 23:02:54 +00:00
Родитель 3219f036ec
Коммит a00d4400f4
4 изменённых файлов: 26 добавлений и 3 удалений

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

@ -16,6 +16,8 @@
* Corporation. Portions created by Netscape are Copyright (C) 1998 * Corporation. Portions created by Netscape are Copyright (C) 1998
* Netscape Communications Corporation. All Rights Reserved. * Netscape Communications Corporation. All Rights Reserved.
*/ */
#include "nsIPref.h"
#ifdef XP_MAC #ifdef XP_MAC
#include "nsBrowserWindow.h" #include "nsBrowserWindow.h"
#define NS_IMPL_IDS #define NS_IMPL_IDS
@ -62,7 +64,6 @@
#include "nsILabel.h" #include "nsILabel.h"
#include "nsWidgetSupport.h" #include "nsWidgetSupport.h"
#include "resources.h" #include "resources.h"
#if defined(WIN32) #if defined(WIN32)
@ -2119,6 +2120,14 @@ nsBrowserWindow::DoToggleSelection()
} }
} }
void
nsBrowserWindow::SetCompatibilityMode(PRBool aIsStandard)
{
if (nsnull != mPrefs) {
int32 prefInt = (aIsStandard) ? eCompatibility_Standard : eCompatibility_NavQuirks;
mPrefs->SetIntPref("nglayout.compatibility.mode", prefInt);
}
}
void void
nsBrowserWindow::DoDebugRobot() nsBrowserWindow::DoDebugRobot()
@ -2217,6 +2226,11 @@ nsBrowserWindow::DispatchDebugMenu(PRInt32 aID)
case VIEWER_TOP100: case VIEWER_TOP100:
DoSiteWalker(); DoSiteWalker();
break; break;
case VIEWER_NAV_QUIRKS_MODE:
case VIEWER_STANDARD_MODE:
SetCompatibilityMode(VIEWER_STANDARD_MODE == aID);
break;
} }
return(result); return(result);
} }

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

@ -27,7 +27,7 @@
#include "nsString.h" #include "nsString.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"
#include "nsCRT.h" #include "nsCRT.h"
//#include "nsIPref.h"
class nsILabel; class nsILabel;
class nsICheckButton; class nsICheckButton;
@ -148,6 +148,7 @@ public:
void DoDebugRobot(); void DoDebugRobot();
void DoSiteWalker(); void DoSiteWalker();
nsEventStatus DispatchDebugMenu(PRInt32 aID); nsEventStatus DispatchDebugMenu(PRInt32 aID);
void SetCompatibilityMode(PRBool aIsStandard);
#endif #endif
nsEventStatus ProcessDialogEvent(nsGUIEvent *aEvent); nsEventStatus ProcessDialogEvent(nsGUIEvent *aEvent);

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

@ -53,6 +53,8 @@
#define VIEWER_DEBUGSAVE 40032 #define VIEWER_DEBUGSAVE 40032
#define VIEWER_SHOW_CONTENT_QUALITY 40033 #define VIEWER_SHOW_CONTENT_QUALITY 40033
#define VIEWER_TOGGLE_SELECTION 40034 #define VIEWER_TOGGLE_SELECTION 40034
#define VIEWER_NAV_QUIRKS_MODE 40035
#define VIEWER_STANDARD_MODE 40036
// Note: must be in ascending sequential order // Note: must be in ascending sequential order
#define VIEWER_ONE_COLUMN 40040 #define VIEWER_ONE_COLUMN 40040

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

@ -82,7 +82,13 @@ VIEWER MENU DISCARDABLE
MENUITEM "Debu&g Robot", VIEWER_DEBUGROBOT MENUITEM "Debu&g Robot", VIEWER_DEBUGROBOT
MENUITEM SEPARATOR MENUITEM SEPARATOR
MENUITEM "Show Content Quality", VIEWER_SHOW_CONTENT_QUALITY MENUITEM "Show Content Quality", VIEWER_SHOW_CONTENT_QUALITY
} MENUITEM SEPARATOR
POPUP "&Compatibility Mode"
{
MENUITEM "Nav Quirks", VIEWER_NAV_QUIRKS_MODE
MENUITEM "Standard", VIEWER_STANDARD_MODE
}
}
POPUP "&Tools" POPUP "&Tools"
{ {
MENUITEM "&JavaScript Console", JS_CONSOLE MENUITEM "&JavaScript Console", JS_CONSOLE