From cf38d1c59a790a0c683757883f104d29a0931301 Mon Sep 17 00:00:00 2001 From: Taras Glek Date: Tue, 14 Sep 2010 15:47:47 -0400 Subject: [PATCH 1/7] Bug 594172 - ZipWriter write()s too often r=Mossop a=2.0 --- .../libjar/zipwriter/src/nsZipDataStream.cpp | 15 ++------------ modules/libjar/zipwriter/src/nsZipHeader.h | 2 ++ modules/libjar/zipwriter/src/nsZipWriter.cpp | 20 ++++++++++++++++++- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/modules/libjar/zipwriter/src/nsZipDataStream.cpp b/modules/libjar/zipwriter/src/nsZipDataStream.cpp index 46f0d131eec..f8559c61101 100644 --- a/modules/libjar/zipwriter/src/nsZipDataStream.cpp +++ b/modules/libjar/zipwriter/src/nsZipDataStream.cpp @@ -152,8 +152,7 @@ NS_IMETHODIMP nsZipDataStream::OnStopRequest(nsIRequest *aRequest, inline nsresult nsZipDataStream::CompleteEntry() { - nsresult rv = mStream->Flush(); - NS_ENSURE_SUCCESS(rv, rv); + nsresult rv; nsCOMPtr seekable = do_QueryInterface(mStream, &rv); NS_ENSURE_SUCCESS(rv, rv); PRInt64 pos; @@ -161,17 +160,7 @@ inline nsresult nsZipDataStream::CompleteEntry() NS_ENSURE_SUCCESS(rv, rv); mHeader->mCSize = pos - mHeader->mOffset - mHeader->GetFileHeaderLength(); - - // Go back and rewrite the file header - rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, mHeader->mOffset); - NS_ENSURE_SUCCESS(rv, rv); - rv = mHeader->WriteFileHeader(mStream); - NS_ENSURE_SUCCESS(rv, rv); - rv = mStream->Flush(); - NS_ENSURE_SUCCESS(rv, rv); - rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, pos); - NS_ENSURE_SUCCESS(rv, rv); - + mHeader->mWriteOnClose = PR_TRUE; return NS_OK; } diff --git a/modules/libjar/zipwriter/src/nsZipHeader.h b/modules/libjar/zipwriter/src/nsZipHeader.h index 22f86cc2cf3..9d7c269fbe4 100644 --- a/modules/libjar/zipwriter/src/nsZipHeader.h +++ b/modules/libjar/zipwriter/src/nsZipHeader.h @@ -78,6 +78,7 @@ public: mDisk(0), mIAttr(0), mInited(PR_FALSE), + mWriteOnClose(PR_FALSE), mExtraField(NULL), mLocalExtraField(NULL) { @@ -105,6 +106,7 @@ public: PRUint16 mDisk; PRUint16 mIAttr; PRPackedBool mInited; + PRPackedBool mWriteOnClose; nsCString mName; nsCString mComment; nsAutoArrayPtr mExtraField; diff --git a/modules/libjar/zipwriter/src/nsZipWriter.cpp b/modules/libjar/zipwriter/src/nsZipWriter.cpp index e5f7a434929..57fe1cab1a0 100644 --- a/modules/libjar/zipwriter/src/nsZipWriter.cpp +++ b/modules/libjar/zipwriter/src/nsZipWriter.cpp @@ -301,7 +301,7 @@ NS_IMETHODIMP nsZipWriter::Open(nsIFile *aFile, PRInt32 aIoFlags) return rv; } - rv = NS_NewBufferedOutputStream(getter_AddRefs(mStream), stream, 0x800); + rv = NS_NewBufferedOutputStream(getter_AddRefs(mStream), stream, 3 * 1024 * 1024); if (NS_FAILED(rv)) { stream->Close(); mHeaders.Clear(); @@ -711,6 +711,24 @@ NS_IMETHODIMP nsZipWriter::Close() Cleanup(); return rv; } + + // Go back and rewrite the file headers + for (PRInt32 i = 0; i < mHeaders.Count(); i++) { + nsZipHeader *header = mHeaders[i]; + if (!header->mWriteOnClose) + continue; + + rv = seekable->Seek(nsISeekableStream::NS_SEEK_SET, header->mOffset); + if (NS_FAILED(rv)) { + Cleanup(); + return rv; + } + rv = header->WriteFileHeader(mStream); + if (NS_FAILED(rv)) { + Cleanup(); + return rv; + } + } } nsresult rv = mStream->Close(); From 6b7202a7df1af63efb4ce18eeb6e123502cf1cf4 Mon Sep 17 00:00:00 2001 From: Neil Date: Tue, 14 Sep 2010 15:48:46 -0400 Subject: [PATCH 2/7] Bug 596237 - [SeaMonkey 2.1] TEST-UNEXPECTED-FAIL | chrome://mochikit/content/browser/content/html/document/test/browser_bug592641.js; r=bobbyholley a=NPOTB --- .../html/document/test/browser_bug592641.js | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/content/html/document/test/browser_bug592641.js b/content/html/document/test/browser_bug592641.js index 026cc778e30..4e559d05d5d 100644 --- a/content/html/document/test/browser_bug592641.js +++ b/content/html/document/test/browser_bug592641.js @@ -11,13 +11,7 @@ function test() { ctx.tab1 = gBrowser.addTab(testPath + "bug592641_img.jpg"); ctx.tab1Browser = gBrowser.getBrowserForTab(ctx.tab1); - ctx.tab1Browser.addEventListener("load", - // onload is fired in OnStopDecode, so let's - // use executeSoon() to make sure that any - // other OnStopDecode event handlers get the - // chance to fire first. - function() {executeSoon(load1Done);}, - true); + ctx.tab1Browser.addEventListener("load", load1Soon, true); } function checkTitle(title) { @@ -27,9 +21,14 @@ function checkTitle(title) { "Title should be correct on load #" + ctx.loadsDone); } +function load1Soon() { + ctx.tab1Browser.removeEventListener("load", load1Soon, true); + // onload is fired in OnStopDecode, so let's use executeSoon() to make sure + // that any other OnStopDecode event handlers get the chance to fire first. + executeSoon(load1Done); +} function load1Done() { - // Check the title var title = ctx.tab1Browser.contentWindow.document.title; checkTitle(title); @@ -38,19 +37,17 @@ function load1Done() { // the cached case. ctx.tab2 = gBrowser.addTab(testPath + "bug592641_img.jpg"); ctx.tab2Browser = gBrowser.getBrowserForTab(ctx.tab2); - ctx.tab2Browser.addEventListener("load", - // onload is fired in OnStopDecode, so let's - // use executeSoon() to make sure that any - // other OnStopDecode event handlers get the - // chance to fire first. - function() {executeSoon(load2Done);}, - true); - + ctx.tab2Browser.addEventListener("load", load2Soon, true); +} +function load2Soon() { + ctx.tab2Browser.removeEventListener("load", load2Soon, true); + // onload is fired in OnStopDecode, so let's use executeSoon() to make sure + // that any other OnStopDecode event handlers get the chance to fire first. + executeSoon(load2Done); } function load2Done() { - // Check the title var title = ctx.tab2Browser.contentWindow.document.title; checkTitle(title); From 0f5da2f8acf98c0e18f2f7c8fd585dfb39c9f316 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Tue, 14 Sep 2010 15:50:41 -0400 Subject: [PATCH 3/7] Bug 590404 - Crash [@ nsURIHashKey::HashKey] with -moz-element in data: document; r=roc a=blocking-final+ --- layout/generic/crashtests/590404.html | 1 + layout/generic/crashtests/crashtests.list | 1 + layout/svg/base/src/nsSVGEffects.cpp | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 layout/generic/crashtests/590404.html diff --git a/layout/generic/crashtests/590404.html b/layout/generic/crashtests/590404.html new file mode 100644 index 00000000000..9f6ee8fe93d --- /dev/null +++ b/layout/generic/crashtests/590404.html @@ -0,0 +1 @@ + diff --git a/layout/generic/crashtests/crashtests.list b/layout/generic/crashtests/crashtests.list index 153058ba59a..fa74d23ad4b 100644 --- a/layout/generic/crashtests/crashtests.list +++ b/layout/generic/crashtests/crashtests.list @@ -333,4 +333,5 @@ load 586806-1.html load 586806-2.html load 586806-3.html load 586973-1.html +load 590404.html load 591141.html diff --git a/layout/svg/base/src/nsSVGEffects.cpp b/layout/svg/base/src/nsSVGEffects.cpp index 613969f579d..2b85f4c13fc 100644 --- a/layout/svg/base/src/nsSVGEffects.cpp +++ b/layout/svg/base/src/nsSVGEffects.cpp @@ -392,6 +392,9 @@ GetEffectPropertyForURI(nsIURI *aURI, nsIFrame *aFrame, const FramePropertyDescriptor *aProperty, nsSVGRenderingObserver * (* aCreate)(nsIURI *, nsIFrame *, PRBool)) { + if (!aURI) + return nsnull; + FrameProperties props = aFrame->Properties(); nsSVGEffects::URIObserverHashtable *hashtable = static_cast(props.Get(aProperty)); From 5a868737bae1b0ddc594d1c59ab7f7ec584878ea Mon Sep 17 00:00:00 2001 From: Raymond Lee Date: Sun, 12 Sep 2010 02:58:03 +0800 Subject: [PATCH 4/7] Bug 594909 - Intermittent failure in browser/base/content/test/tabview/browser_tabview_launch.js | Tab View is visible; r=dietrich a=NPOTB --- browser/base/content/test/tabview/browser_tabview_launch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/base/content/test/tabview/browser_tabview_launch.js b/browser/base/content/test/tabview/browser_tabview_launch.js index 8fc13ac9599..cb0429b26aa 100644 --- a/browser/base/content/test/tabview/browser_tabview_launch.js +++ b/browser/base/content/test/tabview/browser_tabview_launch.js @@ -83,5 +83,5 @@ function test() { let button = document.getElementById("tabview-button"); ok(button, "Tab View button exists"); - EventUtils.synthesizeMouse(button, 1, 1, {}); + button.doCommand(); } From ba3de9468d11f4de8d5e5607a2a1b57aff9f26d4 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Tue, 14 Sep 2010 16:20:32 -0400 Subject: [PATCH 5/7] Bug 594617: Make nsImageFrame::GetIntrinsicSize return its actual intrinsic size, and teach IsPercentageAware about SVG images. r=roc a=blocking --- layout/generic/nsImageFrame.cpp | 6 ++++++ layout/generic/nsImageFrame.h | 1 + layout/generic/nsLineLayout.cpp | 1 + layout/reftests/svg/image/img-dyn-1-ref.html | 7 +++++++ layout/reftests/svg/image/img-dyn-1.html | 18 ++++++++++++++++++ layout/reftests/svg/image/reftest.list | 2 ++ .../svg/image/squaredCircle-viewBox-noSize.svg | 5 +++++ 7 files changed, 40 insertions(+) create mode 100644 layout/reftests/svg/image/img-dyn-1-ref.html create mode 100644 layout/reftests/svg/image/img-dyn-1.html create mode 100644 layout/reftests/svg/image/squaredCircle-viewBox-noSize.svg diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index 90ceecbcdde..aee3598970b 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -775,6 +775,12 @@ nsImageFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext) mIntrinsicSize.width.GetCoordValue() : 0; } +/* virtual */ nsIFrame::IntrinsicSize +nsImageFrame::GetIntrinsicSize() +{ + return mIntrinsicSize; +} + /* virtual */ nsSize nsImageFrame::GetIntrinsicRatio() { diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index ee01b007a1e..309f253532b 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -109,6 +109,7 @@ public: const nsDisplayListSet& aLists); virtual nscoord GetMinWidth(nsIRenderingContext *aRenderingContext); virtual nscoord GetPrefWidth(nsIRenderingContext *aRenderingContext); + virtual IntrinsicSize GetIntrinsicSize(); virtual nsSize GetIntrinsicRatio(); NS_IMETHOD Reflow(nsPresContext* aPresContext, nsHTMLReflowMetrics& aDesiredSize, diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 8e75084f0e3..33a36870d71 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -707,6 +707,7 @@ IsPercentageAware(const nsIFrame* aFrame) if (( #ifdef MOZ_SVG fType == nsGkAtoms::svgOuterSVGFrame || + fType == nsGkAtoms::imageFrame || #endif fType == nsGkAtoms::subDocumentFrame) && const_cast(aFrame)->GetIntrinsicSize().width.GetUnit() == diff --git a/layout/reftests/svg/image/img-dyn-1-ref.html b/layout/reftests/svg/image/img-dyn-1-ref.html new file mode 100644 index 00000000000..cb9f2635bdf --- /dev/null +++ b/layout/reftests/svg/image/img-dyn-1-ref.html @@ -0,0 +1,7 @@ + + +
+ +
+ + diff --git a/layout/reftests/svg/image/img-dyn-1.html b/layout/reftests/svg/image/img-dyn-1.html new file mode 100644 index 00000000000..9be86ff57b7 --- /dev/null +++ b/layout/reftests/svg/image/img-dyn-1.html @@ -0,0 +1,18 @@ + + + + + + +
+ +
+ + diff --git a/layout/reftests/svg/image/reftest.list b/layout/reftests/svg/image/reftest.list index 74bd2fa20d1..184a27175cf 100644 --- a/layout/reftests/svg/image/reftest.list +++ b/layout/reftests/svg/image/reftest.list @@ -28,7 +28,9 @@ include zoom/reftest.list == img-simple-6.html lime100x100-ref.html == img-simple-7.html lime100x100-ref.html +# More complex tests == img-content-outside-viewBox-1.html img-content-outside-viewBox-1-ref.html +== img-dyn-1.html img-dyn-1-ref.html # XXXdholbert Some of the tests below fail on Windows 7 right now. Marking them # random-on-windows right now while I investigate. diff --git a/layout/reftests/svg/image/squaredCircle-viewBox-noSize.svg b/layout/reftests/svg/image/squaredCircle-viewBox-noSize.svg new file mode 100644 index 00000000000..c0665d15d61 --- /dev/null +++ b/layout/reftests/svg/image/squaredCircle-viewBox-noSize.svg @@ -0,0 +1,5 @@ + + + + From e8dbfdc89353b9189ba750b0ea13215ddc5e9ce2 Mon Sep 17 00:00:00 2001 From: Alex Pakhotin Date: Tue, 14 Sep 2010 16:38:28 -0400 Subject: [PATCH 6/7] temporarily disable updater tests on android r=blassey a=bustage-fix --- toolkit/mozapps/update/Makefile.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolkit/mozapps/update/Makefile.in b/toolkit/mozapps/update/Makefile.in index 65c0079605a..c8515da4dd8 100644 --- a/toolkit/mozapps/update/Makefile.in +++ b/toolkit/mozapps/update/Makefile.in @@ -49,10 +49,10 @@ XPIDLSRCS = nsIUpdateTimerManager.idl EXTRA_PP_COMPONENTS = nsUpdateTimerManager.js nsUpdateTimerManager.manifest ifdef MOZ_UPDATER +DIRS = ../readstrings + ifneq ($(OS_TARGET),Android) -DIRS = ../readstrings \ - updater \ - $(NULL) +DIRS += updater endif XPIDLSRCS += nsIUpdateService.idl From 609077d1d7604a84cf18c4293083adae4bb2388d Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Tue, 14 Sep 2010 14:05:00 -0700 Subject: [PATCH 7/7] Bug 596328 - "non-IPC builds burning with nsContentPermissionHelper" r=benjamin a=benjamin --- dom/base/Makefile.in | 11 +++++++++-- dom/base/nsContentPermissionHelper.cpp | 3 --- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/dom/base/Makefile.in b/dom/base/Makefile.in index 01e5786f968..0b5b19c459c 100644 --- a/dom/base/Makefile.in +++ b/dom/base/Makefile.in @@ -78,7 +78,6 @@ EXPORTS = \ nsPIWindowRoot.h \ nsFocusManager.h \ nsWrapperCache.h \ - nsContentPermissionHelper.h \ $(NULL) CPPSRCS = \ @@ -102,9 +101,17 @@ CPPSRCS = \ nsScriptNameSpaceManager.cpp \ nsDOMScriptObjectFactory.cpp \ nsQueryContentEventResult.cpp \ - nsContentPermissionHelper.cpp \ $(NULL) +ifdef MOZ_IPC +EXPORTS += \ + nsContentPermissionHelper.h \ + $(NULL) +CPPSRCS += \ + nsContentPermissionHelper.cpp \ + $(NULL) +endif + include $(topsrcdir)/dom/dom-config.mk ifdef MOZ_JSDEBUGGER diff --git a/dom/base/nsContentPermissionHelper.cpp b/dom/base/nsContentPermissionHelper.cpp index 37c29252050..1e976745045 100644 --- a/dom/base/nsContentPermissionHelper.cpp +++ b/dom/base/nsContentPermissionHelper.cpp @@ -43,8 +43,6 @@ #include "mozilla/unused.h" -#ifdef MOZ_IPC - using mozilla::unused; // nsContentPermissionRequestProxy::nsContentPermissionRequestProxy() @@ -164,4 +162,3 @@ ContentPermissionRequestParent::Recvprompt() } // namespace dom } // namespace mozilla -#endif