Index: mail/mozilla-thunderbird/Makefile
===================================================================
RCS file: /cvs/ports/mail/mozilla-thunderbird/Makefile,v
retrieving revision 1.118
diff -u -p -r1.118 Makefile
--- mail/mozilla-thunderbird/Makefile	2 Mar 2011 14:44:19 -0000	1.118
+++ mail/mozilla-thunderbird/Makefile	8 Mar 2011 13:45:55 -0000
@@ -12,6 +12,7 @@ MOZILLA_CODENAME =	mail
 
 MULTI_PACKAGES =	-main -lightning
 PKGNAME-main =		${PKGNAME}
+REVISION-main =		0
 PKGNAME-lightning =	lightning-1.0beta2
 EPOCH-lightning =	0
 REVISION-lightning =	14
Index: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
===================================================================
RCS file: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
diff -N mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp	8 Mar 2011 13:45:55 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp.orig	Mon Feb 21 12:47:04 2011
++++ mozilla/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp	Tue Mar  8 14:30:15 2011
+@@ -202,7 +202,7 @@ static NS_METHOD ReadDataOut(nsIInputStream* in,
+ nsresult
+ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
+ {
+-  nsIntRect r(0, fromRow, mGIFStruct.width, rows);
++  nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
+ 
+   // Update image  
+   nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
+@@ -215,7 +215,6 @@ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint
+   if (!mGIFStruct.images_decoded && mObserver) {
+     PRUint32 imgCurFrame;
+     mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
+-    r.y += mGIFStruct.y_offset;
+     mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
+   }
+   return NS_OK;
Index: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgContainer_cpp
===================================================================
RCS file: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgContainer_cpp
diff -N mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgContainer_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgContainer_cpp	8 Mar 2011 13:45:55 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+--- mozilla/modules/libpr0n/src/imgContainer.cpp.orig	Mon Feb 21 12:47:04 2011
++++ mozilla/modules/libpr0n/src/imgContainer.cpp	Tue Mar  8 14:30:15 2011
+@@ -420,6 +420,8 @@ nsresult imgContainer::InternalAddFrameHelper(PRUint32
+ 
+   frame->GetImageData(imageData, imageLength);
+ 
++  frame->LockImageData();
++
+   mFrames.InsertElementAt(framenum, frame.forget());
+   mNumFrames++;
+ 
+@@ -444,6 +446,11 @@ nsresult imgContainer::InternalAddFrame(PRUint32 frame
+ 
+   nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
+   NS_ENSURE_SUCCESS(rv, rv);
++
++  if (mFrames.Length() > 0) {
++    imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
++    prevframe->UnlockImageData();
++  }
+ 
+   if (mFrames.Length() == 0) {
+     return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength, 
Index: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_cpp
===================================================================
RCS file: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_cpp
diff -N mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_cpp	8 Mar 2011 13:45:55 -0000
@@ -0,0 +1,83 @@
+$OpenBSD$
+--- mozilla/modules/libpr0n/src/imgFrame.cpp.orig	Mon Feb 21 12:47:04 2011
++++ mozilla/modules/libpr0n/src/imgFrame.cpp	Tue Mar  8 14:30:15 2011
+@@ -157,6 +157,7 @@ imgFrame::imgFrame() :
+ #ifdef USE_WIN_SURFACE
+   , mIsDDBSurface(PR_FALSE)
+ #endif
++  , mLocked(PR_FALSE)
+ {
+   static PRBool hasCheckedOptimize = PR_FALSE;
+   if (!hasCheckedOptimize) {
+@@ -418,8 +419,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::
+ 
+   PRBool doTile = !imageRect.Contains(sourceRect);
+   if (doPadding || doPartialDecode) {
+-    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
+-      gfxPoint(aPadding.left, aPadding.top);
++    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
+ 
+     if (!doTile && !mSinglePixel) {
+       // Not tiling, and we have a surface, so we can account for
+@@ -713,7 +713,7 @@ nsresult imgFrame::ImageUpdated(const nsIntRect &aUpda
+ 
+   // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
+   // you, gif decoder)
+-  nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
++  nsIntRect boundsRect(mOffset, mSize);
+   mDecoded.IntersectRect(mDecoded, boundsRect);
+ 
+ #ifdef XP_MACOSX
+@@ -811,8 +811,14 @@ void imgFrame::GetPaletteData(PRUint32 **aPalette, PRU
+ nsresult imgFrame::LockImageData()
+ {
+   if (mPalettedImageData)
+-    return NS_OK;
++    return NS_ERROR_NOT_AVAILABLE;
+ 
++  NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
++  if (mLocked) {
++    return NS_ERROR_FAILURE;
++  }
++  mLocked = PR_TRUE;
++
+   if ((mOptSurface || mSinglePixel) && !mImageSurface) {
+     // Recover the pixels
+     mImageSurface = new gfxImageSurface(gfxIntSize(mSize.width, mSize.height),
+@@ -837,14 +843,26 @@ nsresult imgFrame::LockImageData()
+ #endif
+   }
+ 
++  if (mImageSurface)
++    mImageSurface->Flush();
++
+   return NS_OK;
+ }
+ 
+ nsresult imgFrame::UnlockImageData()
+ {
+   if (mPalettedImageData)
+-    return NS_OK;
++    return NS_ERROR_NOT_AVAILABLE;
+ 
++  NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
++  if (!mLocked) {
++    return NS_ERROR_FAILURE;
++  }
++  mLocked = PR_FALSE;
++
++  if (mImageSurface)
++    mImageSurface->MarkDirty();
++
+ #ifdef XP_MACOSX
+   if (mQuartzSurface)
+     mQuartzSurface->Flush();
+@@ -900,7 +918,7 @@ void imgFrame::SetBlendMethod(PRInt32 aBlendMethod)
+ 
+ PRBool imgFrame::ImageComplete() const
+ {
+-  return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
++  return mDecoded == nsIntRect(mOffset, mSize);
+ }
+ 
+ // A hint from the image decoders that this image has no alpha, even
Index: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_h
===================================================================
RCS file: mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_h
diff -N mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mail/mozilla-thunderbird/patches/patch-mozilla_modules_libpr0n_src_imgFrame_h	8 Mar 2011 13:45:55 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- mozilla/modules/libpr0n/src/imgFrame.h.orig	Mon Feb 21 12:47:04 2011
++++ mozilla/modules/libpr0n/src/imgFrame.h	Tue Mar  8 14:30:15 2011
+@@ -172,6 +172,7 @@ class imgFrame (private)
+   PRPackedBool mNeverUseDeviceSurface;
+   PRPackedBool mFormatChanged;
+   PRPackedBool mCompositingFailed;
++  PRPackedBool mLocked;
+ 
+ #ifdef XP_WIN
+   PRPackedBool mIsDDBSurface;
Index: www/mozilla/mozilla.port.mk
===================================================================
RCS file: /cvs/ports/www/mozilla/mozilla.port.mk,v
retrieving revision 1.20
diff -u -p -r1.20 mozilla.port.mk
--- www/mozilla/mozilla.port.mk	18 Jan 2011 12:31:24 -0000	1.20
+++ www/mozilla/mozilla.port.mk	8 Mar 2011 13:47:18 -0000
@@ -72,6 +72,11 @@ CONFIGURE_ARGS +=--with-system-jpeg=${LO
 		--enable-svg-renderer=cairo	\
 		--enable-canvas
 
+# for mozilla branch 1.9.2, build against systemwide cairo
+.if ${MOZILLA_BRANCH} == 1.9.2
+CONFIGURE_ARGS +=--enable-system-cairo
+.endif
+
 # those ones only apply to mozilla branch 1.9.2 but 1.9.1 apps don't complain
 CONFIGURE_ARGS +=--disable-freetypetest		\
 		--disable-mochitest		\
Index: www/mozilla-firefox/Makefile
===================================================================
RCS file: /cvs/ports/www/mozilla-firefox/Makefile,v
retrieving revision 1.167
diff -u -p -r1.167 Makefile
--- www/mozilla-firefox/Makefile	2 Mar 2011 14:39:48 -0000	1.167
+++ www/mozilla-firefox/Makefile	8 Mar 2011 13:47:18 -0000
@@ -7,6 +7,7 @@ MOZILLA_VERSION =	3.6.14
 MOZILLA_BRANCH =	1.9.2
 MOZILLA_PROJECT =	mozilla-firefox
 MOZILLA_CODENAME =	browser
+REVISION =		0
 
 SO_VERSION =	22.2
 # NOTE: Must bump minor version if any shlib's are removed from the
Index: www/mozilla-firefox/patches/patch-modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
===================================================================
RCS file: www/mozilla-firefox/patches/patch-modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
diff -N www/mozilla-firefox/patches/patch-modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/mozilla-firefox/patches/patch-modules_libpr0n_decoders_gif_nsGIFDecoder2_cpp	8 Mar 2011 13:47:18 -0000
@@ -0,0 +1,20 @@
+$OpenBSD$
+--- modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp.orig	Thu Mar  3 11:43:21 2011
++++ modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp	Tue Mar  8 12:43:28 2011
+@@ -202,7 +202,7 @@ static NS_METHOD ReadDataOut(nsIInputStream* in,
+ nsresult
+ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
+ {
+-  nsIntRect r(0, fromRow, mGIFStruct.width, rows);
++  nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
+ 
+   // Update image  
+   nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
+@@ -215,7 +215,6 @@ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint
+   if (!mGIFStruct.images_decoded && mObserver) {
+     PRUint32 imgCurFrame;
+     mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
+-    r.y += mGIFStruct.y_offset;
+     mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
+   }
+   return NS_OK;
Index: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgContainer_cpp
===================================================================
RCS file: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgContainer_cpp
diff -N www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgContainer_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgContainer_cpp	8 Mar 2011 13:47:18 -0000
@@ -0,0 +1,24 @@
+$OpenBSD$
+--- modules/libpr0n/src/imgContainer.cpp.orig	Thu Mar  3 11:43:21 2011
++++ modules/libpr0n/src/imgContainer.cpp	Tue Mar  8 12:43:28 2011
+@@ -420,6 +420,8 @@ nsresult imgContainer::InternalAddFrameHelper(PRUint32
+ 
+   frame->GetImageData(imageData, imageLength);
+ 
++  frame->LockImageData();
++
+   mFrames.InsertElementAt(framenum, frame.forget());
+   mNumFrames++;
+ 
+@@ -444,6 +446,11 @@ nsresult imgContainer::InternalAddFrame(PRUint32 frame
+ 
+   nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
+   NS_ENSURE_SUCCESS(rv, rv);
++
++  if (mFrames.Length() > 0) {
++    imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
++    prevframe->UnlockImageData();
++  }
+ 
+   if (mFrames.Length() == 0) {
+     return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength, 
Index: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_cpp
===================================================================
RCS file: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_cpp
diff -N www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_cpp	8 Mar 2011 13:47:18 -0000
@@ -0,0 +1,83 @@
+$OpenBSD$
+--- modules/libpr0n/src/imgFrame.cpp.orig	Thu Mar  3 11:43:21 2011
++++ modules/libpr0n/src/imgFrame.cpp	Tue Mar  8 12:43:28 2011
+@@ -157,6 +157,7 @@ imgFrame::imgFrame() :
+ #ifdef USE_WIN_SURFACE
+   , mIsDDBSurface(PR_FALSE)
+ #endif
++  , mLocked(PR_FALSE)
+ {
+   static PRBool hasCheckedOptimize = PR_FALSE;
+   if (!hasCheckedOptimize) {
+@@ -418,8 +419,7 @@ void imgFrame::Draw(gfxContext *aContext, gfxPattern::
+ 
+   PRBool doTile = !imageRect.Contains(sourceRect);
+   if (doPadding || doPartialDecode) {
+-    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
+-      gfxPoint(aPadding.left, aPadding.top);
++    gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
+ 
+     if (!doTile && !mSinglePixel) {
+       // Not tiling, and we have a surface, so we can account for
+@@ -713,7 +713,7 @@ nsresult imgFrame::ImageUpdated(const nsIntRect &aUpda
+ 
+   // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
+   // you, gif decoder)
+-  nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
++  nsIntRect boundsRect(mOffset, mSize);
+   mDecoded.IntersectRect(mDecoded, boundsRect);
+ 
+ #ifdef XP_MACOSX
+@@ -811,8 +811,14 @@ void imgFrame::GetPaletteData(PRUint32 **aPalette, PRU
+ nsresult imgFrame::LockImageData()
+ {
+   if (mPalettedImageData)
+-    return NS_OK;
++    return NS_ERROR_NOT_AVAILABLE;
+ 
++  NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
++  if (mLocked) {
++    return NS_ERROR_FAILURE;
++  }
++  mLocked = PR_TRUE;
++
+   if ((mOptSurface || mSinglePixel) && !mImageSurface) {
+     // Recover the pixels
+     mImageSurface = new gfxImageSurface(gfxIntSize(mSize.width, mSize.height),
+@@ -837,14 +843,26 @@ nsresult imgFrame::LockImageData()
+ #endif
+   }
+ 
++  if (mImageSurface)
++    mImageSurface->Flush();
++
+   return NS_OK;
+ }
+ 
+ nsresult imgFrame::UnlockImageData()
+ {
+   if (mPalettedImageData)
+-    return NS_OK;
++    return NS_ERROR_NOT_AVAILABLE;
+ 
++  NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
++  if (!mLocked) {
++    return NS_ERROR_FAILURE;
++  }
++  mLocked = PR_FALSE;
++
++  if (mImageSurface)
++    mImageSurface->MarkDirty();
++
+ #ifdef XP_MACOSX
+   if (mQuartzSurface)
+     mQuartzSurface->Flush();
+@@ -900,7 +918,7 @@ void imgFrame::SetBlendMethod(PRInt32 aBlendMethod)
+ 
+ PRBool imgFrame::ImageComplete() const
+ {
+-  return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
++  return mDecoded == nsIntRect(mOffset, mSize);
+ }
+ 
+ // A hint from the image decoders that this image has no alpha, even
Index: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_h
===================================================================
RCS file: www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_h
diff -N www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ www/mozilla-firefox/patches/patch-modules_libpr0n_src_imgFrame_h	8 Mar 2011 13:47:18 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- modules/libpr0n/src/imgFrame.h.orig	Thu Mar  3 11:43:21 2011
++++ modules/libpr0n/src/imgFrame.h	Tue Mar  8 12:43:28 2011
+@@ -172,6 +172,7 @@ class imgFrame (private)
+   PRPackedBool mNeverUseDeviceSurface;
+   PRPackedBool mFormatChanged;
+   PRPackedBool mCompositingFailed;
++  PRPackedBool mLocked;
+ 
+ #ifdef XP_WIN
+   PRPackedBool mIsDDBSurface;
