Merge pull from mozilla-central.

This commit is contained in:
Brendan Eich 2008-09-24 18:46:44 -07:00
Родитель e7d2499ff2 77ee6f142e
Коммит 26132f3013
127 изменённых файлов: 1358 добавлений и 852 удалений

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

@ -10,3 +10,6 @@ afc4ee509d9ca3bb4031015c3c22963dcb4b7e7f FIREFOX_3_1a1_RELEASE
afc4ee509d9ca3bb4031015c3c22963dcb4b7e7f FIREFOX_3_1a1_BUILD2
f197b51bbc29a30860e750ee87fd0a047a024f2e FIREFOX_3_1a2_BUILD1
f197b51bbc29a30860e750ee87fd0a047a024f2e FIREFOX_3_1a2_RELEASE
269af1ed75649989575d41f53a12048015c6d50e FENNEC_M8
920a4326d1087b174c2fa2b9a8358e12c697022c SEAMONKEY_2_0a1_BUILD1
920a4326d1087b174c2fa2b9a8358e12c697022c SEAMONKEY_2_0a1_RELEASE

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

@ -1197,7 +1197,7 @@
// Allow drag and drop of folders in Linux.
// We must prevent popupshowing event from firing when shift is pressed.
var target = event.originalTarget;
if (event.button == 1 && event.shiftKey &&
if (event.button == 0 && event.shiftKey &&
target.localName == "toolbarbutton" && target.type == "menu")
this._draggingContainer = true;
]]></handler>

0
browser/themes/pinstripe/browser/browser.css Normal file → Executable file
Просмотреть файл

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

@ -306,7 +306,7 @@ user_pref("accessibility.typeaheadfind.autostart", false);
user_pref("javascript.options.showInConsole", true);
user_pref("layout.debug.enable_data_xbl", true);
user_pref("browser.EULA.override", true);
user_pref("javascript.options.jit.content", true);
user_pref("javascript.options.jit.content", false);
user_pref("gfx.color_management.force_srgb", true);
user_pref("camino.warn_when_closing", false); // Camino-only, harmless to others

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

