# note: freebsd is the same, but leave out -fno-stack-protector # build and install libs: gtk 1, IDL, jpeg, png, mng, tiff MOZ_PHOENIX=1 export MOZ_PHOENIX # see also browser/config/mozconfig ../firefox-1.0/configure \ --disable-auto-deps \ --disable-bidi \ --disable-composer \ --disable-cpp-exceptions \ --disable-cpp-rtti \ --disable-debug \ --disable-dtd-debug \ --disable-freetypetest \ --disable-glibtest \ --disable-gtktest \ --disable-installer \ --disable-jsd \ --disable-ldap \ --disable-mailnews \ --disable-md \ --disable-oji \ --disable-pedantic \ --disable-plaintext-editor-only \ --disable-profilesharing \ --disable-shared \ --disable-svg \ --disable-tests \ --disable-xinerama \ --disable-xprint \ --disable-xterm-updates \ --enable-crypto \ --enable-default-toolkit=gtk \ --enable-double-buffer \ --enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,negotiateauth \ --enable-mathml \ --enable-optimize="-Os -march=pentium -fno-stack-protector" \ --enable-single-profile \ --enable-static \ --enable-strip \ --prefix=/usr/X11R6 \ --with-pthreads \ --with-system-jpeg=/usr/local \ --with-system-mng=/usr/local \ --with-system-png=/usr/local \ --with-system-zlib=/usr/lib \ --x-includes=/usr/X11R6/include \ --x-libraries=/usr/X11R6/lib unlimit gmake MOZ_PHOENIX=1 Index: content/html/content/src/nsHTMLInputElement.cpp =================================================================== RCS file: /cvsroot/mozilla/content/html/content/src/nsHTMLInputElement.cpp,v retrieving revision 1.336.2.1.2.5 diff -u -r1.336.2.1.2.5 nsHTMLInputElement.cpp --- content/html/content/src/nsHTMLInputElement.cpp 22 Oct 2004 19:34:36 -0000 1.336.2.1.2.5 +++ content/html/content/src/nsHTMLInputElement.cpp 2 Jun 2005 01:00:19 -0000 @@ -1144,7 +1144,7 @@ nsHTMLInputElement::Select() { nsresult rv = NS_OK; - if (!mDocument) + if (!mDocument || !ShouldFocus(this)) return NS_OK; // first see if we are disabled or not. If disabled then do nothing. Index: extensions/transformiix/source/base/Double.cpp =================================================================== RCS file: /cvsroot/mozilla/extensions/transformiix/source/base/Double.cpp,v retrieving revision 1.22 diff -u -r1.22 Double.cpp --- extensions/transformiix/source/base/Double.cpp 15 Jan 2004 21:23:18 -0000 1.22 +++ extensions/transformiix/source/base/Double.cpp 2 Jun 2005 01:00:47 -0000 @@ -114,17 +114,19 @@ #define TX_DOUBLE_HI32_EXPMASK 0x7ff00000 #define TX_DOUBLE_HI32_MANTMASK 0x000fffff +#define STRICT_ALIGN __attribute__ ((aligned (8))) + //-- Initialize Double related constants #ifdef IS_BIG_ENDIAN -const PRUint32 nanMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK, +const PRUint32 nanMask[2] STRICT_ALIGN = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK, 0xffffffff}; -const PRUint32 infMask[2] = {TX_DOUBLE_HI32_EXPMASK, 0}; -const PRUint32 negInfMask[2] = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0}; +const PRUint32 infMask[2] STRICT_ALIGN = {TX_DOUBLE_HI32_EXPMASK, 0}; +const PRUint32 negInfMask[2] STRICT_ALIGN = {TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT, 0}; #else -const PRUint32 nanMask[2] = {0xffffffff, +const PRUint32 nanMask[2] STRICT_ALIGN = {0xffffffff, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_MANTMASK}; -const PRUint32 infMask[2] = {0, TX_DOUBLE_HI32_EXPMASK}; -const PRUint32 negInfMask[2] = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}; +const PRUint32 infMask[2] STRICT_ALIGN = {0, TX_DOUBLE_HI32_EXPMASK}; +const PRUint32 negInfMask[2] STRICT_ALIGN = {0, TX_DOUBLE_HI32_EXPMASK | TX_DOUBLE_HI32_SIGNBIT}; #endif const double Double::NaN = *((double*)nanMask); Index: gfx/public/nsRect.h =================================================================== RCS file: /cvsroot/mozilla/gfx/public/nsRect.h,v retrieving revision 1.9 diff -u -r1.9 nsRect.h --- gfx/public/nsRect.h 10 Mar 2004 01:59:16 -0000 1.9 +++ gfx/public/nsRect.h 2 Jun 2005 01:00:54 -0000 @@ -148,6 +148,8 @@ nsPoint BottomLeft() const { return nsPoint(x, YMost()); } nsPoint BottomRight() const { return nsPoint(XMost(), YMost()); } + nsSize Size() const { return nsSize(width, height); } + // Helper methods for computing the extents nscoord XMost() const {return x + width;} nscoord YMost() const {return y + height;} Index: layout/html/base/src/nsPresShell.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/base/src/Attic/nsPresShell.cpp,v retrieving revision 3.712.2.2.2.9 diff -u -r3.712.2.2.2.9 nsPresShell.cpp --- layout/html/base/src/nsPresShell.cpp 15 Oct 2004 23:58:03 -0000 3.712.2.2.2.9 +++ layout/html/base/src/nsPresShell.cpp 2 Jun 2005 01:01:06 -0000 @@ -1298,7 +1298,7 @@ nsresult AddDummyLayoutRequest(void); nsresult RemoveDummyLayoutRequest(void); - nsresult WillCauseReflow(); + void WillCauseReflow() {} nsresult DidCauseReflow(); void DidDoReflow(); nsresult ProcessReflowCommands(PRBool aInterruptible); @@ -6285,19 +6285,8 @@ } nsresult -PresShell::WillCauseReflow() -{ - mViewManager->CacheWidgetChanges(PR_TRUE); - return NS_OK; -} - -nsresult PresShell::DidCauseReflow() { - if (mViewManager) { - mViewManager->CacheWidgetChanges(PR_FALSE); - } - // We may have had more reflow commands appended to the queue during // our reflow. Make sure these get processed at some point. if (!gAsyncReflowDuringDocLoad && mDocumentLoading) { Index: modules/plugin/base/public/nptypes.h =================================================================== RCS file: /cvsroot/mozilla/modules/plugin/base/public/nptypes.h,v retrieving revision 3.19.4.4 diff -u -r3.19.4.4 nptypes.h --- modules/plugin/base/public/nptypes.h 1 Sep 2004 16:59:55 -0000 3.19.4.4 +++ modules/plugin/base/public/nptypes.h 2 Jun 2005 01:01:27 -0000 @@ -67,19 +67,15 @@ /* * BSD/OS ships no header that defines uint32_t, nor bool (for C) - * OpenBSD ships no header that defines uint32_t, but provides bool as a - * macro. + * OpenBSD ships no header that defines uint32_t and using its bool macro is + * unsafe. */ #if defined(bsdi) || defined(OPENBSD) typedef u_int32_t uint32_t; - #if defined(bsdi) #if !defined(__cplusplus) typedef int bool; #endif - #else /* OPENBSD is defined, so use its bool */ - #include - #endif #else /* * FreeBSD defines uint32_t and bool. Index: nsprpub/pr/include/md/_openbsd.cfg =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/include/md/_openbsd.cfg,v retrieving revision 3.6.4.2 diff -u -r3.6.4.2 _openbsd.cfg --- nsprpub/pr/include/md/_openbsd.cfg 10 Mar 2004 07:51:37 -0000 3.6.4.2 +++ nsprpub/pr/include/md/_openbsd.cfg 2 Jun 2005 01:01:35 -0000 @@ -282,6 +282,53 @@ #define PR_BYTES_PER_WORD_LOG2 3 #define PR_BYTES_PER_DWORD_LOG2 3 +#elif defined(__sparc_v9__) +#undef IS_LITTLE_ENDIAN +#define IS_BIG_ENDIAN 1 +#define HAVE_LONG_LONG +#define HAVE_ALIGNED_DOUBLES +#define HAVE_ALIGNED_LONGLONGS +#define IS_64 + +#define PR_BYTES_PER_BYTE 1 +#define PR_BYTES_PER_SHORT 2 +#define PR_BYTES_PER_INT 4 +#define PR_BYTES_PER_INT64 8 +#define PR_BYTES_PER_LONG 8 +#define PR_BYTES_PER_FLOAT 4 +#define PR_BYTES_PER_DOUBLE 8 +#define PR_BYTES_PER_WORD 8 +#define PR_BYTES_PER_DWORD 8 + +#define PR_BITS_PER_BYTE 8 +#define PR_BITS_PER_SHORT 16 +#define PR_BITS_PER_INT 32 +#define PR_BITS_PER_INT64 64 +#define PR_BITS_PER_LONG 64 +#define PR_BITS_PER_FLOAT 32 +#define PR_BITS_PER_DOUBLE 64 +#define PR_BITS_PER_WORD 64 + +#define PR_BITS_PER_BYTE_LOG2 3 +#define PR_BITS_PER_SHORT_LOG2 4 +#define PR_BITS_PER_INT_LOG2 5 +#define PR_BITS_PER_INT64_LOG2 6 +#define PR_BITS_PER_LONG_LOG2 6 +#define PR_BITS_PER_FLOAT_LOG2 5 +#define PR_BITS_PER_DOUBLE_LOG2 6 +#define PR_BITS_PER_WORD_LOG2 6 + +#define PR_ALIGN_OF_SHORT 2 +#define PR_ALIGN_OF_INT 4 +#define PR_ALIGN_OF_LONG 8 +#define PR_ALIGN_OF_INT64 8 +#define PR_ALIGN_OF_FLOAT 4 +#define PR_ALIGN_OF_DOUBLE 8 +#define PR_ALIGN_OF_POINTER 8 + +#define PR_BYTES_PER_WORD_LOG2 3 +#define PR_BYTES_PER_DWORD_LOG2 3 + #elif defined(__powerpc__) || defined(__m68k__) #undef IS_LITTLE_ENDIAN Index: nsprpub/pr/src/io/prprf.c =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/src/io/prprf.c,v retrieving revision 3.10.2.6 diff -u -r3.10.2.6 prprf.c --- nsprpub/pr/src/io/prprf.c 9 Mar 2004 03:18:19 -0000 3.10.2.6 +++ nsprpub/pr/src/io/prprf.c 2 Jun 2005 01:01:35 -0000 @@ -53,6 +53,8 @@ */ #if (defined(LINUX) && defined(__x86_64__)) #define VARARGS_ASSIGN(foo, bar) __va_copy((foo), (bar)) +#elif (defined(__OpenBSD__) && defined(va_copy)) +#define VARARGS_ASSIGN(foo, bar) va_copy((foo), (bar)) #elif (defined(LINUX) && defined(__powerpc__)) || \ (defined(LINUX) && defined(__s390__)) || \ (defined(LINUX) && defined(__s390x__)) || \ Index: nsprpub/pr/src/md/unix/unix.c =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/src/md/unix/unix.c,v retrieving revision 3.43.2.5 diff -u -r3.43.2.5 unix.c --- nsprpub/pr/src/md/unix/unix.c 12 Dec 2002 00:19:57 -0000 3.43.2.5 +++ nsprpub/pr/src/md/unix/unix.c 2 Jun 2005 01:01:36 -0000 @@ -65,7 +65,8 @@ * PRInt32* pointer to a _PRSockLen_t* pointer. */ #if defined(HAVE_SOCKLEN_T) \ - || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) + || (defined(LINUX) && defined(__GLIBC__) && __GLIBC__ >= 2) \ + || defined(FREEBSD) #define _PRSockLen_t socklen_t #elif defined(IRIX) || defined(HPUX) || defined(OSF1) || defined(SOLARIS) \ || defined(AIX4_1) || defined(LINUX) || defined(SONY) \ @@ -73,7 +74,7 @@ || defined(SUNOS4) || defined(NCR) || defined(DARWIN) \ || defined(NEXTSTEP) || defined(QNX) #define _PRSockLen_t int -#elif (defined(AIX) && !defined(AIX4_1)) || defined(FREEBSD) \ +#elif (defined(AIX) && !defined(AIX4_1)) \ || defined(NETBSD) || defined(OPENBSD) || defined(UNIXWARE) \ || defined(DGUX) || defined(VMS) || defined(NTO) #define _PRSockLen_t size_t Index: nsprpub/pr/src/misc/prinit.c =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prinit.c,v retrieving revision 3.25.4.4 diff -u -r3.25.4.4 prinit.c --- nsprpub/pr/src/misc/prinit.c 20 Jan 2003 20:13:09 -0000 3.25.4.4 +++ nsprpub/pr/src/misc/prinit.c 2 Jun 2005 01:01:36 -0000 @@ -430,6 +430,12 @@ _PR_LogCleanup(); /* + * accesses the current thread + */ + _PR_CleanupNet(); + _PR_CleanupIO(); + + /* * This part should look like the end of _PR_NativeRunThread * and _PR_UserRunThread. */ @@ -441,6 +447,7 @@ PR_DELETE(me->stack); PR_DELETE(me); } + _PR_MD_SET_CURRENT_THREAD(NULL); /* * XXX: We are freeing the heap memory here so that Purify won't @@ -449,8 +456,6 @@ * Ideally, for each _PR_InitXXX(), there should be a corresponding * _PR_XXXCleanup() that we can call here. */ - _PR_CleanupNet(); - _PR_CleanupIO(); #ifdef WINNT _PR_CleanupCPUs(); #endif Index: nsprpub/pr/src/misc/prnetdb.c =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/src/misc/prnetdb.c,v retrieving revision 3.21.2.20.6.1 diff -u -r3.21.2.20.6.1 prnetdb.c --- nsprpub/pr/src/misc/prnetdb.c 1 Sep 2004 23:07:28 -0000 3.21.2.20.6.1 +++ nsprpub/pr/src/misc/prnetdb.c 2 Jun 2005 01:01:36 -0000 @@ -2098,7 +2098,12 @@ */ hints.ai_socktype = SOCK_STREAM; + LOCK_DNS(); + rv = GETADDRINFO(hostname, NULL, &hints, &res); + + UNLOCK_DNS(); + if (rv == 0) return (PRAddrInfo *) res; Index: nsprpub/pr/src/pthreads/ptio.c =================================================================== RCS file: /cvsroot/mozilla/nsprpub/pr/src/pthreads/ptio.c,v retrieving revision 3.71.2.16 diff -u -r3.71.2.16 ptio.c --- nsprpub/pr/src/pthreads/ptio.c 4 Feb 2004 01:31:33 -0000 3.71.2.16 +++ nsprpub/pr/src/pthreads/ptio.c 2 Jun 2005 01:01:38 -0000 @@ -192,7 +192,7 @@ #endif #endif -#ifdef DARWIN +#if defined(DARWIN) || defined(FREEBSD) static PRBool _pr_ipv6_v6only_on_by_default; /* The IPV6_V6ONLY socket option is not defined on Mac OS X 10.1. */ #ifndef IPV6_V6ONLY @@ -1157,7 +1157,7 @@ _pr_stderr = pt_SetMethods(2, PR_DESC_FILE, PR_FALSE, PR_TRUE); PR_ASSERT(_pr_stdin && _pr_stdout && _pr_stderr); -#ifdef DARWIN +#if defined(DARWIN) || defined(FREEBSD) /* In Mac OS X v10.3 Panther Beta the IPV6_V6ONLY socket option * is turned on by default, contrary to what RFC 3493, Section * 5.3 says. So we have to turn it off. Find out whether we @@ -3477,7 +3477,7 @@ if (osfd == -1) pt_MapError(_PR_MD_MAP_SOCKET_ERROR, errno); else { -#ifdef DARWIN +#if defined(DARWIN) || defined(FREEBSD) if ((domain == AF_INET6) && _pr_ipv6_v6only_on_by_default) { int on = 0; Index: rdf/chrome/src/nsChromeRegistry.cpp =================================================================== RCS file: /cvsroot/mozilla/rdf/chrome/src/nsChromeRegistry.cpp,v retrieving revision 1.297.2.1 diff -u -r1.297.2.1 nsChromeRegistry.cpp --- rdf/chrome/src/nsChromeRegistry.cpp 24 Apr 2004 17:15:39 -0000 1.297.2.1 +++ rdf/chrome/src/nsChromeRegistry.cpp 2 Jun 2005 01:01:44 -0000 @@ -2689,7 +2689,7 @@ return UninstallProvider(NS_LITERAL_CSTRING("locale"), aLocaleName, aUseProfile); } -NS_IMETHODIMP nsChromeRegistry::UninstallPackage(const PRUnichar* aPackageName, PRBool aUseProfile) +NS_IMETHODIMP nsChromeRegistry::UninstallPackage(const nsACString& aPackageName, PRBool aUseProfile) { NS_ERROR("XXX Write me!\n"); return NS_ERROR_FAILURE; Index: security/coreconf/OpenBSD.mk =================================================================== RCS file: /cvsroot/mozilla/security/coreconf/OpenBSD.mk,v retrieving revision 1.2 diff -u -r1.2 OpenBSD.mk --- security/coreconf/OpenBSD.mk 16 Sep 2003 20:50:50 -0000 1.2 +++ security/coreconf/OpenBSD.mk 2 Jun 2005 01:01:45 -0000 @@ -35,12 +35,12 @@ include $(CORE_DEPTH)/coreconf/UNIX.mk -DEFAULT_COMPILER = gcc -CC = gcc -CCC = g++ +DEFAULT_COMPILER = ${CC} +#CC = ${CC} +CCC = ${CXX} RANLIB = ranlib -CPU_ARCH := $(shell uname -p) +CPU_ARCH := $(shell arch -s) ifeq ($(CPU_ARCH),i386) OS_REL_CFLAGS = -Di386 CPU_ARCH = x86 Index: view/public/nsIView.h =================================================================== RCS file: /cvsroot/mozilla/view/public/nsIView.h,v retrieving revision 3.78 diff -u -r3.78 nsIView.h --- view/public/nsIView.h 7 Apr 2004 01:03:51 -0000 3.78 +++ view/public/nsIView.h 2 Jun 2005 01:02:07 -0000 @@ -64,57 +64,31 @@ { 0xf0a21c40, 0xa7e1, 0x11d1, \ { 0xa8, 0x24, 0x00, 0x40, 0x95, 0x9a, 0x28, 0xc9 } } -//Flag to determine whether the view will check if events can be handled -//by its children or just handle the events itself -#define NS_VIEW_FLAG_DONT_CHECK_CHILDREN 0x0001 +// Public view flags are defined in this file +#define NS_VIEW_FLAGS_PUBLIC 0x00FF +// Private view flags are private to the view module, +// and are defined in nsView.h +#define NS_VIEW_FLAGS_PRIVATE 0xFF00 -// indicates that the view is or contains a placeholder view -#define NS_VIEW_FLAG_CONTAINS_PLACEHOLDER 0x0002 +// Public view flags -//the view is transparent -#define NS_VIEW_FLAG_TRANSPARENT 0x0004 +// The view is transparent +#define NS_VIEW_FLAG_TRANSPARENT 0x0001 // The view is always painted onto a background consisting // of a uniform field of opaque pixels. -#define NS_VIEW_FLAG_UNIFORM_BACKGROUND 0x0008 +#define NS_VIEW_FLAG_UNIFORM_BACKGROUND 0x0002 -//indicates that the view should not be bitblt'd when moved -//or scrolled and instead must be repainted -#define NS_VIEW_FLAG_DONT_BITBLT 0x0010 - -// indicates that the view is using auto z-indexing -#define NS_VIEW_FLAG_AUTO_ZINDEX 0x0020 - -// indicates that the view is a floating view. -#define NS_VIEW_FLAG_FLOATING 0x0040 - -// set if our widget resized. -#define NS_VIEW_FLAG_WIDGET_RESIZED 0x0080 - -// set if our widget moved. -#define NS_VIEW_FLAG_WIDGET_MOVED 0x0100 - -// set if this view is clipping its normal descendants -// to its bounds. When this flag is set, child views -// bounds need not be inside this view's bounds. -#define NS_VIEW_FLAG_CLIP_CHILDREN_TO_BOUNDS 0x0200 - -// set if this view is clipping its descendants (including -// placeholders) to its bounds -#define NS_VIEW_FLAG_CLIP_PLACEHOLDERS_TO_BOUNDS 0x0400 - -// set if this view is clipping its normal descendants to -// a specified region. When this flag is set, child views -// bounds need not be inside this view's bounds. The region -// will always lie inside this view's bounds. -// #define NS_VIEW_FLAG_CLIP_CHILDREN_TO_REGION 0x0800 -// we don't need this flag; we just check whether mClipRect -// is null +// Indicates that the view is using auto z-indexing +#define NS_VIEW_FLAG_AUTO_ZINDEX 0x0004 -// if set it indicates that this view should be +// Indicates that the view is a floating view. +#define NS_VIEW_FLAG_FLOATING 0x0008 + +// If set it indicates that this view should be // displayed above z-index:auto views if this view // is z-index:auto also -#define NS_VIEW_FLAG_TOPMOST 0x0800 +#define NS_VIEW_FLAG_TOPMOST 0x0010 struct nsViewZIndex { PRBool mIsAuto; Index: view/public/nsIViewManager.h =================================================================== RCS file: /cvsroot/mozilla/view/public/nsIViewManager.h,v retrieving revision 3.77 diff -u -r3.77 nsIViewManager.h --- view/public/nsIViewManager.h 11 Mar 2004 00:32:01 -0000 3.77 +++ view/public/nsIViewManager.h 2 Jun 2005 01:02:08 -0000 @@ -448,17 +448,6 @@ NS_IMETHOD ForceUpdate() = 0; /** - * Turn widget on or off widget movement caching - */ - NS_IMETHOD IsCachingWidgetChanges(PRBool* aCaching)=0; - - /** - * Pass true to cache widget changes. pass false to stop. When false is passed - * All widget changes will be applied. - */ - NS_IMETHOD CacheWidgetChanges(PRBool aCache)=0; - - /** * Control double buffering of the display. If double buffering * is enabled the viewmanager is allowed to render to an offscreen * drawing surface before copying to the display in order to prevent Index: view/src/nsView.cpp =================================================================== RCS file: /cvsroot/mozilla/view/src/nsView.cpp,v retrieving revision 3.188.6.1 diff -u -r3.188.6.1 nsView.cpp --- view/src/nsView.cpp 15 Oct 2004 23:58:02 -0000 3.188.6.1 +++ view/src/nsView.cpp 2 Jun 2005 01:02:08 -0000 @@ -292,7 +292,7 @@ NS_ASSERTION(GetParent() || (aX == 0 && aY == 0), "Don't try to move the root widget to something non-zero"); - ResetWidgetPosition(PR_TRUE); + ResetWidgetBounds(PR_TRUE, PR_TRUE, PR_FALSE); } void nsView::SetPositionIgnoringChildWidgets(nscoord aX, nscoord aY) @@ -302,27 +302,30 @@ mPosX = aX; mPosY = aY; - ResetWidgetPosition(PR_FALSE); + ResetWidgetBounds(PR_FALSE, PR_TRUE, PR_FALSE); } -void nsView::ResetWidgetPosition(PRBool aRecurse) { - if (mWindow) - { - // see if we are caching our widget changes. Yes? - // mark us as changed. Later we will actually move the - // widget. - PRBool caching = PR_FALSE; - mViewManager->IsCachingWidgetChanges(&caching); - if (caching) { - mVFlags |= NS_VIEW_FLAG_WIDGET_MOVED; +void nsView::ResetWidgetBounds(PRBool aRecurse, PRBool aMoveOnly, + PRBool aInvalidateChangedSize) { + if (mWindow) { + // If our view manager has refresh disabled, then + // do nothing; the view manager will set our position when + // refresh is reenabled. + if (!mViewManager->IsRefreshEnabled()) { + return; + } + + // The geometry of a root view's widget is controlled externally, + // NOT by sizing or positioning the view + if (mViewManager->GetRootView() == this) { return; } nsIDeviceContext *dx; - float scale; + float t2p; mViewManager->GetDeviceContext(dx); - scale = dx->AppUnitsToDevUnits(); + t2p = dx->AppUnitsToDevUnits(); NS_RELEASE(dx); nsPoint offset(0, 0); @@ -330,113 +333,55 @@ GetParent()->GetNearestWidget(&offset); } - mWindow->Move(NSTwipsToIntPixels((mDimBounds.x + offset.x), scale), - NSTwipsToIntPixels((mDimBounds.y + offset.y), scale)); + nsRect newBounds(NSTwipsToIntPixels((mDimBounds.x + offset.x), t2p), + NSTwipsToIntPixels((mDimBounds.y + offset.y), t2p), + NSTwipsToIntPixels(mDimBounds.width, t2p), + NSTwipsToIntPixels(mDimBounds.height, t2p)); + + PRBool changedPos = PR_TRUE; + PRBool changedSize = PR_TRUE; + if (!(mVFlags & NS_VIEW_FLAG_HAS_POSITIONED_WIDGET)) { + mVFlags |= NS_VIEW_FLAG_HAS_POSITIONED_WIDGET; + } else { + nsRect curBounds; + mWindow->GetBounds(curBounds); + changedPos = curBounds.TopLeft() != newBounds.TopLeft(); + changedSize = curBounds.Size() != newBounds.Size(); + } + + if (changedPos) { + if (changedSize && !aMoveOnly) { + mWindow->Resize(newBounds.x, newBounds.y, newBounds.width, newBounds.height, + aInvalidateChangedSize); + } else { + mWindow->Move(newBounds.x, newBounds.y); + } + } else { + if (changedSize && !aMoveOnly) { + mWindow->Resize(newBounds.width, newBounds.height, aInvalidateChangedSize); + } // else do nothing! + } } else if (aRecurse) { // reposition any widgets under this view for (nsView* v = GetFirstChild(); v; v = v->GetNextSibling()) { - v->ResetWidgetPosition(aRecurse); + v->ResetWidgetBounds(PR_TRUE, aMoveOnly, aInvalidateChangedSize); } } } -NS_IMETHODIMP nsView::SynchWidgetSizePosition() -{ - // if the widget was moved or resized - if (mVFlags & NS_VIEW_FLAG_WIDGET_MOVED || mVFlags & NS_VIEW_FLAG_WIDGET_RESIZED) - { - nsIDeviceContext *dx; - float t2p; - - mViewManager->GetDeviceContext(dx); - t2p = dx->AppUnitsToDevUnits(); - NS_RELEASE(dx); - // if we just resized do it - if (mVFlags & NS_VIEW_FLAG_WIDGET_RESIZED) - { - - PRInt32 width = NSTwipsToIntPixels(mDimBounds.width, t2p); - PRInt32 height = NSTwipsToIntPixels(mDimBounds.height, t2p); - - nsRect bounds; - mWindow->GetBounds(bounds); - - if (bounds.width != width || bounds.height != bounds.height) { - mWindow->Resize(width,height, PR_TRUE); - } - - mVFlags &= ~NS_VIEW_FLAG_WIDGET_RESIZED; - } - - if (mVFlags & NS_VIEW_FLAG_WIDGET_MOVED) { - // if we just moved do it. - nsPoint offset; - GetParent()->GetNearestWidget(&offset); - - PRInt32 x = NSTwipsToIntPixels(mDimBounds.x + offset.x, t2p); - PRInt32 y = NSTwipsToIntPixels(mDimBounds.y + offset.y, t2p); - - nsRect bounds; - mWindow->GetBounds(bounds); - - if (bounds.x != x || bounds.y != y) { - mWindow->Move(x,y); - } - - mVFlags &= ~NS_VIEW_FLAG_WIDGET_MOVED; - } - } - - - return NS_OK; -} - -void nsView::SetDimensions(const nsRect& aRect, PRBool aPaint) +void nsView::SetDimensions(const nsRect& aRect, PRBool aPaint, PRBool aResizeWidget) { nsRect dims = aRect; dims.MoveBy(mPosX, mPosY); - if (mDimBounds.x == dims.x && mDimBounds.y == dims.y && mDimBounds.width == dims.width - && mDimBounds.height == dims.height) { + if (mDimBounds == dims) { return; } - - if (nsnull == mWindow) - { - mDimBounds = dims; - } - else - { - PRBool needToMoveWidget = mDimBounds.x != dims.x || mDimBounds.y != dims.y; - mDimBounds = dims; - - PRBool caching = PR_FALSE; - mViewManager->IsCachingWidgetChanges(&caching); - if (caching) { - mVFlags |= NS_VIEW_FLAG_WIDGET_RESIZED | (needToMoveWidget ? NS_VIEW_FLAG_WIDGET_MOVED : 0); - return; - } + mDimBounds = dims; - nsIDeviceContext *dx; - float t2p; - - mViewManager->GetDeviceContext(dx); - t2p = dx->AppUnitsToDevUnits(); - - if (needToMoveWidget) { - NS_ASSERTION(GetParent(), "Don't try to move the root widget, dude"); - - nsPoint offset; - GetParent()->GetNearestWidget(&offset); - - mWindow->Move(NSTwipsToIntPixels((mDimBounds.x + offset.x), t2p), - NSTwipsToIntPixels((mDimBounds.y + offset.y), t2p)); - } - mWindow->Resize(NSTwipsToIntPixels(mDimBounds.width, t2p), NSTwipsToIntPixels(mDimBounds.height, t2p), - aPaint); - - NS_RELEASE(dx); + if (aResizeWidget) { + ResetWidgetBounds(PR_FALSE, PR_FALSE, aPaint); } } @@ -641,6 +586,8 @@ mWindow->SetClientData((void *)this); } + mVFlags &= ~NS_VIEW_FLAG_HAS_POSITIONED_WIDGET; + return NS_OK; } @@ -656,6 +603,8 @@ mWindow->SetClientData((void*)this); } + mVFlags &= ~NS_VIEW_FLAG_HAS_POSITIONED_WIDGET; + return rv; } Index: view/src/nsView.h =================================================================== RCS file: /cvsroot/mozilla/view/src/nsView.h,v retrieving revision 3.83 diff -u -r3.83 nsView.h --- view/src/nsView.h 11 Mar 2004 00:32:01 -0000 3.83 +++ view/src/nsView.h 2 Jun 2005 01:02:08 -0000 @@ -55,6 +55,31 @@ class nsViewManager; class nsZPlaceholderView; +// View flags private to the view module + +// indicates that the view is or contains a placeholder view +#define NS_VIEW_FLAG_CONTAINS_PLACEHOLDER 0x0100 + +// Flag to determine whether the view will check if events can be handled +// by its children or just handle the events itself +#define NS_VIEW_FLAG_DONT_CHECK_CHILDREN 0x0200 + +// indicates that the view should not be bitblt'd when moved +// or scrolled and instead must be repainted +#define NS_VIEW_FLAG_DONT_BITBLT 0x0400 + +// set if this view is clipping its normal descendants +// to its bounds. When this flag is set, child views +// bounds need not be inside this view's bounds. +#define NS_VIEW_FLAG_CLIP_CHILDREN_TO_BOUNDS 0x0800 + +// set if this view is clipping its descendants (including +// placeholders) to its bounds +#define NS_VIEW_FLAG_CLIP_PLACEHOLDERS_TO_BOUNDS 0x1000 + +// set if this view has positioned its widget at least once +#define NS_VIEW_FLAG_HAS_POSITIONED_WIDGET 0x2000 + // IID for the nsIClipView interface #define NS_ICLIPVIEW_IID \ { 0x4cc36160, 0xd282, 0x11d2, \ @@ -112,7 +137,8 @@ * The x and y coordinates may be < 0, indicating that the view extends above * or to the left of its origin position. */ - virtual void SetDimensions(const nsRect &aRect, PRBool aPaint = PR_TRUE); + virtual void SetDimensions(const nsRect &aRect, PRBool aPaint = PR_TRUE, + PRBool aResizeWidget = PR_TRUE); void GetDimensions(nsRect &aRect) const { aRect = mDimBounds; aRect.x -= mPosX; aRect.y -= mPosY; } void GetDimensions(nsSize &aSize) const { aSize.width = mDimBounds.width; aSize.height = mDimBounds.height; } @@ -219,12 +245,6 @@ */ nsRect GetClippedRect(); - /** - * Sync your widget size and position with the view - */ - NS_IMETHOD SynchWidgetSizePosition(); - - // Helper function to get the view that's associated with a widget static nsView* GetViewFor(nsIWidget* aWidget); @@ -270,7 +290,7 @@ // Just write "pt -= view->GetPosition();" // When everything's converted to nsPoint, this can go away. void ConvertFromParentCoords(nscoord* aX, nscoord* aY) const { *aX -= mPosX; *aY -= mPosY; } - void ResetWidgetPosition(PRBool aRecurse); + void ResetWidgetBounds(PRBool aRecurse, PRBool aMoveOnly, PRBool aInvalidateChangedSize); void SetPositionIgnoringChildWidgets(nscoord aX, nscoord aY); nsresult LoadWidget(const nsCID &aClassIID); Index: view/src/nsViewManager.cpp =================================================================== RCS file: /cvsroot/mozilla/view/src/nsViewManager.cpp,v retrieving revision 3.323.6.4 diff -u -r3.323.6.4 nsViewManager.cpp --- view/src/nsViewManager.cpp 19 Oct 2004 22:24:56 -0000 3.323.6.4 +++ view/src/nsViewManager.cpp 2 Jun 2005 01:02:08 -0000 @@ -461,7 +461,6 @@ // assumed to be cleared here. mX = 0; mY = 0; - mCachingWidgetChanges = 0; mDefaultBackgroundColor = NS_RGBA(0, 0, 0, 0); mAllowDoubleBuffering = PR_TRUE; mHasPendingInvalidates = PR_FALSE; @@ -1586,7 +1585,10 @@ if (!aView) { return; } + if (aView->HasWidget()) { + aView->ResetWidgetBounds(PR_FALSE, PR_FALSE, PR_TRUE); + nsCOMPtr dirtyRegion; aView->GetDirtyRegion(*getter_AddRefs(dirtyRegion)); if (dirtyRegion && !dirtyRegion->IsEmpty()) { @@ -4017,38 +4019,6 @@ NS_IMETHODIMP -nsViewManager::IsCachingWidgetChanges(PRBool* aCaching) -{ -#ifdef CACHE_WIDGET_CHANGES - *aCaching = (mCachingWidgetChanges > 0); -#else - *aCaching = PR_FALSE; -#endif - - return NS_OK; -} - -NS_IMETHODIMP -nsViewManager::CacheWidgetChanges(PRBool aCache) -{ - -#ifdef CACHE_WIDGET_CHANGES - if (aCache == PR_TRUE) - mCachingWidgetChanges++; - else - mCachingWidgetChanges--; - - NS_ASSERTION(mCachingWidgetChanges >= 0, "One too many decrements"); - - // if we turned it off. Then move and size all the widgets. - if (mCachingWidgetChanges == 0) - ProcessWidgetChanges(mRootView); -#endif - - return NS_OK; -} - -NS_IMETHODIMP nsViewManager::AllowDoubleBuffering(PRBool aDoubleBuffer) { mAllowDoubleBuffering = aDoubleBuffer; @@ -4079,30 +4049,6 @@ mInvalidateEventQueue = nsnull; } -nsresult -nsViewManager::ProcessWidgetChanges(nsView* aView) -{ - //printf("---------Begin Sync----------\n"); - nsresult rv = aView->SynchWidgetSizePosition(); - if (NS_FAILED(rv)) - return rv; - - nsView *child = aView->GetFirstChild(); - while (nsnull != child) { - if (child->GetViewManager() == this) { - rv = ProcessWidgetChanges(child); - if (NS_FAILED(rv)) - return rv; - } - - child = child->GetNextSibling(); - } - - //printf("---------End Sync----------\n"); - - return NS_OK; -} - NS_IMETHODIMP nsViewManager::SetDefaultBackgroundColor(nscolor aColor) { Index: view/src/nsViewManager.h =================================================================== RCS file: /cvsroot/mozilla/view/src/nsViewManager.h,v retrieving revision 3.121.6.1 diff -u -r3.121.6.1 nsViewManager.h --- view/src/nsViewManager.h 15 Oct 2004 23:58:02 -0000 3.121.6.1 +++ view/src/nsViewManager.h 2 Jun 2005 01:02:09 -0000 @@ -204,8 +204,6 @@ nsIWidget* GetWidget() { return mRootWindow; } NS_IMETHOD ForceUpdate(); - NS_IMETHOD IsCachingWidgetChanges(PRBool* aCaching); - NS_IMETHOD CacheWidgetChanges(PRBool aCache); NS_IMETHOD AllowDoubleBuffering(PRBool aDoubleBuffer); NS_IMETHOD IsPainting(PRBool& aIsPainting); NS_IMETHOD FlushPendingInvalidates(); @@ -339,8 +337,6 @@ nsresult GetVisibleRect(nsRect& aVisibleRect); - nsresult ProcessWidgetChanges(nsView* aView); - // Utilities used to size the offscreen drawing surface /** @@ -389,6 +385,8 @@ // not be in this view manager). static nsPoint ComputeViewOffset(const nsView *aView); + PRBool IsRefreshEnabled() { return mRefreshEnabled; } + private: nsIDeviceContext *mContext; float mTwipsToPixels; @@ -403,7 +401,6 @@ PRInt32 mUpdateCnt; PRInt32 mUpdateBatchCnt; nsIScrollableView *mRootScrollable; - PRInt32 mCachingWidgetChanges; nscolor mDefaultBackgroundColor; // The size for a resize that we delayed until the root view becomes Index: widget/src/gtk/nsSound.cpp =================================================================== RCS file: /cvsroot/mozilla/widget/src/gtk/nsSound.cpp,v retrieving revision 1.37 diff -u -r1.37 nsSound.cpp --- widget/src/gtk/nsSound.cpp 7 Mar 2004 19:12:02 -0000 1.37 +++ widget/src/gtk/nsSound.cpp 2 Jun 2005 01:02:10 -0000 @@ -86,7 +86,7 @@ EsdOpenSoundType EsdOpenSound; - elib = PR_LoadLibrary("libesd.so.0"); + elib = PR_LoadLibrary("libesd.so"); if (!elib) return NS_ERROR_FAILURE; EsdOpenSound = (EsdOpenSoundType) PR_FindSymbol(elib, "esd_open_sound"); Index: widget/src/gtk2/nsCommonWidget.cpp =================================================================== RCS file: /cvsroot/mozilla/widget/src/gtk2/nsCommonWidget.cpp,v retrieving revision 1.22.8.1 diff -u -r1.22.8.1 nsCommonWidget.cpp --- widget/src/gtk2/nsCommonWidget.cpp 24 May 2004 23:04:27 -0000 1.22.8.1 +++ widget/src/gtk2/nsCommonWidget.cpp 2 Jun 2005 01:02:10 -0000 @@ -275,7 +275,12 @@ if (AreBoundsSane()) { // Yep? Resize the window //Maybe, the toplevel has moved - if (mIsTopLevel) + + // Note that if the widget needs to be shown because it + // was previously insane in Resize(x,y,w,h), then we need + // to set the x and y here too, because the widget wasn't + // moved back then + if (mIsTopLevel || mNeedsShow) NativeResize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, aRepaint); else Index: widget/src/gtk2/nsSound.cpp =================================================================== RCS file: /cvsroot/mozilla/widget/src/gtk2/nsSound.cpp,v retrieving revision 1.8 diff -u -r1.8 nsSound.cpp --- widget/src/gtk2/nsSound.cpp 7 Mar 2004 19:12:21 -0000 1.8 +++ widget/src/gtk2/nsSound.cpp 2 Jun 2005 01:02:10 -0000 @@ -91,7 +91,7 @@ EsdOpenSoundType EsdOpenSound; - elib = PR_LoadLibrary("libesd.so.0"); + elib = PR_LoadLibrary("libesd.so"); if (!elib) return NS_ERROR_FAILURE; EsdOpenSound = (EsdOpenSoundType) PR_FindSymbol(elib, "esd_open_sound"); Index: xpcom/io/nsNativeCharsetUtils.cpp =================================================================== RCS file: /cvsroot/mozilla/xpcom/io/nsNativeCharsetUtils.cpp,v retrieving revision 1.25.2.1.2.2 diff -u -r1.25.2.1.2.2 nsNativeCharsetUtils.cpp --- xpcom/io/nsNativeCharsetUtils.cpp 9 Nov 2004 20:46:03 -0000 1.25.2.1.2.2 +++ xpcom/io/nsNativeCharsetUtils.cpp 2 Jun 2005 01:02:12 -0000 @@ -329,7 +329,11 @@ { const char *blank_list[] = { "", NULL }; const char **native_charset_list = blank_list; +#ifdef CODESET const char *native_charset = nl_langinfo(CODESET); +#else + const char *native_charset = nsnull; +#endif if (native_charset == nsnull) { NS_ERROR("native charset is unknown"); // fallback to ISO-8859-1 Index: xpcom/reflect/xptcall/src/md/unix/Makefile.in =================================================================== RCS file: /cvsroot/mozilla/xpcom/reflect/xptcall/src/md/unix/Makefile.in,v retrieving revision 1.75.2.1.14.1 diff -u -r1.75.2.1.14.1 Makefile.in --- xpcom/reflect/xptcall/src/md/unix/Makefile.in 28 Apr 2005 16:01:33 -0000 1.75.2.1.14.1 +++ xpcom/reflect/xptcall/src/md/unix/Makefile.in 2 Jun 2005 01:02:13 -0000 @@ -111,6 +111,12 @@ ASFILES := xptcinvoke_asm_osf1_alpha.s xptcstubs_asm_osf1_alpha.s endif # +# OpenBSD/Alpha +# +ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDalpha) +CPPSRCS := xptcinvoke_openbsd_alpha.cpp xptcstubs_openbsd_alpha.cpp +endif +# # Linux/Alpha # ifneq (,$(filter Linuxalpha FreeBSDalpha NetBSDalpha,$(OS_ARCH)$(OS_TEST))) @@ -260,6 +266,14 @@ endif # +# OpenBSD/PPC +# +ifneq (,$(filter OpenBSDmacppc,$(OS_ARCH)$(OS_TEST))) +CPPSRCS := xptcinvoke_ppc_openbsd.cpp xptcstubs_ppc_openbsd.cpp +ASFILES := xptcinvoke_asm_ppc_openbsd.s xptcstubs_asm_ppc_openbsd.s +endif + +# # Darwin/PPC # ifeq ($(OS_ARCH),Darwin) @@ -332,6 +346,20 @@ endif endif +# +# OpenBSD/SPARC +# +ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc) +CPPSRCS := xptcinvoke_sparc_netbsd.cpp xptcstubs_sparc_netbsd.cpp +ASFILES := xptcinvoke_asm_sparc_netbsd.s xptcstubs_asm_sparc_netbsd.s +endif +# +# OpenBSD/SPARC64 +# +ifeq ($(OS_ARCH)$(OS_TEST),OpenBSDsparc64) +CPPSRCS := xptcinvoke_sparc64_openbsd.cpp xptcstubs_sparc64_openbsd.cpp +ASFILES := xptcinvoke_asm_sparc64_openbsd.s xptcstubs_asm_sparcv9_solaris.s +endif ###################################################################### # S/390 Index: xpcom/sample/Makefile.in =================================================================== RCS file: /cvsroot/mozilla/xpcom/sample/Makefile.in,v retrieving revision 1.34 diff -u -r1.34 Makefile.in --- xpcom/sample/Makefile.in 19 Feb 2004 02:43:46 -0000 1.34 +++ xpcom/sample/Makefile.in 2 Jun 2005 01:02:14 -0000 @@ -52,7 +52,7 @@ TESTCPPSRCS = nsTestSample.cpp -CPPSRCS += $(TESTCPPSRCS) +#CPPSRCS += $(TESTCPPSRCS) SIMPLE_PROGRAMS = $(TESTCPPSRCS:.cpp=$(BIN_SUFFIX))