From 7ff417be87e834074185cf92bc964c3eae2382f9 Mon Sep 17 00:00:00 2001 From: Ben Hearsum Date: Mon, 11 Jun 2012 11:10:05 -0400 Subject: [PATCH 01/13] bug 758644: Contents/CodeResources isn't included in MARs. r=ted --- toolkit/mozapps/installer/packager.mk | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk index 66c03170e0cc..8de6c59cd516 100644 --- a/toolkit/mozapps/installer/packager.mk +++ b/toolkit/mozapps/installer/packager.mk @@ -559,7 +559,10 @@ endif ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD ifeq (Darwin, $(OS_ARCH)) MAKE_PACKAGE = $(PREPARE_PACKAGE) \ - && cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) && cd $(PACKAGE_BASE_DIR) \ + && cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) \ + && rm $(MOZ_MACBUNDLE_NAME)/Contents/CodeResources \ + && cp $(MOZ_MACBUNDLE_NAME)/Contents/_CodeSignature/CodeResources $(MOZ_MACBUNDLE_NAME)/Contents \ + && cd $(PACKAGE_BASE_DIR) \ && $(INNER_MAKE_PACKAGE) else MAKE_PACKAGE = $(PREPARE_PACKAGE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \ @@ -773,11 +776,6 @@ endif $(call PACKAGER_COPY, "$(call core_abspath,$(DIST))",\ "$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \ "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1) -ifeq (DMG, $(MOZ_PKG_FORMAT)) -ifeq (dmg, $(filter dmg, $(MOZ_INTERNAL_SIGNING_FORMAT))) - @cd $(DIST)/$(_APPNAME)/Contents && ln -sf _CodeSignature/CodeResources CodeResources -endif -endif $(PERL) $(MOZILLA_DIR)/toolkit/mozapps/installer/xptlink.pl -s $(DIST) -d $(DIST)/xpt -f $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components -v -x "$(XPIDL_LINK)" $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/link-manifests.py \ $(DIST)/$(MOZ_PKG_DIR)/$(_BINPATH)/components/components.manifest \ From e7afcda3d03bb5950045cba1504041e91aff631b Mon Sep 17 00:00:00 2001 From: Ben Hearsum Date: Mon, 11 Jun 2012 11:10:32 -0400 Subject: [PATCH 02/13] bug 758595: don't include CodeResources file in builds that aren't getting signed. r=ted --- browser/installer/package-manifest.in | 2 ++ configure.in | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/browser/installer/package-manifest.in b/browser/installer/package-manifest.in index d5761159b223..220341c874fc 100644 --- a/browser/installer/package-manifest.in +++ b/browser/installer/package-manifest.in @@ -24,8 +24,10 @@ @APPNAME@/Contents/Info.plist @APPNAME@/Contents/PkgInfo @APPNAME@/Contents/Resources/ +#ifdef MOZ_SIGNING @APPNAME@/Contents/_CodeSignature/CodeResources #endif +#endif [@AB_CD@] @BINPATH@/chrome/@AB_CD@@JAREXT@ diff --git a/configure.in b/configure.in index 57615403fce9..cd778afd90fb 100644 --- a/configure.in +++ b/configure.in @@ -6417,6 +6417,14 @@ AC_CHECK_PROGS(WGET, wget, "") AC_MSG_RESULT([$WGET]) AC_SUBST(WGET) +dnl ======================================================== +dnl Signing +dnl ======================================================== + +if test -n "$MOZ_SIGN_CMD"; then + AC_DEFINE(MOZ_SIGNING) +fi + dnl ======================================================== dnl Maintenance Service dnl ======================================================== From 6ccd164ce3f9acd04b3eeaaf18476d7c84712422 Mon Sep 17 00:00:00 2001 From: Ben Hearsum Date: Mon, 11 Jun 2012 11:10:55 -0400 Subject: [PATCH 03/13] bug 759318: stop excluding distribution/, extensions/, and mozilla.cfg from OS X signature. r=ted --- .../Contents/_CodeSignature/CodeResources | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/browser/app/macbuild/Contents/_CodeSignature/CodeResources b/browser/app/macbuild/Contents/_CodeSignature/CodeResources index ce1353def53a..62261796dd69 100644 --- a/browser/app/macbuild/Contents/_CodeSignature/CodeResources +++ b/browser/app/macbuild/Contents/_CodeSignature/CodeResources @@ -12,18 +12,6 @@ ^Resources/ - ^MacOS/extensions/.* - omit - - weight - 10 - - ^MacOS/distribution/.* - omit - - weight - 10 - ^MacOS/updates/.* omit @@ -42,12 +30,6 @@ weight 10 - ^MacOS/mozilla.cfg$ - omit - - weight - 10 - ^MacOS/removed-files$ omit From 1dae5db5a16f082c728e1185452f94ec5ba32109 Mon Sep 17 00:00:00 2001 From: Gervase Markham Date: Mon, 11 Jun 2012 16:38:26 +0100 Subject: [PATCH 04/13] Bug 759095 - remove licensing-related query now issue has been resolved. --- .../chrome/common/process_watcher_posix_sigchld.cc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc index bdbf80453108..ab88aafb7f99 100644 --- a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc +++ b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc @@ -5,17 +5,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -//----------------------------------------------------------------------------- -// XXXXXXXXXXXXXXXX -// -// How is this code supposed to be licensed? I don't /think/ that -// this code is doing anything different than, say, -// GeckoChildProcess.h/cpp, so I /think/ this gets a MoFo copyright -// and license. Yes? -// -// XXXXXXXXXXXXXXXX -//----------------------------------------------------------------------------- - #include #include #include From 0667a61321ebb971317bfc95ab12a64435e5bba8 Mon Sep 17 00:00:00 2001 From: Malini Das Date: Mon, 11 Jun 2012 11:19:43 -0700 Subject: [PATCH 05/13] Bug 744902 - Update datazilla method names, a=test-only, DONTBUILD because NPOTB --- testing/marionette/client/marionette/runtests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testing/marionette/client/marionette/runtests.py b/testing/marionette/client/marionette/runtests.py index a99c1a3d2e39..a7e9d612a0be 100644 --- a/testing/marionette/client/marionette/runtests.py +++ b/testing/marionette/client/marionette/runtests.py @@ -71,7 +71,7 @@ class MarionetteTestResult(unittest._TextTestResult): for testcase in test._tests: if testcase.perfdata: if not self.perfdata: - self.perfdata = datazilla.dzResult(testcase.perfdata) + self.perfdata = datazilla.DatazillaResult(testcase.perfdata) else: self.perfdata.join_results(testcase.perfdata) @@ -339,7 +339,7 @@ class MarionetteTestRunner(object): self.logger.info("Using machine_name: %s" % machine_name) os_name = platform.system() os_version = platform.release() - self.perfrequest = datazilla.dzRequest(server=options.perfserv, machine_name=machine_name, os=os_name, os_version=os_version, + self.perfrequest = datazilla.DatazillaRequest(server=options.perfserv, machine_name=machine_name, os=os_name, os_version=os_version, platform=manifest.get("platform")[0], build_name=manifest.get("build_name")[0], version=manifest.get("version")[0], revision=self.revision, branch=manifest.get("branch")[0], id=os.getenv('BUILD_ID'), test_date=int(time.time())) @@ -370,7 +370,7 @@ class MarionetteTestRunner(object): results = MarionetteTextTestRunner(verbosity=3).run(suite) self.failed += len(results.failures) + len(results.errors) if results.perfdata: - self.perfrequest.add_dzresult(results.perfdata) + self.perfrequest.add_datazilla_result(results.perfdata) if hasattr(results, 'skipped'): self.todo += len(results.skipped) + len(results.expectedFailures) self.passed += results.passed From c8d931afa8cec7c968db66a3874a747ba1972b98 Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Mon, 11 Jun 2012 13:04:34 -0700 Subject: [PATCH 06/13] Bug 763573: Don't export PrimitiveConversions.h. r=bz --- dom/bindings/Codegen.py | 2 +- dom/bindings/Makefile.in | 1 - dom/bindings/PrimitiveConversions.h | 2 ++ dom/bindings/test/Makefile.in | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 6a898583bc3a..56e185352c92 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -3461,7 +3461,7 @@ class CGBindingRoot(CGThing): ['mozilla/dom/BindingUtils.h', 'mozilla/dom/DOMJSClass.h'], ['mozilla/dom/Nullable.h', - 'mozilla/dom/PrimitiveConversions.h', + 'PrimitiveConversions.h', 'XPCQuickStubs.h', 'nsDOMQS.h', 'AccessCheck.h', diff --git a/dom/bindings/Makefile.in b/dom/bindings/Makefile.in index 2d386d3deef9..052c6e6b6192 100644 --- a/dom/bindings/Makefile.in +++ b/dom/bindings/Makefile.in @@ -64,7 +64,6 @@ EXPORTS_$(binding_include_path) = \ PrototypeList.h \ RegisterBindings.h \ Nullable.h \ - PrimitiveConversions.h \ TypedArray.h \ BindingUtils.h \ $(exported_binding_headers) \ diff --git a/dom/bindings/PrimitiveConversions.h b/dom/bindings/PrimitiveConversions.h index c05cb9d9ded9..4e944563062c 100644 --- a/dom/bindings/PrimitiveConversions.h +++ b/dom/bindings/PrimitiveConversions.h @@ -11,6 +11,8 @@ #ifndef mozilla_dom_PrimitiveConversions_h #define mozilla_dom_PrimitiveConversions_h +#include "xpcpublic.h" + namespace mozilla { namespace dom { diff --git a/dom/bindings/test/Makefile.in b/dom/bindings/test/Makefile.in index 9a1325c1011f..76e64233a658 100644 --- a/dom/bindings/test/Makefile.in +++ b/dom/bindings/test/Makefile.in @@ -31,6 +31,7 @@ CPPSRCS := $(subst .webidl,Binding.cpp,$(test_webidl_files)) LOCAL_INCLUDES += \ -I$(topsrcdir)/js/xpconnect/src \ -I$(topsrcdir)/js/xpconnect/wrappers \ + -I$(topsrcdir)/dom/bindings \ $(NULL) include $(topsrcdir)/config/rules.mk From d80b2ddb63cd3f051502d621f7672f95354f2d5d Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Mon, 11 Jun 2012 16:06:07 -0400 Subject: [PATCH 07/13] Bug 754575 - Cache.Trash* files fill up disk space r=blassey r=jduell --- embedding/android/GeckoAppShell.java | 4 +++ mobile/android/base/GeckoAppShell.java | 4 +++ netwerk/cache/nsDeleteDir.cpp | 38 +++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/embedding/android/GeckoAppShell.java b/embedding/android/GeckoAppShell.java index ba614cc32d00..7b9002cb1953 100644 --- a/embedding/android/GeckoAppShell.java +++ b/embedding/android/GeckoAppShell.java @@ -331,6 +331,10 @@ public class GeckoAppShell File cacheFile = getCacheDir(); GeckoAppShell.putenv("MOZ_LINKER_CACHE=" + cacheFile.getPath()); + // setup the app-specific cache path + f = geckoApp.getCacheDir(); + GeckoAppShell.putenv("CACHE_DIRECTORY=" + f.getPath()); + // gingerbread introduces File.getUsableSpace(). We should use that. long freeSpace = getFreeSpace(); try { diff --git a/mobile/android/base/GeckoAppShell.java b/mobile/android/base/GeckoAppShell.java index 509348dc1430..08cf09891baa 100644 --- a/mobile/android/base/GeckoAppShell.java +++ b/mobile/android/base/GeckoAppShell.java @@ -386,6 +386,10 @@ public class GeckoAppShell // Enable fixed position layers GeckoAppShell.putenv("MOZ_ENABLE_FIXED_POSITION_LAYERS=1"); + // setup the app-specific cache path + f = context.getCacheDir(); + GeckoAppShell.putenv("CACHE_DIRECTORY=" + f.getPath()); + putLocaleEnv(); } diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp index f516d2259ed9..564db485cd1b 100644 --- a/netwerk/cache/nsDeleteDir.cpp +++ b/netwerk/cache/nsDeleteDir.cpp @@ -215,9 +215,6 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, PRUint32 delay) if (NS_FAILED(rv)) return rv; - // Important: must rename directory w/o changing parent directory: else on - // NTFS we'll wait (with cache lock) while nsIFile's ACL reset walks file - // tree: was hanging GUI for *minutes* on large cache dirs. // Append random number to the trash directory and check if it exists. srand(PR_Now()); nsCAutoString leaf; @@ -240,7 +237,18 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, PRUint32 delay) if (!leaf.Length()) return NS_ERROR_FAILURE; +#if defined(MOZ_WIDGET_ANDROID) + nsCOMPtr parent; + rv = trash->GetParent(getter_AddRefs(parent)); + if (NS_FAILED(rv)) + return rv; + rv = dir->MoveToNative(parent, leaf); +#else + // Important: must rename directory w/o changing parent directory: else on + // NTFS we'll wait (with cache lock) while nsIFile's ACL reset walks file + // tree: was hanging GUI for *minutes* on large cache dirs. rv = dir->MoveToNative(nsnull, leaf); +#endif if (NS_FAILED(rv)) return rv; } else { @@ -262,7 +270,25 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, PRUint32 delay) nsresult nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr *result) { - nsresult rv = target->Clone(getter_AddRefs(*result)); + nsresult rv; +#if defined(MOZ_WIDGET_ANDROID) + // Try to use the app cache folder for cache trash on Android + char* cachePath = getenv("CACHE_DIRECTORY"); + if (cachePath) { + rv = NS_NewNativeLocalFile(nsDependentCString(cachePath), + true, getter_AddRefs(*result)); + if (NS_FAILED(rv)) + return rv; + + // Add a sub folder with the cache folder name + nsCAutoString leaf; + rv = target->GetNativeLeafName(leaf); + (*result)->AppendNative(leaf); + } else +#endif + { + rv = target->Clone(getter_AddRefs(*result)); + } if (NS_FAILED(rv)) return rv; @@ -301,7 +327,11 @@ nsDeleteDir::RemoveOldTrashes(nsIFile *cacheDir) return rv; nsCOMPtr parent; +#if defined(MOZ_WIDGET_ANDROID) + rv = trash->GetParent(getter_AddRefs(parent)); +#else rv = cacheDir->GetParent(getter_AddRefs(parent)); +#endif if (NS_FAILED(rv)) return rv; From 41b3a3b4eabc8d18759fc4397635b83182f70d08 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Mon, 11 Jun 2012 13:57:35 -0700 Subject: [PATCH 08/13] Do the necessary reflow when our font inflation data changes. (Bug 759755, patch 2) r=roc/bzbarsky --- layout/generic/nsFontInflationData.cpp | 14 ++++- layout/generic/nsFontInflationData.h | 4 +- layout/generic/nsHTMLReflowState.cpp | 77 +++++++++++++++----------- 3 files changed, 60 insertions(+), 35 deletions(-) diff --git a/layout/generic/nsFontInflationData.cpp b/layout/generic/nsFontInflationData.cpp index 58ee4c14660a..2b63fdd37583 100644 --- a/layout/generic/nsFontInflationData.cpp +++ b/layout/generic/nsFontInflationData.cpp @@ -38,7 +38,7 @@ nsFontInflationData::FindFontInflationDataFor(const nsIFrame *aFrame) bfc->Properties().Get(FontInflationDataProperty())); } -/* static */ void +/* static */ bool nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState) { nsIFrame *bfc = aReflowState.frame; @@ -47,12 +47,22 @@ nsFontInflationData::UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aR FrameProperties bfcProps(bfc->Properties()); nsFontInflationData *data = static_cast( bfcProps.Get(FontInflationDataProperty())); - if (!data) { + bool oldInflationEnabled; + nscoord oldNCAWidth; + if (data) { + oldNCAWidth = data->mNCAWidth; + oldInflationEnabled = data->mInflationEnabled; + } else { data = new nsFontInflationData(bfc); bfcProps.Set(FontInflationDataProperty(), data); + oldNCAWidth = -1; + oldInflationEnabled = true; /* not relevant */ } data->UpdateWidth(aReflowState); + + return oldNCAWidth != data->mNCAWidth || + oldInflationEnabled != data->mInflationEnabled; } /* static */ void diff --git a/layout/generic/nsFontInflationData.h b/layout/generic/nsFontInflationData.h index 7e89a369ccb1..b7378d93da92 100644 --- a/layout/generic/nsFontInflationData.h +++ b/layout/generic/nsFontInflationData.h @@ -20,7 +20,9 @@ public: static nsFontInflationData* FindFontInflationDataFor(const nsIFrame *aFrame); - static void + // Returns whether the effective width changed (which requires the + // caller to mark its descendants dirty + static bool UpdateFontInflationDataWidthFor(const nsHTMLReflowState& aReflowState); static void MarkFontInflationDataTextDirty(nsIFrame *aFrame); diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index d6f2c7615c41..ec8ed32904a2 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -308,12 +308,6 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext, "have unconstrained width; this should only result from " "very large sizes, not attempts at intrinsic width " "calculation"); - - if (frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) { - // Create our font inflation data if we don't have it already, and - // give it our current width information. - nsFontInflationData::UpdateFontInflationDataWidthFor(*this); - } } void nsHTMLReflowState::InitCBReflowState() @@ -367,35 +361,54 @@ IsQuirkContainingBlockHeight(const nsHTMLReflowState* rs, nsIAtom* aFrameType) void nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameType) { - mFlags.mHResize = !(frame->GetStateBits() & NS_FRAME_IS_DIRTY) && - frame->GetSize().width != - mComputedWidth + mComputedBorderPadding.LeftRight(); - if (mFlags.mHResize && - nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) { - // When font size inflation is enabled, the change in the width of a - // block (or anything that returns true in - // IsContainerForFontSizeInflation) needs to cause a dirty reflow - // since it changes the size of text, line-heights, etc. This is - // relatively similar to a classic case of style change reflow, - // except that because inflation doesn't affect the intrinsic sizing - // codepath, there's no need to invalidate intrinsic sizes. - // - // Note that this makes horizontal resizing a good bit more - // expensive. However, font size inflation is targeted at a set of - // devices (zoom-and-pan devices) where the main use case for - // horizontal resizing needing to be efficient (window resizing) is - // not present. It does still increase the cost of dynamic changes - // caused by script where a style or content change in one place - // causes a resize in another (e.g., rebalancing a table). + bool isHResize = frame->GetSize().width != + mComputedWidth + mComputedBorderPadding.LeftRight(); - // FIXME: This isn't so great for the cases where - // nsHTMLReflowState::SetComputedWith is called, if the first time - // we go through InitResizeFlags we set mHResize to true, and then - // the second time we'd set it to false even without the - // NS_FRAME_IS_DIRTY bit already set. - frame->AddStateBits(NS_FRAME_IS_DIRTY); + if ((frame->GetStateBits() & NS_FRAME_FONT_INFLATION_FLOW_ROOT) && + nsLayoutUtils::FontSizeInflationEnabled(aPresContext)) { + // Create our font inflation data if we don't have it already, and + // give it our current width information. + bool dirty = nsFontInflationData::UpdateFontInflationDataWidthFor(*this); + if (dirty || (!frame->GetParent() && isHResize)) { + // When font size inflation is enabled, a change in either: + // * the effective width of a font inflation flow root + // * the width of the frame + // needs to cause a dirty reflow since they change the font size + // inflation calculations, which in turn change the size of text, + // line-heights, etc. This is relatively similar to a classic + // case of style change reflow, except that because inflation + // doesn't affect the intrinsic sizing codepath, there's no need + // to invalidate intrinsic sizes. + // + // Note that this makes horizontal resizing a good bit more + // expensive. However, font size inflation is targeted at a set of + // devices (zoom-and-pan devices) where the main use case for + // horizontal resizing needing to be efficient (window resizing) is + // not present. It does still increase the cost of dynamic changes + // caused by script where a style or content change in one place + // causes a resize in another (e.g., rebalancing a table). + + // FIXME: This isn't so great for the cases where + // nsHTMLReflowState::SetComputedWidth is called, if the first time + // we go through InitResizeFlags we set mHResize to true, and then + // the second time we'd set it to false even without the + // NS_FRAME_IS_DIRTY bit already set. + if (frame->GetType() == nsGkAtoms::svgForeignObjectFrame) { + // Foreign object frames use dirty bits in a special way. + frame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN); + nsIFrame *kid = frame->GetFirstPrincipalChild(); + if (kid) { + kid->AddStateBits(NS_FRAME_IS_DIRTY); + } + } else { + frame->AddStateBits(NS_FRAME_IS_DIRTY); + } + } } + mFlags.mHResize = !(frame->GetStateBits() & NS_FRAME_IS_DIRTY) && + isHResize; + // XXX Should we really need to null check mCBReflowState? (We do for // at least nsBoxFrame). if (IS_TABLE_CELL(aFrameType) && From c11c707fffe9e90a2f5c234a6a7457daccc9ca35 Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Mon, 11 Jun 2012 13:57:35 -0700 Subject: [PATCH 09/13] Properly dirty intrinsic widths when doing things that change inflation. (Bug 759755, patch 3) r=roc --- dom/base/nsDOMWindowUtils.cpp | 3 ++- layout/base/nsPresShell.cpp | 2 ++ layout/generic/nsHTMLReflowState.cpp | 38 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index 8ff971064204..c9b9dd61aafb 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -282,7 +282,8 @@ MaybeReflowForInflationScreenWidthChange(nsPresContext *aPresContext) if (shell) { nsIFrame *rootFrame = shell->GetRootFrame(); if (rootFrame) { - shell->FrameNeedsReflow(rootFrame, nsIPresShell::eResize, + shell->FrameNeedsReflow(rootFrame, + nsIPresShell::eStyleChange, NS_FRAME_IS_DIRTY); } } diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 34ad2f262119..cfe911b68784 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -2516,6 +2516,8 @@ PresShell::FrameNeedsReflow(nsIFrame *aFrame, IntrinsicDirty aIntrinsicDirty, if (aIntrinsicDirty == eStyleChange) { // Mark all descendants dirty (using an nsTArray stack rather than // recursion). + // Note that nsHTMLReflowState::InitResizeFlags has some similar + // code; see comments there for how and why it differs. nsAutoTArray stack; stack.AppendElement(subtreeRoot); diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index ec8ed32904a2..956a63113917 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -403,6 +403,44 @@ nsHTMLReflowState::InitResizeFlags(nsPresContext* aPresContext, nsIAtom* aFrameT } else { frame->AddStateBits(NS_FRAME_IS_DIRTY); } + + // Mark intrinsic widths on all descendants dirty. We need to do + // this (1) since we're changing the size of text and need to + // clear text runs on text frames and (2) since we actually are + // changing some intrinsic widths, but only those that live inside + // of containers. + + // It makes sense to do this for descendants but not ancestors + // (which is unusual) because we're only changing the unusual + // inflation-dependent intrinsic widths (i.e., ones computed with + // nsPresContext::mInflationDisabledForShrinkWrap set to false), + // which should never affect anything outside of their inflation + // flow root (or, for that matter, even their inflation + // container). + + // This is also different from what PresShell::FrameNeedsReflow + // does because it doesn't go through placeholders. It doesn't + // need to because we're actually doing something that cares about + // frame tree geometry (the width on an ancestor) rather than + // style. + + nsAutoTArray stack; + stack.AppendElement(frame); + + do { + nsIFrame *f = stack.ElementAt(stack.Length() - 1); + stack.RemoveElementAt(stack.Length() - 1); + + nsIFrame::ChildListIterator lists(f); + for (; !lists.IsDone(); lists.Next()) { + nsFrameList::Enumerator childFrames(lists.CurrentList()); + for (; !childFrames.AtEnd(); childFrames.Next()) { + nsIFrame* kid = childFrames.get(); + kid->MarkIntrinsicWidthsDirty(); + stack.AppendElement(kid); + } + } + } while (stack.Length() != 0); } } From b7a47d1ba2f196e77ba88bdf6a40e78152118aeb Mon Sep 17 00:00:00 2001 From: James Willcox Date: Mon, 11 Jun 2012 13:50:59 -0400 Subject: [PATCH 10/13] Bug 762407 - Avoid deadlock when exiting fullscreen Flash videos on Android r=blassey --- dom/plugins/base/nsPluginInstanceOwner.cpp | 106 +++++++++++---------- dom/plugins/base/nsPluginInstanceOwner.h | 1 + mobile/android/base/GeckoApp.java | 5 +- 3 files changed, 61 insertions(+), 51 deletions(-) diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp index e7bf0f7a167f..ef8c5de34ed8 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.cpp +++ b/dom/plugins/base/nsPluginInstanceOwner.cpp @@ -1710,6 +1710,56 @@ void nsPluginInstanceOwner::ScrollPositionDidChange(nscoord aX, nscoord aY) #ifdef MOZ_WIDGET_ANDROID +// Modified version of nsFrame::GetOffsetToCrossDoc that stops when it +// hits an element with a displayport (or runs out of frames). This is +// not really the right thing to do, but it's better than what was here before. +static nsPoint +GetOffsetRootContent(nsIFrame* aFrame) +{ + // offset will hold the final offset + // docOffset holds the currently accumulated offset at the current APD, it + // will be converted and added to offset when the current APD changes. + nsPoint offset(0, 0), docOffset(0, 0); + const nsIFrame* f = aFrame; + PRInt32 currAPD = aFrame->PresContext()->AppUnitsPerDevPixel(); + PRInt32 apd = currAPD; + nsRect displayPort; + while (f) { + if (f->GetContent() && nsLayoutUtils::GetDisplayPort(f->GetContent(), &displayPort)) + break; + + docOffset += f->GetPosition(); + nsIFrame* parent = f->GetParent(); + if (parent) { + f = parent; + } else { + nsPoint newOffset(0, 0); + f = nsLayoutUtils::GetCrossDocParentFrame(f, &newOffset); + PRInt32 newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0; + if (!f || newAPD != currAPD) { + // Convert docOffset to the right APD and add it to offset. + offset += docOffset.ConvertAppUnits(currAPD, apd); + docOffset.x = docOffset.y = 0; + } + currAPD = newAPD; + docOffset += newOffset; + } + } + + offset += docOffset.ConvertAppUnits(currAPD, apd); + + return offset; +} + +gfxRect nsPluginInstanceOwner::GetPluginRect() +{ + // Get the offset of the content relative to the page + nsRect bounds = mObjectFrame->GetContentRectRelativeToSelf() + GetOffsetRootContent(mObjectFrame); + nsIntRect intBounds = bounds.ToNearestPixels(mObjectFrame->PresContext()->AppUnitsPerDevPixel()); + + return gfxRect(intBounds); +} + void nsPluginInstanceOwner::SendSize(int width, int height) { if (!mInstance) @@ -1797,12 +1847,16 @@ void nsPluginInstanceOwner::ExitFullScreen() { PRInt32 model = mInstance->GetANPDrawingModel(); if (model == kSurface_ANPDrawingModel) { - // We need to invalidate the plugin rect so Paint() gets called above. - // This will cause the view to be re-added. Gross. - Invalidate(); + // We need to do this immediately, otherwise Flash + // sometimes causes a deadlock (bug 762407) + AddPluginView(GetPluginRect()); } mInstance->NotifyFullScreen(mFullScreen); + + // This will cause Paint() to be called, which is where + // we normally add/update views and layers + Invalidate(); } void nsPluginInstanceOwner::ExitFullScreen(jobject view) { @@ -2848,47 +2902,6 @@ void nsPluginInstanceOwner::Paint(const nsRect& aDirtyRect, HPS aHPS) #ifdef MOZ_WIDGET_ANDROID -// Modified version of nsFrame::GetOffsetToCrossDoc that stops when it -// hits an element with a displayport (or runs out of frames). This is -// not really the right thing to do, but it's better than what was here before. -static nsPoint -GetOffsetRootContent(nsIFrame* aFrame) -{ - // offset will hold the final offset - // docOffset holds the currently accumulated offset at the current APD, it - // will be converted and added to offset when the current APD changes. - nsPoint offset(0, 0), docOffset(0, 0); - const nsIFrame* f = aFrame; - PRInt32 currAPD = aFrame->PresContext()->AppUnitsPerDevPixel(); - PRInt32 apd = currAPD; - nsRect displayPort; - while (f) { - if (f->GetContent() && nsLayoutUtils::GetDisplayPort(f->GetContent(), &displayPort)) - break; - - docOffset += f->GetPosition(); - nsIFrame* parent = f->GetParent(); - if (parent) { - f = parent; - } else { - nsPoint newOffset(0, 0); - f = nsLayoutUtils::GetCrossDocParentFrame(f, &newOffset); - PRInt32 newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0; - if (!f || newAPD != currAPD) { - // Convert docOffset to the right APD and add it to offset. - offset += docOffset.ConvertAppUnits(currAPD, apd); - docOffset.x = docOffset.y = 0; - } - currAPD = newAPD; - docOffset += newOffset; - } - } - - offset += docOffset.ConvertAppUnits(currAPD, apd); - - return offset; -} - void nsPluginInstanceOwner::Paint(gfxContext* aContext, const gfxRect& aFrameRect, const gfxRect& aDirtyRect) @@ -2898,10 +2911,7 @@ void nsPluginInstanceOwner::Paint(gfxContext* aContext, PRInt32 model = mInstance->GetANPDrawingModel(); - // Get the offset of the content relative to the page - nsRect bounds = mObjectFrame->GetContentRectRelativeToSelf() + GetOffsetRootContent(mObjectFrame); - nsIntRect intBounds = bounds.ToNearestPixels(mObjectFrame->PresContext()->AppUnitsPerDevPixel()); - gfxRect pluginRect(intBounds); + gfxRect pluginRect = GetPluginRect(); if (model == kSurface_ANPDrawingModel) { if (!AddPluginView(pluginRect)) { diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h index 4c6dfbc084a4..61adb09e887d 100644 --- a/dom/plugins/base/nsPluginInstanceOwner.h +++ b/dom/plugins/base/nsPluginInstanceOwner.h @@ -299,6 +299,7 @@ private: #ifdef MOZ_WIDGET_ANDROID void SendSize(int width, int height); + gfxRect GetPluginRect(); bool AddPluginView(const gfxRect& aRect = gfxRect(0, 0, 0, 0)); void RemovePluginView(); diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 3c26325ae0dc..9db4d4aa27da 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -1673,8 +1673,6 @@ abstract public class GeckoApp return; } - GeckoAppShell.onFullScreenPluginHidden(view); - mFullScreenPluginContainer.removeView(mFullScreenPluginView); // We need do do this on the next iteration in order to avoid @@ -2920,7 +2918,8 @@ abstract public class GeckoApp } if (mFullScreenPluginView != null) { - removePluginView(mFullScreenPluginView, true); + GeckoAppShell.onFullScreenPluginHidden(mFullScreenPluginView); + removeFullScreenPluginView(mFullScreenPluginView); return; } From 060c429d2b49a0ae83c0e3bac77b6e6c905ebc06 Mon Sep 17 00:00:00 2001 From: Kevin Brosnan Date: Mon, 11 Jun 2012 18:44:45 -0700 Subject: [PATCH 11/13] Bug 736602 - Increase dom.min_background_timeout_value to 15 minutes for mobile r=mfinkle a=akeybl --- mobile/android/app/mobile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mobile/android/app/mobile.js b/mobile/android/app/mobile.js index 1c83a4ac8cd1..c06510a60dee 100644 --- a/mobile/android/app/mobile.js +++ b/mobile/android/app/mobile.js @@ -719,3 +719,6 @@ pref("accessibility.accessfu.activate", 2); // Mobile manages state by autodetection pref("network.manage-offline-status", true); + +// increase the timeout clamp for background tabs to 15 minutes +pref("dom.min_background_timeout_value", 900000); From d29e5af0791f6586cbeb081bad5e31ea7af4800a Mon Sep 17 00:00:00 2001 From: Brad Lassey Date: Mon, 11 Jun 2012 22:15:55 -0700 Subject: [PATCH 12/13] bug 736602 - Change inactive tab timer clamp setting to something higher than 1hz r=mfinkle --- build/automation.py.in | 1 + 1 file changed, 1 insertion(+) diff --git a/build/automation.py.in b/build/automation.py.in index 752fcbd2435e..b6b02dac262a 100644 --- a/build/automation.py.in +++ b/build/automation.py.in @@ -325,6 +325,7 @@ user_pref("browser.EULA.override", true); user_pref("javascript.options.jit_hardening", true); user_pref("gfx.color_management.force_srgb", true); user_pref("network.manage-offline-status", false); +user_pref("dom.min_background_timeout_value", 1000); user_pref("test.mousescroll", true); user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs user_pref("network.http.prompt-temp-redirect", false); From bda87dc03dc6fd6173b4fd4a2cb3b314d250b51c Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Mon, 11 Jun 2012 22:43:31 -0700 Subject: [PATCH 13/13] Don't assume ordering of callers of nsPresContext::ScreenWidthInchesForFontInflation; instead, track changes only for the caller that cares about changes. (Bug 759755, patch 5) r=bzbarsky --- layout/base/nsPresContext.cpp | 15 ++++++--------- layout/base/nsPresContext.h | 8 ++++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 91e2822333a6..dc1a4ce8b19a 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -1407,15 +1407,12 @@ nsPresContext::ScreenWidthInchesForFontInflation(bool* aChanged) float deviceWidthInches = float(clientRect.width) / float(dx->AppUnitsPerPhysicalInch()); - if (deviceWidthInches != mLastFontInflationScreenWidth) { - if (mLastFontInflationScreenWidth != -1.0) { - if (aChanged) { - *aChanged = true; - } else { - NS_NOTREACHED("somebody should have checked for screen width change " - "and triggered a reflow"); - } - } + if (mLastFontInflationScreenWidth == -1.0) { + mLastFontInflationScreenWidth = deviceWidthInches; + } + + if (deviceWidthInches != mLastFontInflationScreenWidth && aChanged) { + *aChanged = true; mLastFontInflationScreenWidth = deviceWidthInches; } diff --git a/layout/base/nsPresContext.h b/layout/base/nsPresContext.h index 572f6f2aa394..5a64422424cd 100644 --- a/layout/base/nsPresContext.h +++ b/layout/base/nsPresContext.h @@ -547,10 +547,10 @@ public: * Return the device's screen width in inches, for font size * inflation. * - * Set |aChanged| to true if the result returned is different from a - * previous call to this method. If a caller passes |aChanged| as - * null, then something else must have already checked whether there - * was a change (by calling this method). + * If |aChanged| is non-null, then aChanged is filled in with whether + * the return value has changed since either: + * a. the last time the function was called with non-null aChanged, or + * b. the first time the function was called. */ float ScreenWidthInchesForFontInflation(bool* aChanged = nsnull);