@ -47,9 +47,7 @@ extern "C" {
MOZCE_SHUNT_API void mozce_assert(int inExpression)
{
#ifdef API_LOGGING
mozce_printf("mozce_assert called\n");
#endif
WINCE_LOG_API_CALL("mozce_assert called\n");
if(0 == inExpression)
{

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

@ -49,9 +49,7 @@ extern "C" {
MOZCE_SHUNT_API int mkdir(const char* inDirname)
{
#ifdef API_LOGGING
mozce_printf("mkdir called\n");
#endif
WINCE_LOG_API_CALL("mkdir called\n");
int retval = -1;
@ -74,9 +72,7 @@ MOZCE_SHUNT_API int mkdir(const char* inDirname)
MOZCE_SHUNT_API int rmdir(const char* inDirname)
{
#ifdef API_LOGGING
mozce_printf("rmdir called (%s)\n", inDirname);
#endif
WINCE_LOG_API_CALL_1("rmdir called (%s)\n", inDirname);
int retval = -1;

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

@ -0,0 +1,2 @@
#include "mozce_shunt.h"

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

@ -177,7 +177,9 @@ typedef INT_PTR intptr_t;
#define _S_IFREG 0100000 /* stat, is a normal file */
#define _S_IREAD 0000400 /* stat, can read */
#define _S_IWRITE 0000200 /* stat, can write */
#define _S_IEXEC 0000100
#define _S_IEXEC 0000100
#define S_IFREG 0x8000
struct stat
{
@ -306,18 +308,18 @@ typedef struct MAT2 {
struct color{
unsigned char Red;
unsigned char Green;
unsigned char Blue;
double Alpha;
unsigned char Red;
unsigned char Green;
unsigned char Blue;
double Alpha;
};
#ifndef SEE_MASK_FLAG_DDEWAIT
#define SEE_MASK_FLAG_DDEWAIT 0
#define SEE_MASK_FLAG_DDEWAIT 0
#endif
#ifndef SEE_MASK_INVOKEIDLIST
#define SEE_MASK_INVOKEIDLIST 0
#define SEE_MASK_INVOKEIDLIST 0
#endif
@ -799,4 +801,29 @@ typedef struct
#define SetPropW SetProp
#define FONTENUMPROCW FONTENUMPROC
#define GetLongPathNameW GetLongPathName
// ACL Defines
typedef enum _SE_OBJECT_TYPE {
SE_UNKNOWN_OBJECT_TYPE = 0,
SE_FILE_OBJECT,
SE_SERVICE,
SE_PRINTER,
SE_REGISTRY_KEY,
SE_LMSHARE,
SE_KERNEL_OBJECT,
SE_WINDOW_OBJECT,
SE_DS_OBJECT,
SE_DS_OBJECT_ALL,
SE_PROVIDER_DEFINED_OBJECT,
SE_WMIGUID_OBJECT,
SE_REGISTRY_WOW64_32KEY
} SE_OBJECT_TYPE;
typedef DWORD SECURITY_INFORMATION, *PSECURITY_INFORMATION;
#define UNPROTECTED_DACL_SECURITY_INFORMATION 0x0
#endif // _MOZCE_DEFS

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

@ -61,7 +61,6 @@
#define _isatty isatty
#undef fileno
#define fileno (int)_fileno
#define fstat (int)_fstat
#define _mbctolower tolower
#define _mbsicmp mbsicmp
#define _mbsdec mbsdec
@ -150,6 +149,15 @@
extern "C" {
#endif
MOZCE_SHUNT_API BOOL InitializeAcl(PACL apAcl, DWORD len, DWORD rev);
MOZCE_SHUNT_API DWORD SetNamedSecurityInfoW(unsigned short* pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
PSID psidOwner,
PSID psidGroup,
PACL pDacl,
PACL pSacl);
// From assert.cpp
MOZCE_SHUNT_API void mozce_assert(int inExpression);
@ -208,6 +216,7 @@ extern "C" {
MOZCE_SHUNT_API int unlink(const char *pathname);
MOZCE_SHUNT_API int lseek(int fildes, int offset, int whence);
MOZCE_SHUNT_API int fstat(FILE* handle, struct stat* buff);
// From stdlib.cpp
MOZCE_SHUNT_API void splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt);

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

@ -51,9 +51,7 @@ MOZCE_SHUNT_API void setbuf(FILE *, char *)
MOZCE_SHUNT_API int chmod(const char* inFilename, int inMode)
{
#ifdef API_LOGGING
mozce_printf("chmod called\n");
#endif
WINCE_LOG_API_CALL("chmod called\n");
int retval = -1;
@ -93,9 +91,7 @@ MOZCE_SHUNT_API int chmod(const char* inFilename, int inMode)
MOZCE_SHUNT_API int isatty(int inHandle)
{
#ifdef API_LOGGING
mozce_printf("-- isatty called\n");
#endif
WINCE_LOG_API_CALL("-- isatty called\n");
int retval = 0;

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

@ -53,9 +53,7 @@ extern "C" {
MOZCE_SHUNT_API unsigned char* _mbsinc(const unsigned char* inCurrent)
{
#ifdef API_LOGGING
mozce_printf("mbsinc called\n");
#endif
WINCE_LOG_API_CALL("mbsinc called\n");
//IsDBCSLeadByte(path[len-1])
return (unsigned char*)(inCurrent + 1);
}
@ -63,9 +61,7 @@ MOZCE_SHUNT_API unsigned char* _mbsinc(const unsigned char* inCurrent)
MOZCE_SHUNT_API unsigned char* _mbspbrk(const unsigned char* inString, const unsigned char* inStrCharSet)
{
#ifdef API_LOGGING
mozce_printf("mbspbrk called\n");
#endif
WINCE_LOG_API_CALL("mbspbrk called\n");
LPWSTR wstring = a2w_malloc((const char *)inString, -1, NULL);
LPWSTR wset = a2w_malloc((const char *)inStrCharSet, -1, NULL);
@ -78,9 +74,7 @@ MOZCE_SHUNT_API unsigned char* _mbspbrk(const unsigned char* inString, const uns
MOZCE_SHUNT_API unsigned char* mbsrchr(const unsigned char* inString, unsigned int inC)
{
#ifdef API_LOGGING
mozce_printf("mbsrchr called\n");
#endif
WINCE_LOG_API_CALL("mbsrchr called\n");
return (unsigned char*) strrchr((char*)inString, inC);
}
@ -88,26 +82,20 @@ MOZCE_SHUNT_API unsigned char* mbsrchr(const unsigned char* inString, unsigned i
MOZCE_SHUNT_API unsigned char* mbschr(const unsigned char* inString, unsigned int inC)
{
#ifdef API_LOGGING
mozce_printf("mbschr called\n");
#endif
WINCE_LOG_API_CALL("mbschr called\n");
return (unsigned char*)strchr((const char*)inString, (int)inC);
}
MOZCE_SHUNT_API int mbsicmp(const unsigned char *string1, const unsigned char *string2)
{
#ifdef API_LOGGING
mozce_printf("mbsicmp called\n");
#endif
WINCE_LOG_API_CALL("mbsicmp called\n");
return _stricmp((const char*)string1, (const char*)string2);
}
MOZCE_SHUNT_API unsigned char* mbsdec(const unsigned char *string1, const unsigned char *string2)
{
#ifdef API_LOGGING
mozce_printf("mbsdec called\n");
#endif
WINCE_LOG_API_CALL("mbsdec called\n");
if (string1 == string2)
return 0;

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

@ -155,6 +155,34 @@ extern "C" {
MOZCE_SHUNT_API int mozce_printf(const char *, ...);
#ifdef SHUNT_LOG_ENABLED
void mozce_DebugInit();
void mozce_DebugDeinit();
void mozce_DebugWriteToLog(char * str);
#endif
#ifdef API_LOGGING
#ifdef WINCE_MEMORY_CHECKPOINTING
MOZCE_SHUNT_API void mozce_MemoryCheckpoint();
#define WINCE_LOG_API_CALL(x) mozce_MemoryCheckpoint(); mozce_printf(x)
#define WINCE_LOG_API_CALL_1(x,y) mozce_MemoryCheckpoint(); mozce_printf(x,y)
#define WINCE_LOG_API_CALL_2(x,y,z) mozce_MemoryCheckpoint(); mozce_printf(x,y,z)
#else
#define WINCE_LOG_API_CALL(x) mozce_printf(x)
#define WINCE_LOG_API_CALL_1(x,y) mozce_printf(x,y)
#define WINCE_LOG_API_CALL_2(x,y,z) mozce_printf(x,y,z)
#endif
#else
#define WINCE_LOG_API_CALL(x)
#define WINCE_LOG_API_CALL_1(x,y)
#define WINCE_LOG_API_CALL_2(x,y,z)
#endif // #ifdef API_LOGGING
#ifdef __cplusplus
};
#endif

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

@ -53,9 +53,7 @@ extern "C" {
MOZCE_SHUNT_API void abort(void)
{
#ifdef API_LOGGING
mozce_printf("abort called\n");
#endif
WINCE_LOG_API_CALL("abort called\n");
#if defined(DEBUG)
DebugBreak();
@ -71,9 +69,8 @@ MOZCE_SHUNT_API char* getenv(const char* inName)
MOZCE_SHUNT_API int putenv(const char *a)
{
#ifdef API_LOGGING
mozce_printf("putenv called %s\n",a);
#endif
WINCE_LOG_API_CALL_1("mozce_PutEnv called %s\n",a);
int len = strlen(a);
char* key = (char*) malloc(len*sizeof(char));
strcpy(key,a);
@ -88,9 +85,7 @@ MOZCE_SHUNT_API int putenv(const char *a)
MOZCE_SHUNT_API int getpid(void)
{
#ifdef API_LOGGING
mozce_printf("getpid called\n");
#endif
WINCE_LOG_API_CALL("getpid called\n");
int retval = 0;

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

@ -59,9 +59,7 @@ static void defaultSighandler(int inSignal)
MOZCE_SHUNT_API int raise(int inSignal)
{
#ifdef API_LOGGING
mozce_printf("raise called\n");
#endif
WINCE_LOG_API_CALL("raise called\n");
void (*handler)(int inSignal) = defaultSighandler;
@ -80,9 +78,7 @@ MOZCE_SHUNT_API int raise(int inSignal)
MOZCE_SHUNT_API _sigsig signal(int inSignal, _sigsig inFunc)
{
#ifdef API_LOGGING
mozce_printf("signal called\n");
#endif
WINCE_LOG_API_CALL("signal called\n");
void (*retval)(int inSignal) = defaultSighandler;

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

@ -47,12 +47,36 @@ extern "C" {
}
#endif
MOZCE_SHUNT_API int fstat(FILE* handle, struct stat* buff)
{
WINCE_LOG_API_CALL("fstat called\n");
int position = ftell(handle);
if (position < 0)
return -1;
if (fseek(handle, 0, SEEK_END) < 0)
return -1;
buff->st_size = ftell(handle);
if (fseek(handle, position, SEEK_SET) < 0)
return -1;
if (buff->st_size < 0)
return -1;
buff->st_mode = _S_IFREG | _S_IREAD | _S_IWRITE | _S_IEXEC;
/* can't get time from a file handle on wince */
buff->st_ctime = 0;
buff->st_atime = 0;
buff->st_mtime = 0;
return 0;
}
MOZCE_SHUNT_API int stat(const char* inPath, struct stat* outStats)
{
#ifdef API_LOGGING
mozce_printf("stat called\n");
#endif
WINCE_LOG_API_CALL("stat called\n");
int retval = -1;
@ -73,7 +97,6 @@ MOZCE_SHUNT_API int stat(const char* inPath, struct stat* outStats)
if (readHandle != INVALID_HANDLE_VALUE && readHandle != NULL)
{
retval = 0;
outStats->st_size = findData.nFileSizeLow;

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

@ -95,9 +95,7 @@ _getnewfd()
MOZCE_SHUNT_API int _waccess(const wchar_t *path, int mode)
{
#ifdef API_LOGGING
mozce_printf("-- _waccess called\n");
#endif
WINCE_LOG_API_CALL("-- _waccess called\n");
return 0;
}
@ -105,18 +103,14 @@ MOZCE_SHUNT_API int _waccess(const wchar_t *path, int mode)
MOZCE_SHUNT_API int access(const char *path, int mode)
{
#ifdef API_LOGGING
mozce_printf("-- access called\n");
#endif
WINCE_LOG_API_CALL("-- access called\n");
return 0;
}
MOZCE_SHUNT_API void rewind(FILE* inStream)
{
#ifdef API_LOGGING
mozce_printf("rewind called\n");
#endif
WINCE_LOG_API_CALL("rewind called\n");
fseek(inStream, 0, SEEK_SET);
}
@ -124,10 +118,7 @@ MOZCE_SHUNT_API void rewind(FILE* inStream)
MOZCE_SHUNT_API FILE* fdopen(int fd, const char* inMode)
{
#ifdef API_LOGGING
mozce_printf("-- fdopen called (mode is ignored!) \n");
#endif
WINCE_LOG_API_CALL("-- fdopen called (mode is ignored!) \n");
if(fd < 0 || fd >= MAXFDS || _fdtab[fd].fd == -1)
return 0;
@ -138,9 +129,7 @@ MOZCE_SHUNT_API FILE* fdopen(int fd, const char* inMode)
MOZCE_SHUNT_API void perror(const char* inString)
{
#ifdef API_LOGGING
mozce_printf("perror called\n");
#endif
WINCE_LOG_API_CALL("perror called\n");
fprintf(stderr, "%s", inString);
}
@ -148,9 +137,7 @@ MOZCE_SHUNT_API void perror(const char* inString)
MOZCE_SHUNT_API int remove(const char* inPath)
{
#ifdef API_LOGGING
mozce_printf("remove called on %s\n", inPath);
#endif
WINCE_LOG_API_CALL_1("remove called on %s\n", inPath);
int retval = -1;
@ -173,9 +160,8 @@ MOZCE_SHUNT_API int remove(const char* inPath)
MOZCE_SHUNT_API char* getcwd(char* buff, size_t size)
{
#ifdef API_LOGGING
mozce_printf("getcwd called.\n");
#endif
WINCE_LOG_API_CALL("getcwd called.\n");
int i;
unsigned short dir[MAX_PATH];
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
@ -203,6 +189,10 @@ MOZCE_SHUNT_API int mozce_printf(const char * format, ...)
mbstowcs(tBuf, buf, MAX_CHARS_IN_VARIABLE_STRING);
OutputDebugString(tBuf);
#ifdef SHUNT_LOG_ENABLED
mozce_DebugWriteToLog(buf);
#endif
return 1;
//#endif
@ -240,9 +230,7 @@ static void mode2binstr(int mode, char* buffer)
MOZCE_SHUNT_API int open(const char *pathname, int flags, int mode)
{
#ifdef API_LOGGING
mozce_printf("open called\n");
#endif
WINCE_LOG_API_CALL("open called\n");
_initfds();
@ -276,17 +264,11 @@ MOZCE_SHUNT_API int open(const char *pathname, int flags, int mode)
MOZCE_SHUNT_API int close(int fd)
{
#ifdef API_LOGGING
mozce_printf("close called\n");
#endif
WINCE_LOG_API_CALL("close called\n");
if(fd < 0 || fd >= MAXFDS || _fdtab[fd].fd == -1)
return -1;
fclose(_fdtab[fd].file);
_fdtab[fd].fd = -1;
@ -295,9 +277,7 @@ MOZCE_SHUNT_API int close(int fd)
MOZCE_SHUNT_API size_t read(int fd, void* buffer, size_t count)
{
#ifdef API_LOGGING
mozce_printf("read called\n");
#endif
WINCE_LOG_API_CALL("read called\n");
if(fd < 0 || fd >= MAXFDS || _fdtab[fd].fd == -1)
return -1;
@ -313,9 +293,7 @@ MOZCE_SHUNT_API size_t read(int fd, void* buffer, size_t count)
MOZCE_SHUNT_API size_t write(int fd, const void* buffer, size_t count)
{
#ifdef API_LOGGING
mozce_printf("write called\n");
#endif
WINCE_LOG_API_CALL("write called\n");
if(fd < 0 || fd >= MAXFDS || _fdtab[fd].fd == -1)
return -1;
@ -330,19 +308,14 @@ MOZCE_SHUNT_API size_t write(int fd, const void* buffer, size_t count)
MOZCE_SHUNT_API int unlink(const char *pathname)
{
#ifdef API_LOGGING
mozce_printf("unlink called\n");
#endif
WINCE_LOG_API_CALL("unlink called\n");
return remove(pathname);
}
MOZCE_SHUNT_API int lseek(int fd, int offset, int whence)
{
#ifdef API_LOGGING
mozce_printf("lseek called\n");
#endif
WINCE_LOG_API_CALL("lseek called\n");
if(fd < 0 || fd >= MAXFDS || _fdtab[fd].fd == -1)
return -1;

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

@ -53,9 +53,7 @@ extern "C" {
MOZCE_SHUNT_API char *fullpath(char *absPath, const char *relPath, size_t maxLength)
{
#ifdef API_LOGGING
mozce_printf("fullpath called\n");
#endif
WINCE_LOG_API_CALL("fullpath called\n");
if (relPath[0] != '\\')
{
@ -75,9 +73,8 @@ MOZCE_SHUNT_API char *fullpath(char *absPath, const char *relPath, size_t maxLen
MOZCE_SHUNT_API void splitpath(const char* inPath, char* outDrive, char* outDir, char* outFname, char* outExt)
{
#ifdef API_LOGGING
mozce_printf("splitpath called\n");
#endif
WINCE_LOG_API_CALL("splitpath called\n");
if(NULL != outDrive)
{
*outDrive = '\0';
@ -182,9 +179,8 @@ MOZCE_SHUNT_API void splitpath(const char* inPath, char* outDrive, char* outDir,
MOZCE_SHUNT_API void makepath(char* outPath, const char* inDrive, const char* inDir, const char* inFname, const char* inExt)
{
#ifdef API_LOGGING
mozce_printf("makepath called\n");
#endif
WINCE_LOG_API_CALL("makepath called\n");
if(NULL != outPath)
{
int dirLen = 0;
@ -208,9 +204,8 @@ MOZCE_SHUNT_API void makepath(char* outPath, const char* inDrive, const char* in
MOZCE_SHUNT_API int mozce_strcmpi(const char *dest, const char *src)
{
#ifdef API_LOGGING
mozce_printf("mozce_strcmpi called\n");
#endif
WINCE_LOG_API_CALL("mozce_strcmpi called\n");
int f,l;
do {

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

@ -47,9 +47,7 @@ extern "C" {
MOZCE_SHUNT_API char* strerror(int inErrno)
{
#ifdef API_LOGGING
mozce_printf("strerror called\n");
#endif
WINCE_LOG_API_CALL("strerror called\n");
return "Unknown Error";
}

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

@ -70,19 +70,14 @@ static struct tm tmStorage;
MOZCE_SHUNT_API size_t strftime(char *, size_t, const char *, const struct tm *)
{
#ifdef API_LOGGING
mozce_printf("mozce_strftime called\n");
#endif
WINCE_LOG_API_CALL("mozce_strftime called\n");
return 0;
}
MOZCE_SHUNT_API struct tm* mozce_localtime_r(const time_t* inTimeT,struct tm* outRetval)
{
#ifdef API_LOGGING
mozce_printf("tm* mozce_localtime_r called\n");
#endif
WINCE_LOG_API_CALL("tm* mozce_localtime_r called\n");
struct tm* retval = NULL;
@ -129,9 +124,7 @@ MOZCE_SHUNT_API struct tm* mozce_localtime_r(const time_t* inTimeT,struct tm* ou
MOZCE_SHUNT_API struct tm* localtime(const time_t* inTimeT)
{
#ifdef API_LOGGING
mozce_printf("tm* mozce_localtime called\n");
#endif
WINCE_LOG_API_CALL("tm* mozce_localtime called\n");
return mozce_localtime_r(inTimeT, &tmStorage);
}
@ -139,9 +132,7 @@ MOZCE_SHUNT_API struct tm* localtime(const time_t* inTimeT)
MOZCE_SHUNT_API struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outRetval)
{
#ifdef API_LOGGING
mozce_printf("tm* mozce_gmtime_r called\n");
#endif
WINCE_LOG_API_CALL("tm* mozce_gmtime_r called\n");
struct tm* retval = NULL;
@ -188,9 +179,7 @@ MOZCE_SHUNT_API struct tm* mozce_gmtime_r(const time_t* inTimeT, struct tm* outR
MOZCE_SHUNT_API struct tm* gmtime(const time_t* inTimeT)
{
#ifdef API_LOGGING
mozce_printf("tm* mozce_gmtime called\n");
#endif
WINCE_LOG_API_CALL("tm* mozce_gmtime called\n");
return mozce_gmtime_r(inTimeT, &tmStorage);
}
@ -198,9 +187,7 @@ MOZCE_SHUNT_API struct tm* gmtime(const time_t* inTimeT)
MOZCE_SHUNT_API time_t mktime(struct tm* inTM)
{
#ifdef API_LOGGING
mozce_printf("mozce_mktime called\n");
#endif
WINCE_LOG_API_CALL("mozce_mktime called\n");
time_t retval = (time_t)-1;

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

@ -67,13 +67,40 @@ extern "C" {
#define wcharcount(array) (sizeof(array) / sizeof(TCHAR))
static int memory_checkpoint_count = 0;
MOZCE_SHUNT_API void mozce_MemoryCheckpoint()
{
#ifdef API_LOGGING
#ifdef WINCE_MEMORY_CHECKPOINTING
MEMORYSTATUS memInfo;
STORE_INFORMATION si;
// Program memory.
memInfo.dwLength = sizeof(memInfo);
GlobalMemoryStatus(&memInfo);
GetStoreInformation(&si);
// OUTPUT: MEM_CHECKPOINT_STRING, counter, Storage Memory Free, RAM TOTAL, RAM FREE, RAM USED
// Can then grep for "MEM, ", put all those lines into one file,
// save the file, and use the resulting text file as
// comma-delimited-text-file input into excel.
// -- wolfe@lobo.us
if (memory_checkpoint_count == 0)
mozce_printf("MEM, counter, Storage Memory Free, RAM TOTAL, RAM FREE, RAM USED\n");
mozce_printf("MEM, %d, %d, %d, %d, %d\n", memory_checkpoint_count, si.dwFreeSize, memInfo.dwTotalPhys, memInfo.dwAvailPhys, memInfo.dwTotalPhys - memInfo.dwAvailPhys);
memory_checkpoint_count++;
#endif
#endif
}
/*this is defined in the WM6 header commdlg.h, but the sdk is missing commdlg.lib*/
MOZCE_SHUNT_API DWORD CommDlgExtendedError()
{
#ifdef API_LOGGING
mozce_printf("CommDlgExtendedError called\n");
#endif
WINCE_LOG_API_CALL("CommDlgExtendedError called\n");
return -1 /*CDERR_DIALOGFAILURE*/;
}
@ -119,9 +146,7 @@ MOZCE_SHUNT_API BOOL LineDDA(int inXStart, int inYStart, int inXEnd, int inYEnd,
MOZCE_SHUNT_API int ExtSelectClipRgn(HDC inDC, HRGN inRGN, int inMode)
{
#ifdef API_LOGGING
mozce_printf("ExtSelectClipRgn called\n");
#endif
WINCE_LOG_API_CALL("ExtSelectClipRgn called\n");
// inModes are defined as:
// RGN_AND = 1
@ -185,9 +210,7 @@ MOZCE_SHUNT_API int ExtSelectClipRgn(HDC inDC, HRGN inRGN, int inMode)
MOZCE_SHUNT_API int FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush)
{
#ifdef API_LOGGING
mozce_printf("FrameRect called\n");
#endif
WINCE_LOG_API_CALL("FrameRect called\n");
HBRUSH oldBrush = (HBRUSH)SelectObject(inDC, inBrush);
RECT myRect = *inRect;
@ -222,10 +245,7 @@ MOZCE_SHUNT_API int FrameRect(HDC inDC, CONST RECT *inRect, HBRUSH inBrush)
MOZCE_SHUNT_API UINT GetTextCharset(HDC inDC)
{
#ifdef API_LOGGING
mozce_printf("GetTextCharset called\n");
#endif
WINCE_LOG_API_CALL("GetTextCharset called\n");
UINT retval = DEFAULT_CHARSET;
@ -241,9 +261,7 @@ MOZCE_SHUNT_API UINT GetTextCharset(HDC inDC)
MOZCE_SHUNT_API UINT GetTextCharsetInfo(HDC inDC, LPFONTSIGNATURE outSig, DWORD inFlags)
{
#ifdef API_LOGGING
mozce_printf("GetTextCharsetInfo called\n");
#endif
WINCE_LOG_API_CALL("GetTextCharsetInfo called\n");
// Zero out the FONTSIGNATURE as we do not know how to fill it out properly.
if(NULL != outSig)
@ -283,9 +301,7 @@ static int CALLBACK collectProc(CONST LOGFONT* inLF, CONST TEXTMETRIC* inTM, DWO
MOZCE_SHUNT_API int GetMapMode(HDC inDC)
{
#ifdef API_LOGGING
mozce_printf("GetMapMode called\n");
#endif
WINCE_LOG_API_CALL("GetMapMode called\n");
int retval = MM_TEXT;
return retval;
@ -295,9 +311,7 @@ MOZCE_SHUNT_API int GetMapMode(HDC inDC)
MOZCE_SHUNT_API LONG RegCreateKey(HKEY inKey, LPCTSTR inSubKey, PHKEY outResult)
{
#ifdef API_LOGGING
mozce_printf("RegCreateKey called\n");
#endif
WINCE_LOG_API_CALL("RegCreateKey called\n");
LONG retval = ERROR_SUCCESS;
DWORD disp = 0;
@ -310,9 +324,7 @@ MOZCE_SHUNT_API LONG RegCreateKey(HKEY inKey, LPCTSTR inSubKey, PHKEY outResult)
MOZCE_SHUNT_API BOOL WaitMessage(VOID)
{
#ifdef API_LOGGING
mozce_printf("WaitMessage called\n");
#endif
WINCE_LOG_API_CALL("WaitMessage called\n");
BOOL retval = TRUE;
@ -354,9 +366,7 @@ static BOOL CALLBACK MyEnumWindowsProc(HWND hwnd, LPARAM lParam)
MOZCE_SHUNT_API BOOL EnumChildWindows(HWND inParent, WNDENUMPROC inFunc, LPARAM inParam)
{
#ifdef API_LOGGING
mozce_printf("EnumChildWindows called\n");
#endif
WINCE_LOG_API_CALL("EnumChildWindows called\n");
ECWWindows myParams;
myParams.params = inParam;
@ -381,9 +391,7 @@ MOZCE_SHUNT_API BOOL IsIconic(HWND inWnd)
MOZCE_SHUNT_API BOOL OpenIcon(HWND inWnd)
{
#ifdef API_LOGGING
mozce_printf("OpenIcon called\n");
#endif
WINCE_LOG_API_CALL("OpenIcon called\n");
return SetActiveWindow(inWnd) ? 1:0;
}
@ -416,9 +424,7 @@ MOZCE_SHUNT_API BOOL InvertRgn(HDC inDC, HRGN inRGN)
MOZCE_SHUNT_API int GetScrollPos(HWND inWnd, int inBar)
{
#ifdef API_LOGGING
mozce_printf("GetScrollPos called\n");
#endif
WINCE_LOG_API_CALL("GetScrollPos called\n");
int retval = 0;
SCROLLINFO info;
@ -434,9 +440,7 @@ MOZCE_SHUNT_API int GetScrollPos(HWND inWnd, int inBar)
MOZCE_SHUNT_API BOOL GetScrollRange(HWND inWnd, int inBar, LPINT outMinPos, LPINT outMaxPos)
{
#ifdef API_LOGGING
mozce_printf("GetScrollRange called\n");
#endif
WINCE_LOG_API_CALL("GetScrollRange called\n");
BOOL retval = FALSE;
SCROLLINFO info;
@ -459,9 +463,7 @@ MOZCE_SHUNT_API BOOL GetScrollRange(HWND inWnd, int inBar, LPINT outMinPos, LPIN
MOZCE_SHUNT_API HRESULT CoLockObjectExternal(IUnknown* inUnk, BOOL inLock, BOOL inLastUnlockReleases)
{
#ifdef API_LOGGING
mozce_printf("CoLockObjectExternal called\n");
#endif
WINCE_LOG_API_CALL("CoLockObjectExternal called\n");
HRESULT retval = S_OK;
@ -543,9 +545,7 @@ MOZCE_SHUNT_API DWORD GetEnvironmentVariable(LPCWSTR lpName, LPCSTR lpBuffer, DW
MOZCE_SHUNT_API void GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime)
{
#ifdef API_LOGGING
mozce_printf("GetSystemTimeAsFileTime called\n");
#endif
WINCE_LOG_API_CALL("GetSystemTimeAsFileTime called\n");
SYSTEMTIME st;
GetSystemTime(&st);
@ -554,9 +554,7 @@ MOZCE_SHUNT_API void GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime)
MOZCE_SHUNT_API DWORD GetLongPathNameW(LPCWSTR lpszShortPath, LPCWSTR lpszLongPath, DWORD cchBuffer)
{
#ifdef API_LOGGING
mozce_printf("GetLongPathNameW called\n");
#endif
WINCE_LOG_API_CALL("GetLongPathNameW called\n");
return 0;
}
@ -566,9 +564,7 @@ MOZCE_SHUNT_API DWORD GetFullPathName(const char* lpFileName,
const char* lpBuffer,
const char** lpFilePart)
{
#ifdef API_LOGGING
mozce_printf("GetFullPathName called\n");
#endif
WINCE_LOG_API_CALL("GetFullPathName called\n");
DWORD len = strlen(lpFileName);
if (len > nBufferLength)
@ -588,9 +584,7 @@ MOZCE_SHUNT_API DWORD GetFullPathName(const char* lpFileName,
*lpFilePart = lpBuffer;
}
#ifdef API_LOGGING
mozce_printf("GetFullPathName called %s (%s)\n", lpBuffer, *lpFilePart);
#endif
WINCE_LOG_API_CALL_2("GetFullPathName called %s (%s)\n", lpBuffer, *lpFilePart);
return len;
}
@ -600,9 +594,7 @@ MOZCE_SHUNT_API BOOL mozce_GetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin
{
SetLastError(0);
#ifdef API_LOGGING
mozce_printf("mozce_GetMessage called\n");
#endif
WINCE_LOG_API_CALL("mozce_GetMessage called\n");
BOOL b = GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMin);
@ -617,9 +609,7 @@ MOZCE_SHUNT_API BOOL mozce_PeekMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMi
{
SetLastError(0);
#ifdef API_LOGGING
mozce_printf("mozce_PeekMessageA called\n");
#endif
WINCE_LOG_API_CALL("mozce_PeekMessageA called\n");
BOOL b = PeekMessageW(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
@ -634,9 +624,7 @@ MOZCE_SHUNT_API LONG GetMessageTime(void)
{
SetLastError(0);
#ifdef API_LOGGING
mozce_printf("GetMessageTime called\n");
#endif
WINCE_LOG_API_CALL("GetMessageTime called\n");
return gGetMessageTime;
}
@ -660,9 +648,7 @@ MOZCE_SHUNT_API BOOL GetWindowPlacement(HWND hWnd, WINDOWPLACEMENT *lpwndpl)
{
SetLastError(0);
#ifdef API_LOGGING
mozce_printf("GetWindowPlacement called\n");
#endif
WINCE_LOG_API_CALL("GetWindowPlacement called\n");
memset(lpwndpl, 0, sizeof(WINDOWPLACEMENT));
@ -712,12 +698,9 @@ MOZCE_SHUNT_API HINSTANCE ShellExecute(HWND hwnd,
MOZCE_SHUNT_API HINSTANCE ShellExecuteW(HWND hwnd, LPCWSTR lpOperation, LPCWSTR lpFile, LPCWSTR lpParameters, LPCWSTR lpDirectory, INT nShowCmd)
{
SetLastError(0);
#ifdef API_LOGGING
mozce_printf("ShellExecuteW called\n");
#endif
WINCE_LOG_API_CALL("ShellExecuteW called\n");
SHELLEXECUTEINFO info;
info.cbSize = sizeof(SHELLEXECUTEINFO);
@ -758,9 +741,7 @@ struct lconv s_locale_conv =
MOZCE_SHUNT_API struct lconv * mozce_localeconv(void)
{
#ifdef API_LOGGING
mozce_printf("mozce_localeconv called\n");
#endif
WINCE_LOG_API_CALL("mozce_localeconv called\n");
return &s_locale_conv;
}
@ -1055,9 +1036,7 @@ MOZCE_SHUNT_API DWORD WINAPI GetCharacterPlacementW( __in HDC hdc, __in_ecount(
MOZCE_SHUNT_API wchar_t* wgetcwd(wchar_t* dir, size_t size)
{
#ifdef API_LOGGING
mozce_printf("getcwd called.\n");
#endif
WINCE_LOG_API_CALL("getcwd called.\n");
int i;
GetModuleFileName(GetModuleHandle (NULL), dir, MAX_PATH);
@ -1084,9 +1063,7 @@ MOZCE_SHUNT_API int _wremove(const wchar_t * _Filename)
MOZCE_SHUNT_API int wchmod(const wchar_t * buffer, int inMode)
{
#ifdef API_LOGGING
mozce_printf("wchmod called\n");
#endif
WINCE_LOG_API_CALL("wchmod called\n");
int retval = -1;
@ -1199,6 +1176,24 @@ MOZCE_SHUNT_API HWND GetAncestor(HWND hwnd, UINT gaFlags)
return(hwndParent);
}
MOZCE_SHUNT_API BOOL InitializeAcl(PACL apAcl, DWORD len, DWORD rev)
{
return FALSE;
}
MOZCE_SHUNT_API DWORD SetNamedSecurityInfoW(unsigned short* pObjectName,
SE_OBJECT_TYPE ObjectType,
SECURITY_INFORMATION SecurityInfo,
PSID psidOwner,
PSID psidGroup,
PACL pDacl,
PACL pSacl)
{
return 0;
}
#if 0
{
#endif

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

@ -5261,9 +5261,12 @@ BlastSubtreeToPieces(nsINode *aNode)
while (map->Enumerate(BlastFunc, &attr) > 0) {
BlastSubtreeToPieces(attr);
nsresult rv = element->UnsetAttr(attr->NodeInfo()->NamespaceID(),
attr->NodeInfo()->NameAtom(),
PR_FALSE);
#ifdef DEBUG
nsresult rv =
#endif
element->UnsetAttr(attr->NodeInfo()->NamespaceID(),
attr->NodeInfo()->NameAtom(),
PR_FALSE);
// XXX Should we abort here?
NS_ASSERTION(NS_SUCCEEDED(rv), "Uhoh, UnsetAttr shouldn't fail!");
@ -5274,8 +5277,10 @@ BlastSubtreeToPieces(nsINode *aNode)
count = aNode->GetChildCount();
for (i = 0; i < count; ++i) {
BlastSubtreeToPieces(aNode->GetChildAt(0));
nsresult rv = aNode->RemoveChildAt(0, PR_FALSE);
#ifdef DEBUG
nsresult rv =
#endif
aNode->RemoveChildAt(0, PR_FALSE);
// XXX Should we abort here?
NS_ASSERTION(NS_SUCCEEDED(rv), "Uhoh, RemoveChildAt shouldn't fail!");

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

@ -1679,7 +1679,7 @@ nsObjectLoadingContent::TryInstantiate(const nsACString& aMIMEType,
}
nsCOMPtr<nsIPluginInstance> instance;
nsresult rv = frame->GetPluginInstance(*getter_AddRefs(instance));
frame->GetPluginInstance(*getter_AddRefs(instance));
if (!instance) {
// The frame has no plugin instance yet. If the frame hasn't been

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

@ -2153,7 +2153,10 @@ gfxFontGroup *nsCanvasRenderingContext2D::GetCurrentFontStyle()
{
// use lazy initilization for the font group since it's rather expensive
if(!CurrentState().fontGroup) {
nsresult res = SetMozTextStyle(NS_LITERAL_STRING("10px sans-serif"));
#ifdef DEBUG
nsresult res =
#endif
SetMozTextStyle(NS_LITERAL_STRING("10px sans-serif"));
NS_ASSERTION(res == NS_OK, "Default canvas font is invalid");
}

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

@ -371,7 +371,10 @@ nsImageDocument::SetScriptGlobalObject(nsIScriptGlobalObject* aScriptGlobalObjec
if (aScriptGlobalObject) {
if (!GetRootContent()) {
// Create synthetic document
nsresult rv = CreateSyntheticDocument();
#ifdef DEBUG
nsresult rv =
#endif
CreateSyntheticDocument();
NS_ASSERTION(NS_SUCCEEDED(rv), "failed to create synthetic document");
target = do_QueryInterface(mImageContent);

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

@ -990,7 +990,6 @@ nsBindingManager::ProcessAttachedQueue(PRUint32 aSkipSize)
mProcessingAttachedStack = PR_TRUE;
PRUint32 currentIndex = aSkipSize;
// Excute constructors. Do this from high index to low
while (mAttachedStack.Length() > aSkipSize) {
PRUint32 lastItem = mAttachedStack.Length() - 1;

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

@ -649,7 +649,7 @@ gfxWindowsFont::ComputeMetrics()
// XXX MSDN (http://msdn.microsoft.com/en-us/library/ms534223.aspx)
// does not say what the failure modes for GetTextExtentPoint32 are -
// is it safe to assume it will fail iff the font has no '0'?
if (GetTextExtentPoint32(dc, "0", 1, &size))
if (GetTextExtentPoint32W(dc, L"0", 1, &size))
mMetrics->zeroOrAveCharWidth = ROUND(size.cx);
else
mMetrics->zeroOrAveCharWidth = mMetrics->aveCharWidth;

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

@ -5838,7 +5838,7 @@ JS_SetGCZeal(JSContext *cx, uint8 zeal)
/************************************************************************/
#if !defined(STATIC_JS_API) && defined(XP_WIN)
#if !defined(STATIC_JS_API) && defined(XP_WIN) && !defined (WINCE)
#include <windows.h>

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

@ -103,9 +103,9 @@ struct __jitstats {
#define JITSTAT(x) uint64 x;
#include "jitstats.tbl"
#undef JITSTAT
} stat = { 0LL, };
} jitstats = { 0LL, };
JS_STATIC_ASSERT(sizeof(stat) % sizeof(uint64) == 0);
JS_STATIC_ASSERT(sizeof(jitstats) % sizeof(uint64) == 0);
enum jitstat_ids {
#define JITSTAT(x) STAT ## x ## ID,
@ -139,7 +139,7 @@ jitstats_getProperty(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
uint64 result = 0;
switch (index) {
#define JITSTAT(x) case STAT ## x ## ID: result = stat.x; break;
#define JITSTAT(x) case STAT ## x ## ID: result = jitstats.x; break;
#include "jitstats.tbl"
#undef JITSTAT
default:
@ -173,7 +173,7 @@ js_InitJITStatsClass(JSContext *cx, JSObject *glob)
JS_InitClass(cx, glob, NULL, &jitstats_class, NULL, 0, jitstats_props, NULL, NULL, NULL);
}
#define AUDIT(x) (stat.x++)
#define AUDIT(x) (jitstats.x++)
#else
#define AUDIT(x) ((void)0)
#endif
@ -2819,7 +2819,7 @@ js_InitJIT(JSTraceMonitor *tm)
tm->globalTypeMap = new (&gc) TypeMap();
}
#if !defined XP_WIN
debug_only(memset(&stat, 0, sizeof(stat)));
debug_only(memset(&jitstats, 0, sizeof(jitstats)));
#endif
}
@ -2830,12 +2830,12 @@ js_FinishJIT(JSTraceMonitor *tm)
printf("recorder: started(%llu), aborted(%llu), completed(%llu), different header(%llu), "
"trees trashed(%llu), slot promoted(%llu), unstable loop variable(%llu), "
"breaks(%llu), returns(%llu)\n",
stat.recorderStarted, stat.recorderAborted, stat.traceCompleted,
stat.returnToDifferentLoopHeader, stat.treesTrashed, stat.slotPromoted,
stat.unstableLoopVariable, stat.breakLoopExits, stat.returnLoopExits);
jitstats.recorderStarted, jitstats.recorderAborted, jitstats.traceCompleted,
jitstats.returnToDifferentLoopHeader, jitstats.treesTrashed, jitstats.slotPromoted,
jitstats.unstableLoopVariable, jitstats.breakLoopExits, jitstats.returnLoopExits);
printf("monitor: triggered(%llu), exits(%llu), type mismatch(%llu), "
"global mismatch(%llu)\n", stat.traceTriggered, stat.sideExitIntoInterpreter,
stat.typeMapMismatchAtEntry, stat.globalShapeMismatchAtEntry);
"global mismatch(%llu)\n", jitstats.traceTriggered, jitstats.sideExitIntoInterpreter,
jitstats.typeMapMismatchAtEntry, jitstats.globalShapeMismatchAtEntry);
#endif
if (tm->fragmento != NULL) {
JS_ASSERT(tm->globalSlots && tm->globalTypeMap);

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

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* ***** BEGIN LICENSE BLOCK *****
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -13,19 +13,18 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla Communicator client code.
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Alec Flett <alecf@netscape.com>
* Contributor(s): Igor Bukanov
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
@ -37,28 +36,20 @@
*
* ***** END LICENSE BLOCK ***** */
gTestfile = 'regress-444608-02.js';
#include "nsIWebProgressListener.h"
#include "nsIBrowserHistory.h"
#include "nsCOMPtr.h"
#include "nsIComponentManager.h"
#include "nsWeakReference.h"
#include "nsIGenericFactory.h"
var summary = '13.2 Namespaces - call constructors directly';
var BUGNUMBER = 444608;
var actual = 'No Crash';
var expect = 'No Crash';
class nsHistoryLoadListener : public nsIWebProgressListener,
public nsSupportsWeakReference
{
public:
nsHistoryLoadListener(nsIBrowserHistory *);
virtual ~nsHistoryLoadListener();
printBugNumber(BUGNUMBER);
START(summary);
nsresult Init();
var x = <xml/>;
Namespace = function() { return 10; };
x.removeNamespace("x");
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBPROGRESSLISTENER
protected:
nsCOMPtr<nsIBrowserHistory> mHistory;
};
TEST(1, expect, actual);
END();

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

@ -0,0 +1,55 @@
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Igor Bukanov
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
gTestfile = 'regress-444608.js';
var summary = '13.2 Namespaces - call constructors directly';
var BUGNUMBER = 444608;
var actual = 'No Crash';
var expect = 'No Crash';
printBugNumber(BUGNUMBER);
START(summary);
var x = <xml/>;
Namespace = function() { return 10; };
x.addNamespace("x");
TEST(1, expect, actual);
END();

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

@ -0,0 +1,56 @@
/* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2008
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Igor Bukanov
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
gTestfile = 'regress-444608.js';
var summary = '13.3 QNames - call constructors directly';
var BUGNUMBER = 444608;
var actual = 'No Crash';
var expect = 'No Crash';
printBugNumber(BUGNUMBER);
START(summary);
var x = <a><b/></a>;
QName = function() { return 10; };
x.replace("b", 10);
TEST(1, expect, actual);
END();

0
js/tests/e4x/extensions/regress-450871-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/e4x/extensions/regress-450871-02.js Executable file → Normal file
Просмотреть файл

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

@ -0,0 +1,72 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is JavaScript Engine testing utilities.
*
* The Initial Developer of the Original Code is
* Mozilla Foundation.
* Portions created by the Initial Developer are Copyright (C) 2007
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Dave Reed
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var gTestfile = 'regress-430740.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 430740;
var summary = 'Do not strip format-control characters from string literals';
var actual = '';
var expect = '';
//-----------------------------------------------------------------------------
test();
//-----------------------------------------------------------------------------
function test()
{
enterFunc ('test');
printBugNumber(BUGNUMBER);
printStatus (summary);
function doevil() {
print('evildone');
return 'evildone';
}
expect = 'a%E2%80%8D,+doevil()%5D)//';
actual += eval("(['a\\\u200d', '+doevil()])//'])");
actual = encodeURI(actual);
reportCompare(expect, actual, summary);
expect = 'a%EF%BF%BE,+doevil()%5D)//';
actual = eval("(['a\\\ufffe', '+doevil()])//'])");
actual = encodeURI(actual);
reportCompare(expect, actual, summary);
exitFunc ('test');
}

0
js/tests/js1_5/Regress/regress-451884.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452170.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452333.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452336.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452346.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452495.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452573-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452573-02.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452713.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452724-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452724-02.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452853.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452884-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-452884-02.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-453173.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-453397.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-453701.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-453747.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-454981.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-455758-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/Regress/regress-455758-02.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452168.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452178.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452329.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452338.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452372.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-452565.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-453249.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-455380.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_5/extensions/regress-455408.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_6/extensions/regress-455464-01.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_6/extensions/regress-455464-02.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_6/extensions/regress-455464-03.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_6/extensions/regress-455464-04.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/expressions/regress-418051.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/expressions/regress-451340.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/regress/regress-452703.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/regress/regress-452960.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/regress/regress-453049.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/regress/regress-453051.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_7/regress/regress-453411.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_8/extensions/regress-454744.js Executable file → Normal file
Просмотреть файл

0
js/tests/js1_8/regress/regress-452491.js Executable file → Normal file
Просмотреть файл

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

@ -104,3 +104,5 @@ js1_5/Regress/regress-354924.js
js1_5/Regress/regress-362583.js
js1_7/extensions/regress-353214-01.js
js1_7/lexical/regress-346642-03.js
# bug 450275
js1_5/extensions/regress-434837-01.js

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

@ -1258,8 +1258,6 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aBorder,
const nsStylePadding& aPadding,
PRBool aUsePrintSettings,
nsRect* aBGClipRect)
{
@ -1268,6 +1266,8 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
PRBool isCanvas;
const nsStyleBackground *color;
const nsStylePadding* padding = aForFrame->GetStylePadding();
const nsStyleBorder* border = aForFrame->GetStyleBorder();
if (!FindBackground(aPresContext, aForFrame, &color, &isCanvas)) {
// we don't want to bail out of moz-appearance is set on a root
@ -1288,8 +1288,8 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
}
if (!isCanvas) {
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, *color, aBorder,
aPadding, aUsePrintSettings, aBGClipRect);
aDirtyRect, aBorderArea, *color, *border,
*padding, aUsePrintSettings, aBGClipRect);
return;
}
@ -1319,7 +1319,7 @@ nsCSSRendering::PaintBackground(nsPresContext* aPresContext,
PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame,
aDirtyRect, aBorderArea, canvasColor,
aBorder, aPadding, aUsePrintSettings, aBGClipRect);
*border, *padding, aUsePrintSettings, aBGClipRect);
}
inline nscoord IntDivFloor(nscoord aDividend, nscoord aDivisor)

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

@ -144,14 +144,12 @@ public:
nsIFrame* aForFrame,
const nsRect& aDirtyRect,
const nsRect& aBorderArea,
const nsStyleBorder& aBorder,
const nsStylePadding& aPadding,
PRBool aUsePrintSettings,
nsRect* aBGClipRect = nsnull);
/**
* Same as |PaintBackground|, except using the provided style context
* (which short-circuits the code that ensures that the root element's
* Same as |PaintBackground|, except using the provided style structs.
* This short-circuits the code that ensures that the root element's
* background is drawn on the canvas.
*/
static void PaintBackgroundWithSC(nsPresContext* aPresContext,

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

@ -555,8 +555,6 @@ nsDisplayBackground::Paint(nsDisplayListBuilder* aBuilder,
nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
aDirtyRect, nsRect(offset, mFrame->GetSize()),
*mFrame->GetStyleBorder(),
*mFrame->GetStylePadding(),
mFrame->HonorPrintBackgroundSettings());
}

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

@ -223,11 +223,9 @@ nsButtonFrameRenderer::PaintBorderAndBackground(nsPresContext* aPresContext,
nsStyleContext* context = mFrame->GetStyleContext();
const nsStyleBorder* border = context->GetStyleBorder();
const nsStylePadding* padding = context->GetStylePadding();
nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, mFrame,
aDirtyRect, buttonRect, *border, *padding,
PR_FALSE);
aDirtyRect, buttonRect, PR_FALSE);
nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
aDirtyRect, buttonRect, *border, context);
}

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

@ -260,7 +260,6 @@ nsFieldSetFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
{
PRIntn skipSides = GetSkipSides();
const nsStyleBorder* borderStyle = GetStyleBorder();
const nsStylePadding* paddingStyle = GetStylePadding();
nscoord topBorder = borderStyle->GetActualBorderWidth(NS_SIDE_TOP);
nscoord yoff = 0;
@ -274,8 +273,7 @@ nsFieldSetFrame::PaintBorderBackground(nsIRenderingContext& aRenderingContext,
nsRect rect(aPt.x, aPt.y + yoff, mRect.width, mRect.height - yoff);
nsCSSRendering::PaintBackground(presContext, aRenderingContext, this,
aDirtyRect, rect, *borderStyle,
*paddingStyle, PR_TRUE);
aDirtyRect, rect, PR_TRUE);
if (mLegendFrame) {

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

@ -440,11 +440,11 @@ public:
CanvasFrame* frame = static_cast<CanvasFrame*>(mFrame);
nsPoint offset = aBuilder->ToReferenceFrame(mFrame);
nsRect bgClipRect = frame->CanvasArea() + offset;
// XXXzw This is the only use of the bgClipRect argument. Does this
// path need the propagation-of-root-background-to-viewport logic?
nsCSSRendering::PaintBackground(mFrame->PresContext(), *aCtx, mFrame,
aDirtyRect,
nsRect(offset, mFrame->GetSize()),
*mFrame->GetStyleBorder(),
*mFrame->GetStylePadding(),
mFrame->HonorPrintBackgroundSettings(),
&bgClipRect);
}

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

@ -571,12 +571,9 @@ nsPageFrame::PaintPageContent(nsIRenderingContext& aRenderingContext,
}
aRenderingContext.SetClipRect(clipRect, nsClipCombine_kIntersect);
const nsStyleBorder* border = GetStyleBorder();
const nsStylePadding* padding = GetStylePadding();
nsRect backgroundRect = nsRect(nsPoint(0, 0), pageContentFrame->GetSize());
nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
rect, backgroundRect, *border, *padding,
PR_TRUE);
rect, backgroundRect, PR_TRUE);
nsLayoutUtils::PaintFrame(&aRenderingContext, pageContentFrame,
nsRegion(rect), NS_RGBA(0,0,0,0));

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

@ -2052,11 +2052,8 @@ nsMathMLChar::Display(nsDisplayListBuilder* aBuilder,
nsDisplayMathMLCharBackground(aForFrame, mRect, styleContext));
NS_ENSURE_SUCCESS(rv, rv);
}
//else
// our container frame will take care of painting its background
// nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame,
// aDirtyRect, rect, *border, *padding, PR_TRUE);
#if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX)
// for visual debug

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

@ -0,0 +1,17 @@
<html>
<head>
<style type="text/css">
table{ width: 500px; }
</style>
</head>
<body>
<table class="grid" cellspacing="50" cellpadding="0" border>
<col width="10%"/>
<col width="1" span="2"/>
<tbody>
<tr><th class="top" colspan="3"> Some Text</th></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,17 @@
<html>
<head>
<style type="text/css">
table{table-layout: fixed; width: 500px; }
</style>
</head>
<body>
<table class="grid" cellspacing="50" cellpadding="0" border>
<col width="10%"/>
<col width="1" span="2"/>
<tbody>
<tr><th class="top" colspan="3"> Some Text</th></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Examples for bug 444928</title>
</head>
<body>
<table cellspacing="50" cellpadding="0" style="table-layout:fixed" width="652">
<col width="150">
<col width="150">
<col>
<tr><td colspan="2" style="background:yellow">1-2</td><td style="background:fuchsia">3</td></tr>
<tr style="color:transparent"><td>1</td><td>2</td><td>3</td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Examples for bug 444928</title>
</head>
<body>
<table cellspacing="50" cellpadding="0" style="table-layout:fixed" width="652">
<col width="150">
<col width="150">
<col>
<tr><td colspan="2" style="background:yellow">1-2</td><td style="background:fuchsia">3</td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Examples for bug 444928</title>
</head>
<body>
<table cellspacing="50" cellpadding="0" width="652">
<col width="150">
<col width="150">
<col>
<tr><td colspan="2" style="background:yellow">1-2</td><td style="background:fuchsia">3</td></tr>
<tr style="color:transparent"><td>1</td><td>2</td><td>3</td></tr>
</tbody>
</table>
</body>
</html>

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

@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Examples for bug 444928</title>
</head>
<body>
<table cellspacing="50" cellpadding="0" width="652">
<col width="150">
<col width="150">
<col>
<tr><td colspan="2" style="background:yellow">1-2</td><td style="background:fuchsia">3</td></tr>
</tbody>
</table>
</body>
</html>

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

@ -908,6 +908,9 @@ random == 429849-1.html 429849-1-ref.html # bug 432288
== 441259-1.html 441259-1-ref.html
fails == 441259-2.html 441259-2-ref.html # bug 441400
== 444015-1.html 444015-1-ref.html
== 444928-1.html 444928-1-ref.html
== 444928-2.html 444928-2-ref.html
!= 444928-3.html 444928-3-notref.html
# == 448987.html 448987-ref.html # Disabled for now - it needs privileges
== 449171-1.html 449171-ref.html
== 449519-1.html 449519-1-ref.html
@ -916,4 +919,3 @@ fails == 441259-2.html 441259-2-ref.html # bug 441400
== 451168-1.html 451168-1-ref.html
== 454361.html about:blank
== 455280-1.xhtml 455280-1-ref.xhtml

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

@ -51,7 +51,8 @@
#undef DEBUG_TABLE_STRATEGY
BasicTableLayoutStrategy::BasicTableLayoutStrategy(nsTableFrame *aTableFrame)
: mTableFrame(aTableFrame)
: nsITableLayoutStrategy(nsITableLayoutStrategy::Auto)
, mTableFrame(aTableFrame)
{
MarkIntrinsicWidthsDirty();
}
@ -421,7 +422,7 @@ BasicTableLayoutStrategy::ComputeIntrinsicWidths(nsIRenderingContext* aRendering
NS_ERROR("column frames out of sync with cell map");
continue;
}
if (mTableFrame->GetNumCellsOriginatingInCol(col)) {
if (mTableFrame->ColumnHasCellSpacingBefore(col)) {
add += spacing;
}
min += colFrame->GetMinCoord();
@ -630,7 +631,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
// each of the columns. We start at aFirstCol + 1 because the first
// in-between boundary would be at the left edge of column aFirstCol + 1
for (PRInt32 col = aFirstCol + 1; col < aFirstCol + aColCount; ++col) {
if (mTableFrame->GetNumCellsOriginatingInCol(col)) {
if (mTableFrame->ColumnHasCellSpacingBefore(col)) {
subtract += spacing;
}
}
@ -739,7 +740,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
pref_width);
} else if (pref_width == 0) {
if (aWidthType == BTLS_FINAL_WIDTH &&
mTableFrame->GetNumCellsOriginatingInCol(col)) {
mTableFrame->ColumnHasCellSpacingBefore(col)) {
++numNonSpecZeroWidthCols;
}
} else {
@ -937,7 +938,7 @@ BasicTableLayoutStrategy::DistributeWidthToColumns(nscoord aWidth,
"when we're setting final width.");
if (pct == 0.0f &&
!colFrame->GetHasSpecifiedCoord() &&
mTableFrame->GetNumCellsOriginatingInCol(col)) {
mTableFrame->ColumnHasCellSpacingBefore(col)) {
NS_ASSERTION(col_width == 0 &&
colFrame->GetPrefCoord() == 0,

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

@ -47,7 +47,8 @@
#include "nsTableCellFrame.h"
FixedTableLayoutStrategy::FixedTableLayoutStrategy(nsTableFrame *aTableFrame)
: mTableFrame(aTableFrame)
: nsITableLayoutStrategy(nsITableLayoutStrategy::Fixed)
, mTableFrame(aTableFrame)
{
MarkIntrinsicWidthsDirty();
}
@ -65,28 +66,27 @@ FixedTableLayoutStrategy::GetMinWidth(nsIRenderingContext* aRenderingContext)
return mMinWidth;
// It's theoretically possible to do something much better here that
// depends only on the columns and the first row, but it wouldn't be
// compatible with other browsers, or with the use of GetMinWidth by
// nsHTMLReflowState to determine the width of a fixed-layout table,
// since CSS2.1 says:
// depends only on the columns and the first row (where we look at
// intrinsic widths inside the first row and then reverse the
// algorithm to find the narrowest width that would hold all of
// those intrinsic widths), but it wouldn't be compatible with other
// browsers, or with the use of GetMinWidth by
// nsTableFrame::ComputeSize to determine the width of a fixed
// layout table, since CSS2.1 says:
// The width of the table is then the greater of the value of the
// 'width' property for the table element and the sum of the
// column widths (plus cell spacing or borders).
// XXX Should we really ignore 'min-width' and 'max-width'?
// XXX Should we really ignore widths on column groups?
nsTableCellMap *cellMap = mTableFrame->GetCellMap();
PRInt32 colCount = cellMap->GetColCount();
nscoord spacing = mTableFrame->GetCellSpacingX();
// XXX Should this code do any pixel rounding?
nscoord result = 0;
// XXX Consider widths on columns or column groups?
if (colCount > 0) {
// XXX Should only add columns that have cells originating in them!
result += spacing * (colCount + 1);
}
@ -151,8 +151,11 @@ FixedTableLayoutStrategy::GetPrefWidth(nsIRenderingContext* aRenderingContext,
PRBool aComputingSize)
{
// It's theoretically possible to do something much better here that
// depends only on the columns and the first row, but it wouldn't be
// compatible with other browsers.
// depends only on the columns and the first row (where we look at
// intrinsic widths inside the first row and then reverse the
// algorithm to find the narrowest width that would hold all of
// those intrinsic widths), but it wouldn't be compatible with other
// browsers.
nscoord result = nscoord_MAX;
DISPLAY_PREF_WIDTH(mTableFrame, result);
return result;
@ -178,22 +181,18 @@ FixedTableLayoutStrategy::ComputeColumnWidths(const nsHTMLReflowState& aReflowSt
PRInt32 colCount = cellMap->GetColCount();
nscoord spacing = mTableFrame->GetCellSpacingX();
// XXX Should this code do any pixel rounding?
// border-spacing isn't part of the basis for percentages.
if (colCount > 0) {
// XXX Should only add columns that have cells originating in them!
nscoord subtract = spacing * (colCount + 1);
tableWidth -= subtract;
} else {
if (colCount == 0) {
// No Columns - nothing to compute
return;
}
// border-spacing isn't part of the basis for percentages.
tableWidth -= spacing * (colCount + 1);
// XXX This ignores the 'min-width' and 'max-width' properties
// throughout. Then again, that's what the CSS spec says to do.
// XXX Consider widths on columns or column groups?
// XXX Should we really ignore widths on column groups?
PRUint32 unassignedCount = 0;
nscoord unassignedSpace = tableWidth;

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

@ -70,6 +70,18 @@ public:
* the available width.
*/
virtual void ComputeColumnWidths(const nsHTMLReflowState& aReflowState) = 0;
/**
* Return the type of table layout strategy, without the cost of
* a virtual function call
*/
enum Type { Auto, Fixed };
Type GetType() const { return mType; }
protected:
nsITableLayoutStrategy(Type aType) : mType(aType) {}
private:
Type mType;
};
#endif /* !defined(nsITableLayoutStrategy_h_) */

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

@ -345,8 +345,7 @@ nsTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
{
nsRect rect(aPt, GetSize());
nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
aDirtyRect, rect, *GetStyleBorder(),
*GetStylePadding(), PR_TRUE);
aDirtyRect, rect, PR_TRUE);
}
// Called by nsTablePainter
@ -1202,7 +1201,10 @@ nsBCTableCellFrame::PaintBackground(nsIRenderingContext& aRenderingContext,
}
nsRect rect(aPt, GetSize());
nsCSSRendering::PaintBackground(PresContext(), aRenderingContext, this,
aDirtyRect, rect, myBorder, *GetStylePadding(),
PR_TRUE);
// bypassing nsCSSRendering::PaintBackground is safe because this kind
// of frame cannot be used for the root element
nsCSSRendering::PaintBackgroundWithSC(PresContext(), aRenderingContext, this,
aDirtyRect, rect,
*GetStyleBackground(), myBorder,
*GetStylePadding(), PR_TRUE, nsnull);
}

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

@ -430,12 +430,18 @@ void nsTableFrame::AttributeChangedFor(nsIFrame* aFrame,
PRInt32 nsTableFrame::GetEffectiveColCount() const
{
PRInt32 colCount = GetColCount();
// don't count cols at the end that don't have originating cells
for (PRInt32 colX = colCount - 1; colX >= 0; colX--) {
if (GetNumCellsOriginatingInCol(colX) <= 0) {
if (LayoutStrategy()->GetType() == nsITableLayoutStrategy::Auto) {
nsTableCellMap* cellMap = GetCellMap();
if (!cellMap) {
return 0;
}
// don't count cols at the end that don't have originating cells
for (PRInt32 colX = colCount - 1; colX >= 0; colX--) {
if (cellMap->GetNumCellsOriginatingInCol(colX) > 0) {
break;
}
colCount--;
}
else break;
}
return colCount;
}
@ -1613,8 +1619,7 @@ nsTableFrame::ProcessRowInserted(nscoord aNewHeight)
/* virtual */ void
nsTableFrame::MarkIntrinsicWidthsDirty()
{
static_cast<nsTableFrame*>(GetFirstInFlow())->
mTableLayoutStrategy->MarkIntrinsicWidthsDirty();
LayoutStrategy()->MarkIntrinsicWidthsDirty();
// XXXldb Call SetBCDamageArea?
@ -2212,7 +2217,7 @@ nsTableFrame::GetCollapsedWidth(nsMargin aBorderPadding)
PRInt32 colWidth = GetColumnWidth(colX);
if (!collapseGroup && !collapseCol) {
width += colWidth;
if (GetNumCellsOriginatingInCol(colX) > 0)
if (ColumnHasCellSpacingBefore(colX))
width += cellSpacingX;
}
}
@ -4017,22 +4022,17 @@ nsTableFrame::GetRowAndColumnByIndex(PRInt32 aIndex,
/*---------------- end of nsITableLayout implementation ------------------*/
PRInt32 nsTableFrame::GetNumCellsOriginatingInCol(PRInt32 aColIndex) const
PRBool
nsTableFrame::ColumnHasCellSpacingBefore(PRInt32 aColIndex) const
{
// Since fixed-layout tables should not have their column sizes change
// as they load, we assume that all columns are significant.
if (LayoutStrategy()->GetType() == nsITableLayoutStrategy::Fixed)
return PR_TRUE;
nsTableCellMap* cellMap = GetCellMap();
if (cellMap)
return cellMap->GetNumCellsOriginatingInCol(aColIndex);
else
return 0;
}
PRInt32 nsTableFrame::GetNumCellsOriginatingInRow(PRInt32 aRowIndex) const
{
nsTableCellMap* cellMap = GetCellMap();
if (cellMap)
return cellMap->GetNumCellsOriginatingInRow(aRowIndex);
else
return 0;
if (!cellMap)
return PR_FALSE;
return cellMap->GetNumCellsOriginatingInCol(aColIndex) > 0;
}
static void

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

@ -530,8 +530,8 @@ public:
NS_IMETHOD GetIndexByRowAndColumn(PRInt32 aRow, PRInt32 aColumn, PRInt32 *aIndex);
NS_IMETHOD GetRowAndColumnByIndex(PRInt32 aIndex, PRInt32 *aRow, PRInt32 *aColumn);
PRInt32 GetNumCellsOriginatingInCol(PRInt32 aColIndex) const;
PRInt32 GetNumCellsOriginatingInRow(PRInt32 aRowIndex) const;
PRBool ColumnHasCellSpacingBefore(PRInt32 aColIndex) const;
PRBool HasPctCol() const;
void SetHasPctCol(PRBool aValue);
@ -611,7 +611,7 @@ protected:
void AdjustForCollapsingRowsCols(nsHTMLReflowMetrics& aDesiredSize,
nsMargin aBorderPadding);
nsITableLayoutStrategy* LayoutStrategy() {
nsITableLayoutStrategy* LayoutStrategy() const {
return static_cast<nsTableFrame*>(GetFirstInFlow())->
mTableLayoutStrategy;
}

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

@ -684,7 +684,7 @@ CalcAvailWidth(nsTableFrame& aTableFrame,
else {
aColAvailWidth += colWidth;
}
if ((spanX > 0) && (aTableFrame.GetNumCellsOriginatingInCol(colIndex + spanX) > 0)) {
if ((spanX > 0) && aTableFrame.ColumnHasCellSpacingBefore(colIndex + spanX)) {
cellSpacing += aCellSpacingX;
}
}
@ -723,7 +723,7 @@ GetSpaceBetween(PRInt32 aPrevColIndex,
if (!isCollapsed)
space += aTableFrame.GetColumnWidth(colX);
}
if (!isCollapsed && (aTableFrame.GetNumCellsOriginatingInCol(colX) > 0)) {
if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) {
space += aCellSpacingX;
}
}
@ -747,7 +747,7 @@ GetSpaceBetween(PRInt32 aPrevColIndex,
if (!isCollapsed)
space += aTableFrame.GetColumnWidth(colX);
}
if (!isCollapsed && (aTableFrame.GetNumCellsOriginatingInCol(colX) > 0)) {
if (!isCollapsed && aTableFrame.ColumnHasCellSpacingBefore(colX)) {
space += aCellSpacingX;
}
}
@ -1242,7 +1242,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
const nsStyleVisibility* nextColVis =
nextColFrame->GetStyleVisibility();
if ( (NS_STYLE_VISIBILITY_COLLAPSE != nextColVis->mVisible) &&
(tableFrame->GetNumCellsOriginatingInCol(colX + colIncrement) > 0)) {
tableFrame->ColumnHasCellSpacingBefore(colX + colIncrement)) {
cRect.width += cellSpacingX;
}
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше