Browse Source

Some more mozilla rel-257 patches

Ian Neal 4 years ago
parent
commit
44bdb578cb

+ 0 - 16
comm-esr60/mozilla-esr60/patches/series

@@ -217,22 +217,6 @@ NOBUG-BACKOUT-1439860-60.patch
 TOP-9999999-rust133-257.patch
 TOP-9999999-rust133-257.patch
 TOP-9999999-fixlangpack-257.patch
 TOP-9999999-fixlangpack-257.patch
 mozilla-esr60-top-nonexisting.patch
 mozilla-esr60-top-nonexisting.patch
-1574573-70a1.patch
-1576463-71a1.patch
-1518762-66a1.patch
-1519209-66a1.patch
-1516642-67a1.patch
-1401776-62a1.patch
-1516325-68a1.patch
-1541282-68a1.patch
-1496823-1-64a1.patch
-1496823-2-64a1.patch
-1496823-3-64a1.patch
-1496823-4-64a1.patch
-1496823-5-64a1.patch
-1496823-6-64a1.patch
-1496823-7-64a1.patch
-1496823-8-64a1.patch
 1434844-61a1.patch
 1434844-61a1.patch
 1474684-1-63a1.patch
 1474684-1-63a1.patch
 1474684-2-63a1.patch
 1474684-2-63a1.patch

+ 63 - 64
comm-esr60/mozilla-esr60/patches/1401776-62a1.patch → rel-257/mozilla-esr60/patches/1401776-62a1.patch

@@ -2,7 +2,7 @@
 # User Jed Davis <jld@mozilla.com>
 # User Jed Davis <jld@mozilla.com>
 # Date 1525995392 21600
 # Date 1525995392 21600
 # Node ID fcfbfc7d96d90fb5bbc3f03284a460a70e7674ac
 # Node ID fcfbfc7d96d90fb5bbc3f03284a460a70e7674ac
-# Parent  3c9ec8cab4f0f948b65963a64bb496a117b6d05e
+# Parent  7ea7dd821347952a96808a3b98e45aa08a420ccd
 Bug 1401776 - Raise fd limit to 4096 on Unix. r=glandium,mcmanus
 Bug 1401776 - Raise fd limit to 4096 on Unix. r=glandium,mcmanus
 
 
 This is to accommodate non-networking fd usage (IPC transports, various
 This is to accommodate non-networking fd usage (IPC transports, various
@@ -22,39 +22,40 @@ MozReview-Commit-ID: 2uodrkW5sUn
 diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp
 diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp
 --- a/gfx/thebes/gfxPlatformMac.cpp
 --- a/gfx/thebes/gfxPlatformMac.cpp
 +++ b/gfx/thebes/gfxPlatformMac.cpp
 +++ b/gfx/thebes/gfxPlatformMac.cpp
-@@ -76,28 +76,16 @@ gfxPlatformMac::gfxPlatformMac()
-     DisableFontActivation();
-     mFontAntiAliasingThreshold = ReadAntiAliasingThreshold();
+@@ -73,29 +73,16 @@ gfxPlatformMac::gfxPlatformMac() {
+   DisableFontActivation();
+   mFontAntiAliasingThreshold = ReadAntiAliasingThreshold();
  
  
-     uint32_t canvasMask = BackendTypeBit(BackendType::SKIA);
-     uint32_t contentMask = BackendTypeBit(BackendType::SKIA);
-     InitBackendPrefs(canvasMask, BackendType::SKIA,
-                      contentMask, BackendType::SKIA);
+   uint32_t canvasMask = BackendTypeBit(BackendType::SKIA);
+   uint32_t contentMask = BackendTypeBit(BackendType::SKIA);
+   InitBackendPrefs(canvasMask, BackendType::SKIA, contentMask,
+                    BackendType::SKIA);
  
  
--    // XXX: Bug 1036682 - we run out of fds on Mac when using tiled layers because
--    // with 256x256 tiles we can easily hit the soft limit of 800 when using double
--    // buffered tiles in e10s, so let's bump the soft limit to the hard limit for the OS
--    // up to a new cap of OPEN_MAX.
--    struct rlimit limits;
--    if (getrlimit(RLIMIT_NOFILE, &limits) == 0) {
--        limits.rlim_cur = std::min(rlim_t(OPEN_MAX), limits.rlim_max);
--        if (setrlimit(RLIMIT_NOFILE, &limits) != 0) {
--            NS_WARNING("Unable to bump RLIMIT_NOFILE to the maximum number on this OS");
--        }
+-  // XXX: Bug 1036682 - we run out of fds on Mac when using tiled layers because
+-  // with 256x256 tiles we can easily hit the soft limit of 800 when using
+-  // double buffered tiles in e10s, so let's bump the soft limit to the hard
+-  // limit for the OS up to a new cap of OPEN_MAX.
+-  struct rlimit limits;
+-  if (getrlimit(RLIMIT_NOFILE, &limits) == 0) {
+-    limits.rlim_cur = std::min(rlim_t(OPEN_MAX), limits.rlim_max);
+-    if (setrlimit(RLIMIT_NOFILE, &limits) != 0) {
+-      NS_WARNING(
+-          "Unable to bump RLIMIT_NOFILE to the maximum number on this OS");
 -    }
 -    }
+-  }
 -
 -
-     MacIOSurfaceLib::LoadLibrary();
+   MacIOSurfaceLib::LoadLibrary();
  }
  }
  
  
- gfxPlatformMac::~gfxPlatformMac()
- {
-     gfxCoreTextShaper::Shutdown();
- }
+ gfxPlatformMac::~gfxPlatformMac() { gfxCoreTextShaper::Shutdown(); }
  
  
+ bool gfxPlatformMac::UsesTiling() const {
+   // The non-tiling ContentClient requires CrossProcessSemaphore which
+   // isn't implemented for OSX.
 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
 --- a/toolkit/xre/nsAppRunner.cpp
 --- a/toolkit/xre/nsAppRunner.cpp
 +++ b/toolkit/xre/nsAppRunner.cpp
 +++ b/toolkit/xre/nsAppRunner.cpp
-@@ -147,19 +147,22 @@
+@@ -148,19 +148,22 @@
  #include "mozilla/Omnijar.h"
  #include "mozilla/Omnijar.h"
  #include "mozilla/StartupTimeline.h"
  #include "mozilla/StartupTimeline.h"
  #include "mozilla/LateWriteChecks.h"
  #include "mozilla/LateWriteChecks.h"
@@ -75,21 +76,19 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
  #ifdef XP_WIN
  #ifdef XP_WIN
  #include <process.h>
  #include <process.h>
  #include <shlobj.h>
  #include <shlobj.h>
+ #include "mozilla/WinDllServices.h"
  #include "nsThreadUtils.h"
  #include "nsThreadUtils.h"
  #include <comdef.h>
  #include <comdef.h>
- #include <wbemidl.h>
-@@ -3132,16 +3135,45 @@ public:
-   bool mDisableRemote;
- #endif
- 
- #if defined(MOZ_WIDGET_GTK)
-   GdkDisplay* mGdkDisplay;
+@@ -3050,16 +3053,43 @@ static bool CheckForUserMismatch() {
+     }
+   }
+   return false;
+ }
+ #else  // !XP_UNIX || ANDROID
+ static bool CheckForUserMismatch() { return false; }
  #endif
  #endif
- };
  
  
-+static void
-+IncreaseDescriptorLimits()
-+{
++static void IncreaseDescriptorLimits() {
 +#ifdef XP_UNIX
 +#ifdef XP_UNIX
 +  // Increase the fd limit to accomodate IPC resources like shared memory.
 +  // Increase the fd limit to accomodate IPC resources like shared memory.
 +  static const rlim_t kFDs = 4096;
 +  static const rlim_t kFDs = 4096;
@@ -121,16 +120,16 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
   * Main() will exit early if either return value != 0 or if aExitFlag is
   * Main() will exit early if either return value != 0 or if aExitFlag is
   * true.
   * true.
   */
   */
- int
- XREMain::XRE_mainInit(bool* aExitFlag)
- {
-@@ -3201,16 +3233,18 @@ XREMain::XRE_mainInit(bool* aExitFlag)
+ int XREMain::XRE_mainInit(bool* aExitFlag) {
+   if (!aExitFlag) return 1;
+   *aExitFlag = false;
+@@ -3117,16 +3147,18 @@ int XREMain::XRE_mainInit(bool* aExitFla
+ 
    nsresult rv;
    nsresult rv;
    ArgResult ar;
    ArgResult ar;
  
  
  #ifdef DEBUG
  #ifdef DEBUG
-   if (PR_GetEnv("XRE_MAIN_BREAK"))
-     NS_BREAK();
+   if (PR_GetEnv("XRE_MAIN_BREAK")) NS_BREAK();
  #endif
  #endif
  
  
 +  IncreaseDescriptorLimits();
 +  IncreaseDescriptorLimits();
@@ -146,8 +145,8 @@ diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
 diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
 diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
 --- a/toolkit/xre/nsSigHandlers.cpp
 --- a/toolkit/xre/nsSigHandlers.cpp
 +++ b/toolkit/xre/nsSigHandlers.cpp
 +++ b/toolkit/xre/nsSigHandlers.cpp
-@@ -283,40 +283,16 @@ void InstallSignalHandlers(const char *a
-     m *= (1024*1024);
+@@ -275,40 +275,16 @@ void InstallSignalHandlers(const char *a
+     m *= (1024 * 1024);
      struct rlimit r;
      struct rlimit r;
      r.rlim_cur = m;
      r.rlim_cur = m;
      r.rlim_max = m;
      r.rlim_max = m;
@@ -158,32 +157,32 @@ diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
 -#if defined(SOLARIS)
 -#if defined(SOLARIS)
 -#define NOFILES 512
 -#define NOFILES 512
 -
 -
--    // Boost Solaris file descriptors
--    {
--	struct rlimit rl;
+-  // Boost Solaris file descriptors
+-  {
+-    struct rlimit rl;
 -
 -
--	if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
+-    if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
 -
 -
--	    if (rl.rlim_cur < NOFILES) {
--		rl.rlim_cur = NOFILES;
+-      if (rl.rlim_cur < NOFILES) {
+-        rl.rlim_cur = NOFILES;
 -
 -
--		if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
--		    perror("setrlimit(RLIMIT_NOFILE)");
--		    fprintf(stderr, "Cannot exceed hard limit for open files");
--		}
+-        if (setrlimit(RLIMIT_NOFILE, &rl) < 0) {
+-          perror("setrlimit(RLIMIT_NOFILE)");
+-          fprintf(stderr, "Cannot exceed hard limit for open files");
+-        }
 -#if defined(DEBUG)
 -#if defined(DEBUG)
--	    	if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
--		    printf("File descriptors set to %d\n", rl.rlim_cur);
--#endif //DEBUG
--	    }
--    }
--#endif //SOLARIS
+-        if (getrlimit(RLIMIT_NOFILE, &rl) == 0)
+-          printf("File descriptors set to %d\n", rl.rlim_cur);
+-#endif  // DEBUG
+-      }
+-  }
+-#endif  // SOLARIS
 -
 -
- #if defined(MOZ_WIDGET_GTK) && (GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6))
+ #if defined(MOZ_WIDGET_GTK) && \
+     (GLIB_MAJOR_VERSION > 2 || \
+      (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 6))
    const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK");
    const char *assertString = PR_GetEnv("XPCOM_DEBUG_BREAK");
    if (assertString &&
    if (assertString &&
-       (!strcmp(assertString, "suspend") ||
-        !strcmp(assertString, "stack") ||
-        !strcmp(assertString, "abort") ||
-        !strcmp(assertString, "trap") ||
+       (!strcmp(assertString, "suspend") || !strcmp(assertString, "stack") ||
+        !strcmp(assertString, "abort") || !strcmp(assertString, "trap") ||
         !strcmp(assertString, "break"))) {
         !strcmp(assertString, "break"))) {

+ 13 - 13
comm-esr60/mozilla-esr60/patches/1496823-1-64a1.patch → rel-257/mozilla-esr60/patches/1496823-1-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809003 0
 # Date 1539809003 0
 # Node ID 34f52a304c5251541685810ab2fb2e0a508d7508
 # Node ID 34f52a304c5251541685810ab2fb2e0a508d7508
-# Parent  75c21a5654e9d19b679886b98fb3be8bbceaa90c
+# Parent  76894869c1bee33885642b22f9310f57bc25903f
 Bug 1496823 - Remove setNeedsPendingDisplay infrastructure. r=spohl
 Bug 1496823 - Remove setNeedsPendingDisplay infrastructure. r=spohl
 
 
 Many years ago, Gecko would sometimes call nsChildView::Invalidate during drawRect:.
 Many years ago, Gecko would sometimes call nsChildView::Invalidate during drawRect:.
@@ -17,29 +17,29 @@ diff --git a/widget/cocoa/mozView.h b/widget/cocoa/mozView.h
 @@ -29,21 +29,16 @@ class TextInputHandler;
 @@ -29,21 +29,16 @@ class TextInputHandler;
  - (void)uninstallTextInputHandler;
  - (void)uninstallTextInputHandler;
  
  
-   // access the nsIWidget associated with this view. DOES NOT ADDREF.
+ // access the nsIWidget associated with this view. DOES NOT ADDREF.
  - (nsIWidget*)widget;
  - (nsIWidget*)widget;
  
  
-   // return a context menu for this view
+ // return a context menu for this view
  - (NSMenu*)contextMenu;
  - (NSMenu*)contextMenu;
  
  
--  // Allows callers to do a delayed invalidate (e.g., if an invalidate
--  // happens during drawing)
+-// Allows callers to do a delayed invalidate (e.g., if an invalidate
+-// happens during drawing)
 -- (void)setNeedsPendingDisplay;
 -- (void)setNeedsPendingDisplay;
 -- (void)setNeedsPendingDisplayInRect:(NSRect)invalidRect;
 -- (void)setNeedsPendingDisplayInRect:(NSRect)invalidRect;
 -
 -
-   // called when our corresponding Gecko view goes away
+ // called when our corresponding Gecko view goes away
  - (void)widgetDestroyed;
  - (void)widgetDestroyed;
  
  
  - (BOOL)isDragInProgress;
  - (BOOL)isDragInProgress;
  
  
-   // Checks whether the view is first responder or not
+ // Checks whether the view is first responder or not
  - (BOOL)isFirstResponder;
  - (BOOL)isFirstResponder;
  
  
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
-@@ -139,21 +139,16 @@ class WidgetRenderingContext;
+@@ -140,21 +140,16 @@ class WidgetRenderingContext;
    NSEvent* mLastKeyDownEvent;
    NSEvent* mLastKeyDownEvent;
  
  
    // Whether the last mouse down event was blocked from Gecko.
    // Whether the last mouse down event was blocked from Gecko.
@@ -83,7 +83,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  - (void)drawUsingOpenGLCallback;
  - (void)drawUsingOpenGLCallback;
  
  
  - (BOOL)hasRoundedBottomCorners;
  - (BOOL)hasRoundedBottomCorners;
-@@ -1398,24 +1396,17 @@ nsChildView::Invalidate(const LayoutDevi
+@@ -1401,24 +1399,17 @@ nsChildView::Invalidate(const LayoutDevi
    NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
    NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
  
  
    if (!mView || !mVisible)
    if (!mView || !mVisible)
@@ -109,7 +109,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  nsChildView::WidgetTypeSupportsAcceleration()
  nsChildView::WidgetTypeSupportsAcceleration()
  {
  {
    // We need to enable acceleration in popups which contain remote layer
    // We need to enable acceleration in popups which contain remote layer
-@@ -3326,17 +3317,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3287,17 +3278,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
  
  
  // initWithFrame:geckoChild:
  // initWithFrame:geckoChild:
  - (id)initWithFrame:(NSRect)inFrame geckoChild:(nsChildView*)inChild
  - (id)initWithFrame:(NSRect)inFrame geckoChild:(nsChildView*)inChild
@@ -127,7 +127,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      mClickThroughMouseDownEvent = nil;
      mClickThroughMouseDownEvent = nil;
      mDragService = nullptr;
      mDragService = nullptr;
  
  
-@@ -3464,17 +3454,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3425,17 +3415,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
    NS_OBJC_END_TRY_ABORT_BLOCK;
    NS_OBJC_END_TRY_ABORT_BLOCK;
  }
  }
  
  
@@ -145,7 +145,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  
  
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[NSNotificationCenter defaultCenter] removeObserver:self];
    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
    [[NSDistributedNotificationCenter defaultCenter] removeObserver:self];
-@@ -3519,66 +3508,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3480,66 +3469,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
        nsIPresShell* presShell = listener->GetPresShell();
        nsIPresShell* presShell = listener->GetPresShell();
        if (presShell) {
        if (presShell) {
          presShell->ReconstructFrames();
          presShell->ReconstructFrames();
@@ -212,7 +212,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    }
    }
  
  
    if ([[self window] isVisible] && [self isUsingMainThreadOpenGL]) {
    if ([[self window] isVisible] && [self isUsingMainThreadOpenGL]) {
-@@ -3650,35 +3589,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3598,35 +3537,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
      // inactive because at that point we've already been made active.
      // inactive because at that point we've already been made active.
      // Unfortunately, acceptsFirstMouse is called for PopupWindows even when
      // Unfortunately, acceptsFirstMouse is called for PopupWindows even when
      // their parent window is active, so ignore this on them for now.
      // their parent window is active, so ignore this on them for now.

+ 35 - 36
comm-esr60/mozilla-esr60/patches/1496823-2-64a1.patch → rel-257/mozilla-esr60/patches/1496823-2-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809068 0
 # Date 1539809068 0
 # Node ID 959084361b1580b3dd586b6e229e21274cc83556
 # Node ID 959084361b1580b3dd586b6e229e21274cc83556
-# Parent  34019cb494807ba5cc1319d9935489c034c3d20a
+# Parent  ddeb29e144604e61f669031917683b06093a5429
 Bug 1496823 - Remove EventThreadRunner and the pref that enabled it. r=kats,spohl
 Bug 1496823 - Remove EventThreadRunner and the pref that enabled it. r=kats,spohl
 
 
 This was an experiment before we had e10s. It's no longer needed.
 This was an experiment before we had e10s. It's no longer needed.
@@ -14,13 +14,13 @@ Differential Revision: https://phabricator.services.mozilla.com/D7924
 diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h
 diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h
 --- a/gfx/thebes/gfxPrefs.h
 --- a/gfx/thebes/gfxPrefs.h
 +++ b/gfx/thebes/gfxPrefs.h
 +++ b/gfx/thebes/gfxPrefs.h
-@@ -538,17 +538,16 @@ private:
-   DECL_OVERRIDE_PREF(Live, "layers.advanced.filter-layers",           LayersAllowFilterLayers, gfxPrefs::OverrideBase_WebRender());
+@@ -562,17 +562,16 @@ class gfxPrefs final {
+   DECL_GFX_PREF(Live, "layers.advanced.caret-layers",                 LayersAllowCaretLayers, bool, false);
+   DECL_OVERRIDE_PREF(Live, "layers.advanced.columnRule-layers",       LayersAllowColumnRuleLayers, gfxPrefs::OverrideBase_WebRender());
    DECL_OVERRIDE_PREF(Live, "layers.advanced.image-layers",            LayersAllowImageLayers, gfxPrefs::OverrideBase_WebRender());
    DECL_OVERRIDE_PREF(Live, "layers.advanced.image-layers",            LayersAllowImageLayers, gfxPrefs::OverrideBase_WebRender());
    DECL_OVERRIDE_PREF(Live, "layers.advanced.outline-layers",          LayersAllowOutlineLayers, gfxPrefs::OverrideBase_WebRender());
    DECL_OVERRIDE_PREF(Live, "layers.advanced.outline-layers",          LayersAllowOutlineLayers, gfxPrefs::OverrideBase_WebRender());
-   DECL_OVERRIDE_PREF(Live, "layers.advanced.solid-color",             LayersAllowSolidColorLayers, gfxPrefs::OverrideBase_WebRender());
-   DECL_OVERRIDE_PREF(Live, "layers.advanced.table",                   LayersAllowTable, gfxPrefs::OverrideBase_WebRendest());
-   DECL_OVERRIDE_PREF(Live, "layers.advanced.text-layers",             LayersAllowTextLayers, gfxPrefs::OverrideBase_WebRendest());
+   DECL_GFX_PREF(Live, "layers.advanced.solid-color",                  LayersAllowSolidColorLayers, bool, false);
+   DECL_GFX_PREF(Live, "layers.advanced.table",                        LayersAllowTable, bool, false);
    DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, bool, false);
    DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled",     LayersAMDSwitchableGfxEnabled, bool, false);
    DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
    DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled",         AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
 -  DECL_GFX_PREF(Once, "layers.async-pan-zoom.separate-event-thread", AsyncPanZoomSeparateEventThread, bool, false);
 -  DECL_GFX_PREF(Once, "layers.async-pan-zoom.separate-event-thread", AsyncPanZoomSeparateEventThread, bool, false);
@@ -35,15 +35,15 @@ diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
-@@ -246,17 +246,16 @@ class WidgetRenderingContext;
- - (void)swipeWithEvent:(NSEvent *)anEvent;
- - (void)beginGestureWithEvent:(NSEvent *)anEvent;
- - (void)magnifyWithEvent:(NSEvent *)anEvent;
- - (void)smartMagnifyWithEvent:(NSEvent *)anEvent;
- - (void)rotateWithEvent:(NSEvent *)anEvent;
- - (void)endGestureWithEvent:(NSEvent *)anEvent;
- 
- - (void)scrollWheel:(NSEvent *)anEvent;
+@@ -247,17 +247,16 @@ class WidgetRenderingContext;
+ - (void)swipeWithEvent:(NSEvent*)anEvent;
+ - (void)beginGestureWithEvent:(NSEvent*)anEvent;
+ - (void)magnifyWithEvent:(NSEvent*)anEvent;
+ - (void)smartMagnifyWithEvent:(NSEvent*)anEvent;
+ - (void)rotateWithEvent:(NSEvent*)anEvent;
+ - (void)endGestureWithEvent:(NSEvent*)anEvent;
+ 
+ - (void)scrollWheel:(NSEvent*)anEvent;
 -- (void)handleAsyncScrollEvent:(CGEventRef)cgEvent ofType:(CGEventType)type;
 -- (void)handleAsyncScrollEvent:(CGEventRef)cgEvent ofType:(CGEventType)type;
  
  
  - (void)setUsingOMTCompositor:(BOOL)aUseOMTC;
  - (void)setUsingOMTCompositor:(BOOL)aUseOMTC;
@@ -53,25 +53,25 @@ diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
  + (uint32_t)sUniqueKeyEventId;
  + (uint32_t)sUniqueKeyEventId;
  
  
  + (NSMutableDictionary*)sNativeKeyEventsMap;
  + (NSMutableDictionary*)sNativeKeyEventsMap;
-@@ -512,18 +511,16 @@ public:
+@@ -491,18 +490,16 @@ class nsChildView final : public nsBaseW
+   }
  
  
-   already_AddRefed<mozilla::gfx::DrawTarget>
-     StartRemoteDrawingInRegion(LayoutDeviceIntRegion& aInvalidRegion,
-                                mozilla::layers::BufferMode* aBufferMode) override;
+   already_AddRefed<mozilla::gfx::DrawTarget> StartRemoteDrawingInRegion(
+       LayoutDeviceIntRegion& aInvalidRegion, mozilla::layers::BufferMode* aBufferMode) override;
    void EndRemoteDrawing() override;
    void EndRemoteDrawing() override;
    void CleanupRemoteDrawing() override;
    void CleanupRemoteDrawing() override;
    bool InitCompositor(mozilla::layers::Compositor* aCompositor) override;
    bool InitCompositor(mozilla::layers::Compositor* aCompositor) override;
  
  
--  IAPZCTreeManager* APZCTM() { return mAPZC ; }
+-  IAPZCTreeManager* APZCTM() { return mAPZC; }
 -
 -
-   virtual MOZ_MUST_USE nsresult
-   StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
-                  int32_t aPanelX, int32_t aPanelY,
-                  nsString& aCommitted) override;
+   virtual MOZ_MUST_USE nsresult StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
+                                                int32_t aPanelX, int32_t aPanelY,
+                                                nsString& aCommitted) override;
  
  
    virtual void SetPluginFocused(bool& aFocused) override;
    virtual void SetPluginFocused(bool& aFocused) override;
  
  
    bool IsPluginFocused() { return mPluginFocused; }
    bool IsPluginFocused() { return mPluginFocused; }
+ 
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
@@ -94,7 +94,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    [NSMutableDictionary dictionary];
    [NSMutableDictionary dictionary];
  
  
  @interface ChildView(Private)
  @interface ChildView(Private)
-@@ -203,38 +201,26 @@ static NSMutableDictionary* sNativeKeyEv
+@@ -202,38 +200,26 @@ static NSMutableDictionary* sNativeKeyEv
  #endif
  #endif
  
  
  #ifdef ACCESSIBILITY
  #ifdef ACCESSIBILITY
@@ -133,7 +133,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  - (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove;
  - (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove;
  - (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove forUnderTitlebar:(BOOL)aForUnderTitlebar;
  - (CGSRegionObj)_regionForOpaqueDescendants:(NSRect)aRect forMove:(BOOL)aForMove forUnderTitlebar:(BOOL)aForUnderTitlebar;
  @end
  @end
-@@ -391,23 +377,16 @@ nsChildView::~nsChildView()
+@@ -390,23 +376,16 @@ nsChildView::~nsChildView()
    }
    }
  
  
    NS_WARNING_ASSERTION(
    NS_WARNING_ASSERTION(
@@ -157,7 +157,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    // mGeckoChild are used throughout the ChildView class to tell if it's safe
    // mGeckoChild are used throughout the ChildView class to tell if it's safe
    // to use a ChildView object.
    // to use a ChildView object.
    [mView widgetDestroyed]; // Safe if mView is nil.
    [mView widgetDestroyed]; // Safe if mView is nil.
-@@ -1967,35 +1946,22 @@ nsChildView::CreateCompositor()
+@@ -1970,35 +1949,22 @@ nsChildView::CreateCompositor()
      [(ChildView *)mView setUsingOMTCompositor:true];
      [(ChildView *)mView setUsingOMTCompositor:true];
    }
    }
  }
  }
@@ -191,10 +191,10 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  LayoutDeviceIntRect
  LayoutDeviceIntRect
  nsChildView::RectContainingTitlebarControls()
  nsChildView::RectContainingTitlebarControls()
  {
  {
-   // Start with a thin strip at the top of the window for the highlight line.
-   NSRect rect = NSMakeRect(0, 0, [mView bounds].size.width,
-                            [(ChildView*)mView cornerRadius]);
-@@ -4905,22 +4871,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
+   NSRect rect = NSZeroRect;
+ 
+   // If we draw the titlebar title string, set the rect to the full window
+@@ -4855,22 +4821,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
    // For line scrolls, or pre-10.12, just use the rounded up value of deltaX / deltaY.
    // For line scrolls, or pre-10.12, just use the rounded up value of deltaX / deltaY.
    return gfx::IntPoint(RoundUp([aEvent deltaX]), RoundUp([aEvent deltaY]));
    return gfx::IntPoint(RoundUp([aEvent deltaX]), RoundUp([aEvent deltaY]));
  }
  }
@@ -217,7 +217,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      return;
      return;
    }
    }
  
  
-@@ -5030,115 +4990,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
+@@ -4980,115 +4940,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
      wheelEvent.mLineOrPageDeltaX = lineOrPageDelta.x;
      wheelEvent.mLineOrPageDeltaX = lineOrPageDelta.x;
      wheelEvent.mLineOrPageDeltaY = lineOrPageDelta.y;
      wheelEvent.mLineOrPageDeltaY = lineOrPageDelta.y;
      geckoChildDeathGrip->DispatchAPZWheelInputEvent(wheelEvent, false);
      geckoChildDeathGrip->DispatchAPZWheelInputEvent(wheelEvent, false);
@@ -333,7 +333,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      return nil;
      return nil;
  
  
    nsAutoRetainCocoaObject kungFuDeathGrip(self);
    nsAutoRetainCocoaObject kungFuDeathGrip(self);
-@@ -5723,21 +5584,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
+@@ -5964,21 +5825,16 @@ GetIntegerDeltaForEvent(NSEvent* aEvent)
    if (!mGeckoChild) {
    if (!mGeckoChild) {
      return LayoutDeviceIntPoint(0, 0);
      return LayoutDeviceIntPoint(0, 0);
    }
    }
@@ -355,7 +355,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
    NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
  
  
    if (!mGeckoChild)
    if (!mGeckoChild)
-@@ -6669,116 +6525,16 @@ ChildViewMouseTracker::WindowAcceptsEven
+@@ -6928,115 +6784,16 @@ ChildViewMouseTracker::WindowAcceptsEven
  
  
    // If we're here then we're dealing with a left click or mouse move on an
    // If we're here then we're dealing with a left click or mouse move on an
    // inactive window or something similar. Ask Gecko what to do.
    // inactive window or something similar. Ask Gecko what to do.
@@ -409,8 +409,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 -
 -
 -- (void)runEventThread
 -- (void)runEventThread
 -{
 -{
--  char aLocal;
--  profiler_register_thread("APZC Event Thread", &aLocal);
+-  PROFILER_REGISTER_THREAD("APZC Event Thread");
 -  NS_SetCurrentThreadName("APZC Event Thread");
 -  NS_SetCurrentThreadName("APZC Event Thread");
 -
 -
 -  mThread = [NSThread currentThread];
 -  mThread = [NSThread currentThread];

+ 5 - 5
comm-esr60/mozilla-esr60/patches/1496823-3-64a1.patch → rel-257/mozilla-esr60/patches/1496823-3-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809176 0
 # Date 1539809176 0
 # Node ID 8848453f27af6f3ae1538e9cbadef50bf4e95455
 # Node ID 8848453f27af6f3ae1538e9cbadef50bf4e95455
-# Parent  cd3bd84783ea123b126765a2452bb3aaa317f933
+# Parent  2b51d75106b185885e12c7ce8fe92bf59d1d40f2
 Bug 1496823 - Remove -[ChildView isUsingMainThreadOpenGL] and dependent code because it always returns NO. r=spohl
 Bug 1496823 - Remove -[ChildView isUsingMainThreadOpenGL] and dependent code because it always returns NO. r=spohl
 
 
 The main thread layer manager is always NONE, BASIC or CLIENT. It is never OPENGL anymore.
 The main thread layer manager is always NONE, BASIC or CLIENT. It is never OPENGL anymore.
@@ -15,7 +15,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D7925
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 diff --git a/widget/cocoa/nsChildView.h b/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 --- a/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
 +++ b/widget/cocoa/nsChildView.h
-@@ -180,18 +180,16 @@ class WidgetRenderingContext;
+@@ -181,18 +181,16 @@ class WidgetRenderingContext;
      eGestureState_None,
      eGestureState_None,
      eGestureState_StartGesture,
      eGestureState_StartGesture,
      eGestureState_MagnifyGesture,
      eGestureState_MagnifyGesture,
@@ -58,7 +58,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  -(void)setGLOpaque:(BOOL)aOpaque;
  -(void)setGLOpaque:(BOOL)aOpaque;
  
  
  // Overlay drawing functions for traditional CGContext drawing
  // Overlay drawing functions for traditional CGContext drawing
-@@ -3480,34 +3478,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3441,34 +3439,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
  }
  }
  
  
  - (void)setNeedsDisplayInRect:(NSRect)aRect
  - (void)setNeedsDisplayInRect:(NSRect)aRect
@@ -93,7 +93,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  
  
    return [NSString stringWithFormat:@"ChildView %p, gecko child %p, frame %@", self, mGeckoChild, NSStringFromRect([self frame])];
    return [NSString stringWithFormat:@"ChildView %p, gecko child %p, frame %@", self, mGeckoChild, NSStringFromRect([self frame])];
  
  
-@@ -3677,22 +3657,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3632,22 +3612,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
             aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, aContext,
             aRect.origin.x, aRect.origin.y, aRect.size.width, aRect.size.height, aContext,
             geckoBounds.x, geckoBounds.y, geckoBounds.width, geckoBounds.height);
             geckoBounds.x, geckoBounds.y, geckoBounds.width, geckoBounds.height);
  
  
@@ -116,7 +116,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      // So we need to clear the pixel buffer contents in these areas.
      // So we need to clear the pixel buffer contents in these areas.
      mGeckoChild->ClearVibrantAreas();
      mGeckoChild->ClearVibrantAreas();
      [self clearCorners];
      [self clearCorners];
-@@ -3746,56 +3720,37 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3700,56 +3674,37 @@ NSEvent* gLastDragMouseDownEvent = nil;
                              0.5);
                              0.5);
  #endif
  #endif
    CGContextSetRGBStrokeColor(aContext, 1, 0, 0, 0.8);
    CGContextSetRGBStrokeColor(aContext, 1, 0, 0, 0.8);

+ 2 - 2
comm-esr60/mozilla-esr60/patches/1496823-4-64a1.patch → rel-257/mozilla-esr60/patches/1496823-4-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809249 0
 # Date 1539809249 0
 # Node ID 56dc11bab861326c3981f8a38f08027a2b90ae7a
 # Node ID 56dc11bab861326c3981f8a38f08027a2b90ae7a
-# Parent  396f0ea6bd87ecd8625d4f560fb0f9a3b76a86da
+# Parent  15eb1a002af2d2be2b175df86a9ec8e80637e2e9
 Bug 1496823 - Remove -[ChildView setNeedsDisplayInRect:] override. r=spohl
 Bug 1496823 - Remove -[ChildView setNeedsDisplayInRect:] override. r=spohl
 
 
 This override was intended to ignore unnecessary nsChildView::Invalidate calls
 This override was intended to ignore unnecessary nsChildView::Invalidate calls
@@ -17,7 +17,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D7927
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
-@@ -3472,24 +3472,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3433,24 +3433,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
        nsIPresShell* presShell = listener->GetPresShell();
        nsIPresShell* presShell = listener->GetPresShell();
        if (presShell) {
        if (presShell) {
          presShell->ReconstructFrames();
          presShell->ReconstructFrames();

+ 8 - 8
comm-esr60/mozilla-esr60/patches/1496823-5-64a1.patch → rel-257/mozilla-esr60/patches/1496823-5-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809253 0
 # Date 1539809253 0
 # Node ID d1d878123a68f2f7bcd4f31f57fd7eb648975ada
 # Node ID d1d878123a68f2f7bcd4f31f57fd7eb648975ada
-# Parent  71be87feab711c0db921953b3200b23515f57469
+# Parent  faa0bbeb52fb0e95c3dba5a053ccba94c8c96d62
 Bug 1496823 - Remove unneeded debugging code. r=spohl
 Bug 1496823 - Remove unneeded debugging code. r=spohl
 
 
 I don't think anybody has made use of this code in years.
 I don't think anybody has made use of this code in years.
@@ -14,12 +14,12 @@ Differential Revision: https://phabricator.services.mozilla.com/D7928
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
-@@ -3636,28 +3636,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
-   [self drawRect:aRect inContext:cgContext];
- }
+@@ -3591,28 +3591,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+     // a non-main thread. Ignore those calls because Gecko can only react to
+     // them on the main thread.
+     return;
+   }
  
  
- - (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext
- {
    if (!mGeckoChild || !mGeckoChild->IsVisible())
    if (!mGeckoChild || !mGeckoChild->IsVisible())
      return;
      return;
  
  
@@ -43,13 +43,13 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      // is covered by opaque content in our OpenGL surface.
      // is covered by opaque content in our OpenGL surface.
      // So we need to clear the pixel buffer contents in these areas.
      // So we need to clear the pixel buffer contents in these areas.
      mGeckoChild->ClearVibrantAreas();
      mGeckoChild->ClearVibrantAreas();
-@@ -3695,31 +3683,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3649,31 +3637,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+     CGContextSetRGBFillColor(aContext, 1, 1, 1, 1);
      CGContextFillRect(aContext, NSRectToCGRect(aRect));
      CGContextFillRect(aContext, NSRectToCGRect(aRect));
    }
    }
  
  
    if ([self isCoveringTitlebar]) {
    if ([self isCoveringTitlebar]) {
      [self drawTitleString];
      [self drawTitleString];
-     [self drawTitlebarHighlight];
      [self maskTopCornersInContext:aContext];
      [self maskTopCornersInContext:aContext];
    }
    }
 -
 -

+ 3 - 3
comm-esr60/mozilla-esr60/patches/1496823-6-64a1.patch → rel-257/mozilla-esr60/patches/1496823-6-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809300 0
 # Date 1539809300 0
 # Node ID 408b8733a0a6c805eab8c6bbcb267a07e6bc7dfd
 # Node ID 408b8733a0a6c805eab8c6bbcb267a07e6bc7dfd
-# Parent  ba611d6adf2234721537668a92269fc45d3c44ff
+# Parent  dee64584fc8fbdb092d2f820ea7f259b545adf16
 Bug 1496823 - Inline drawUsingOpenGL into drawRect:inContext: and tweak a comment. r=spohl
 Bug 1496823 - Inline drawUsingOpenGL into drawRect:inContext: and tweak a comment. r=spohl
 
 
 Depends on D7928
 Depends on D7928
@@ -30,7 +30,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  -(void)setGLOpaque:(BOOL)aOpaque;
  -(void)setGLOpaque:(BOOL)aOpaque;
  
  
  // Overlay drawing functions for traditional CGContext drawing
  // Overlay drawing functions for traditional CGContext drawing
-@@ -3646,18 +3645,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3601,18 +3600,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
      // buffer may now contain garbage which we need to prevent from reaching
      // buffer may now contain garbage which we need to prevent from reaching
      // the screen. The only place where garbage can show is in the window
      // the screen. The only place where garbage can show is in the window
      // corners and the vibrant regions of the window - the rest of the window
      // corners and the vibrant regions of the window - the rest of the window
@@ -53,7 +53,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
    // The CGContext that drawRect supplies us with comes with a transform that
    // The CGContext that drawRect supplies us with comes with a transform that
    // scales one user space unit to one Cocoa point, which can consist of
    // scales one user space unit to one Cocoa point, which can consist of
    // multiple dev pixels. But Gecko expects its supplied context to be scaled
    // multiple dev pixels. But Gecko expects its supplied context to be scaled
-@@ -3693,29 +3694,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3647,29 +3648,16 @@ NSEvent* gLastDragMouseDownEvent = nil;
  - (BOOL)isUsingOpenGL
  - (BOOL)isUsingOpenGL
  {
  {
    if (!mGeckoChild || ![self window])
    if (!mGeckoChild || ![self window])

+ 13 - 5
comm-esr60/mozilla-esr60/patches/1496823-7-64a1.patch → rel-257/mozilla-esr60/patches/1496823-7-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809358 0
 # Date 1539809358 0
 # Node ID c9da89f17cf9426dbfad7af2940ebc9f05225c3a
 # Node ID c9da89f17cf9426dbfad7af2940ebc9f05225c3a
-# Parent  6e6ac5f96dad1acc90f2d14d0d2cbeb77bd067db
+# Parent  36f6ce2e1e457bd88b14ebf686b9f64cdd3db17e
 Bug 1496823 - Inline -[ChildView drawRect:inContext:] into -[ChildView drawRect:]. r=spohl
 Bug 1496823 - Inline -[ChildView drawRect:inContext:] into -[ChildView drawRect:]. r=spohl
 
 
 This was separate because at some point in the past we were calling
 This was separate because at some point in the past we were calling
@@ -34,7 +34,7 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  - (void)clearCorners;
  - (void)clearCorners;
  
  
  -(void)setGLOpaque:(BOOL)aOpaque;
  -(void)setGLOpaque:(BOOL)aOpaque;
-@@ -3626,24 +3625,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
+@@ -3574,32 +3573,29 @@ NSEvent* gLastDragMouseDownEvent = nil;
    region.And(region, boundingRect);
    region.And(region, boundingRect);
    return region;
    return region;
  }
  }
@@ -49,11 +49,19 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 -
 -
 -- (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext
 -- (void)drawRect:(NSRect)aRect inContext:(CGContextRef)aContext
 -{
 -{
+   if (!NS_IsMainThread()) {
+     // In the presence of CoreAnimation, this method can sometimes be called on
+     // a non-main thread. Ignore those calls because Gecko can only react to
+     // them on the main thread.
+     return;
+   }
+ 
    if (!mGeckoChild || !mGeckoChild->IsVisible())
    if (!mGeckoChild || !mGeckoChild->IsVisible())
      return;
      return;
+ 
 +  CGContextRef cgContext =
 +  CGContextRef cgContext =
 +    (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
 +    (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort];
- 
++
    if ([self isUsingOpenGL]) {
    if ([self isUsingOpenGL]) {
      // Since this view is usually declared as opaque, the window's pixel
      // Since this view is usually declared as opaque, the window's pixel
      // buffer may now contain garbage which we need to prevent from reaching
      // buffer may now contain garbage which we need to prevent from reaching
@@ -61,7 +69,8 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
      // corners and the vibrant regions of the window - the rest of the window
      // corners and the vibrant regions of the window - the rest of the window
      // is covered by opaque content in our OpenGL surface.
      // is covered by opaque content in our OpenGL surface.
      // So we need to clear the pixel buffer contents in these areas.
      // So we need to clear the pixel buffer contents in these areas.
-@@ -3659,40 +3654,41 @@ NSEvent* gLastDragMouseDownEvent = nil;
+     mGeckoChild->ClearVibrantAreas();
+@@ -3614,39 +3610,40 @@ NSEvent* gLastDragMouseDownEvent = nil;
  
  
    AUTO_PROFILER_LABEL("ChildView::drawRect", GRAPHICS);
    AUTO_PROFILER_LABEL("ChildView::drawRect", GRAPHICS);
  
  
@@ -99,7 +108,6 @@ diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
  
  
    if ([self isCoveringTitlebar]) {
    if ([self isCoveringTitlebar]) {
      [self drawTitleString];
      [self drawTitleString];
-     [self drawTitlebarHighlight];
 -    [self maskTopCornersInContext:aContext];
 -    [self maskTopCornersInContext:aContext];
 +    [self maskTopCornersInContext:cgContext];
 +    [self maskTopCornersInContext:cgContext];
    }
    }

+ 2 - 2
comm-esr60/mozilla-esr60/patches/1496823-8-64a1.patch → rel-257/mozilla-esr60/patches/1496823-8-64a1.patch

@@ -2,7 +2,7 @@
 # User Markus Stange <mstange@themasta.com>
 # User Markus Stange <mstange@themasta.com>
 # Date 1539809409 0
 # Date 1539809409 0
 # Node ID 075201afc029437db5a51b94bd0fde25cb74c202
 # Node ID 075201afc029437db5a51b94bd0fde25cb74c202
-# Parent  ca453f2cc98185829947f64ff8d3335601116556
+# Parent  616a2e8a0dddac0042d1ee9e8d770683ea4a2eca
 Bug 1496823 - Remove declaration of -[NSView _regionForOpaqueDescendants:forMove:]. r=spohl
 Bug 1496823 - Remove declaration of -[NSView _regionForOpaqueDescendants:forMove:]. r=spohl
 
 
 Our implementation of this method was removed in bug 1070710. I forgot to remove the declaration in that bug.
 Our implementation of this method was removed in bug 1070710. I forgot to remove the declaration in that bug.
@@ -12,7 +12,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D7947
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 --- a/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
 +++ b/widget/cocoa/nsChildView.mm
-@@ -211,21 +211,16 @@ static NSMutableDictionary* sNativeKeyEv
+@@ -210,21 +210,16 @@ static NSMutableDictionary* sNativeKeyEv
  - (bool)shouldConsiderStartingSwipeFromEvent:(NSEvent*)aEvent;
  - (bool)shouldConsiderStartingSwipeFromEvent:(NSEvent*)aEvent;
  
  
  @end
  @end

+ 13 - 13
comm-esr60/mozilla-esr60/patches/1516325-68a1.patch → rel-257/mozilla-esr60/patches/1516325-68a1.patch

@@ -2,7 +2,7 @@
 # User Jed Davis <jld@mozilla.com>
 # User Jed Davis <jld@mozilla.com>
 # Date 1553336718 0
 # Date 1553336718 0
 # Node ID b4e4c1cb485de23dcf46c551be73d3900e3802d3
 # Node ID b4e4c1cb485de23dcf46c551be73d3900e3802d3
-# Parent  757b37b4de93753e4e8d6c3aa377d0da4d961bfd
+# Parent  757c4b2f0e9c611b53d59c71199e9702677af146
 Bug 1516325. r=glandium
 Bug 1516325. r=glandium
 
 
 Differential Revision: https://phabricator.services.mozilla.com/D22638
 Differential Revision: https://phabricator.services.mozilla.com/D22638
@@ -10,7 +10,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D22638
 diff --git a/config/external/nspr/pr/moz.build b/config/external/nspr/pr/moz.build
 diff --git a/config/external/nspr/pr/moz.build b/config/external/nspr/pr/moz.build
 --- a/config/external/nspr/pr/moz.build
 --- a/config/external/nspr/pr/moz.build
 +++ b/config/external/nspr/pr/moz.build
 +++ b/config/external/nspr/pr/moz.build
-@@ -35,16 +35,19 @@ elif CONFIG['OS_TARGET'] in ('FreeBSD', 
+@@ -35,17 +35,18 @@ elif CONFIG['OS_TARGET'] in ('FreeBSD', 
          HAVE_BSD_FLOCK=True,
          HAVE_BSD_FLOCK=True,
          HAVE_SOCKLEN_T=True,
          HAVE_SOCKLEN_T=True,
          HAVE_POINTER_LOCALTIME_R=True,
          HAVE_POINTER_LOCALTIME_R=True,
@@ -19,27 +19,27 @@ diff --git a/config/external/nspr/pr/moz.build b/config/external/nspr/pr/moz.bui
      SOURCES += ['/nsprpub/pr/src/md/unix/%s.c' % CONFIG['OS_TARGET'].lower()]
      SOURCES += ['/nsprpub/pr/src/md/unix/%s.c' % CONFIG['OS_TARGET'].lower()]
  elif CONFIG['OS_TARGET'] == 'Darwin':
  elif CONFIG['OS_TARGET'] == 'Darwin':
      OS_LIBS += ['-framework CoreServices']
      OS_LIBS += ['-framework CoreServices']
+-    DEFINES['FD_SETSIZE'] = 10240
 +    # See also IncreaseDescriptorLimits in toolkit/xre/nsAppRunner.cpp
 +    # See also IncreaseDescriptorLimits in toolkit/xre/nsAppRunner.cpp
 +    DEFINES['FD_SETSIZE'] = 4096
 +    DEFINES['FD_SETSIZE'] = 4096
-+    DEFINES['_DARWIN_UNLIMITED_SELECT'] = True
-     if CONFIG['HOST_MAJOR_VERSION'] == '15':
+     DEFINES['_DARWIN_UNLIMITED_SELECT'] = True
+     if not CONFIG['HOST_MAJOR_VERSION']:
          DEFINES.update(
          DEFINES.update(
              HAS_CONNECTX=True,
              HAS_CONNECTX=True,
          )
          )
-     DEFINES.update(
-         DARWIN=True,
-         HAVE_BSD_FLOCK=True,
-         HAVE_SOCKLEN_T=True,
+     elif CONFIG['HOST_MAJOR_VERSION'] >= '15':
+         DEFINES.update(
+             HAS_CONNECTX=True,
 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
 diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
 --- a/toolkit/xre/nsAppRunner.cpp
 --- a/toolkit/xre/nsAppRunner.cpp
 +++ b/toolkit/xre/nsAppRunner.cpp
 +++ b/toolkit/xre/nsAppRunner.cpp
-@@ -3140,16 +3140,17 @@ public:
+@@ -3056,16 +3056,17 @@ static bool CheckForUserMismatch() {
+ }
+ #else  // !XP_UNIX || ANDROID
+ static bool CheckForUserMismatch() { return false; }
  #endif
  #endif
- };
  
  
- static void
- IncreaseDescriptorLimits()
- {
+ static void IncreaseDescriptorLimits() {
  #ifdef XP_UNIX
  #ifdef XP_UNIX
    // Increase the fd limit to accomodate IPC resources like shared memory.
    // Increase the fd limit to accomodate IPC resources like shared memory.
 +  // See also the Darwin case in config/external/nspr/pr/moz.build
 +  // See also the Darwin case in config/external/nspr/pr/moz.build

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1516642-67a1.patch → rel-257/mozilla-esr60/patches/1516642-67a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1549633716 0
 # Date 1549633716 0
 # Node ID 57664c81a1de82de2e2dc34a9a2806fccf2cc5c0
 # Node ID 57664c81a1de82de2e2dc34a9a2806fccf2cc5c0
-# Parent  af6a8b058f9a64e344be618ed578979cf0491722
+# Parent  a1e972193302697563395b544ac4bd2c40c71519
 Bug 1516642 - Add a function declaration for arc4random_buf in expat. r=peterv
 Bug 1516642 - Add a function declaration for arc4random_buf in expat. r=peterv
 
 
 The function has been in bionic (Android's libc since the first commit
 The function has been in bionic (Android's libc since the first commit
@@ -39,4 +39,3 @@ diff --git a/parser/expat/lib/xmlparse.c b/parser/expat/lib/xmlparse.c
    if (EXPAT_ENTROPY_DEBUG && ! strcmp(EXPAT_ENTROPY_DEBUG, "1")) {
    if (EXPAT_ENTROPY_DEBUG && ! strcmp(EXPAT_ENTROPY_DEBUG, "1")) {
      fprintf(stderr, "Entropy: %s --> 0x%0*lx (%lu bytes)\n",
      fprintf(stderr, "Entropy: %s --> 0x%0*lx (%lu bytes)\n",
          label,
          label,
-

+ 1 - 2
comm-esr60/mozilla-esr60/patches/1518762-66a1.patch → rel-257/mozilla-esr60/patches/1518762-66a1.patch

@@ -2,7 +2,7 @@
 # User Rob Wu <rob@robwu.nl>
 # User Rob Wu <rob@robwu.nl>
 # Date 1548173799 0
 # Date 1548173799 0
 # Node ID e26eda77b71c6c02db69441236dd95fc0db5c7f2
 # Node ID e26eda77b71c6c02db69441236dd95fc0db5c7f2
-# Parent  8ba5964567a64f6a09b4de8ea4f8e8d151958f00
+# Parent  41ccaba649c95b9c578b55d966a5ed2845419f14
 Bug 1518762 - Avoid error in psutil.disk_io_counters in resourcemonitor r=ahal
 Bug 1518762 - Avoid error in psutil.disk_io_counters in resourcemonitor r=ahal
 
 
 Imports https://github.com/giampaolo/psutil/commit/8f99f3782663959062ee868bbfdbc336307a3a4d
 Imports https://github.com/giampaolo/psutil/commit/8f99f3782663959062ee868bbfdbc336307a3a4d
@@ -46,4 +46,3 @@ diff --git a/third_party/python/psutil/psutil/_pslinux.py b/third_party/python/p
              # Linux 2.6+, line referring to a partition
              # Linux 2.6+, line referring to a partition
              name = fields[2]
              name = fields[2]
              reads, rbytes, writes, wbytes = map(int, fields[3:])
              reads, rbytes, writes, wbytes = map(int, fields[3:])
-

+ 1 - 1
comm-esr60/mozilla-esr60/patches/1519209-66a1.patch → rel-257/mozilla-esr60/patches/1519209-66a1.patch

@@ -2,7 +2,7 @@
 # User Eric Rahm <erahm@mozilla.com>
 # User Eric Rahm <erahm@mozilla.com>
 # Date 1547154881 28800
 # Date 1547154881 28800
 # Node ID 0801165e31759dfe84480650d254924336e4fe76
 # Node ID 0801165e31759dfe84480650d254924336e4fe76
-# Parent  de94c19be86a1f940e3395d75be48e24f989d9dc
+# Parent  07245d176ba65bd89b76b246a1d89c7eb7ecc5b7
 Bug 1519209 - Disable NSS_ALLOW_SSLKEYLOGFILE in beta and release. r=glandium
 Bug 1519209 - Disable NSS_ALLOW_SSLKEYLOGFILE in beta and release. r=glandium
 
 
 This disables NSS_ALLOW_SSLKEYLOGFILE in beta in release in order to avoid shutdown hangs until the NSS project has time to fix the root cause of the issue.
 This disables NSS_ALLOW_SSLKEYLOGFILE in beta in release in order to avoid shutdown hangs until the NSS project has time to fix the root cause of the issue.

+ 13 - 18
comm-esr60/mozilla-esr60/patches/1541282-68a1.patch → rel-257/mozilla-esr60/patches/1541282-68a1.patch

@@ -2,7 +2,7 @@
 # User Randall E. Barker <rbarker@mozilla.com>
 # User Randall E. Barker <rbarker@mozilla.com>
 # Date 1554251002 0
 # Date 1554251002 0
 # Node ID dbb61d5c5944a9394e87244dace7ebfd5b0b0801
 # Node ID dbb61d5c5944a9394e87244dace7ebfd5b0b0801
-# Parent  ad192c5c9192a1dac9ad38a23316f73995c42395
+# Parent  aef98278b81af78a26e42f1f18eb3a96969b385d
 Bug 1541282 - Use native call in NS_SetCurrentThreadName() on Android r=froydnj
 Bug 1541282 - Use native call in NS_SetCurrentThreadName() on Android r=froydnj
 
 
 PR_SetCurrentThreadName() is broken on Android (Bug 1541216).
 PR_SetCurrentThreadName() is broken on Android (Bug 1541216).
@@ -15,7 +15,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D25891
 diff --git a/xpcom/threads/nsThreadUtils.cpp b/xpcom/threads/nsThreadUtils.cpp
 diff --git a/xpcom/threads/nsThreadUtils.cpp b/xpcom/threads/nsThreadUtils.cpp
 --- a/xpcom/threads/nsThreadUtils.cpp
 --- a/xpcom/threads/nsThreadUtils.cpp
 +++ b/xpcom/threads/nsThreadUtils.cpp
 +++ b/xpcom/threads/nsThreadUtils.cpp
-@@ -19,16 +19,20 @@
+@@ -22,16 +22,20 @@
  #endif
  #endif
  
  
  #ifdef XP_WIN
  #ifdef XP_WIN
@@ -25,19 +25,18 @@ diff --git a/xpcom/threads/nsThreadUtils.cpp b/xpcom/threads/nsThreadUtils.cpp
  #endif
  #endif
  
  
 +#if defined(ANDROID)
 +#if defined(ANDROID)
-+#  include <sys/prctl.h>
++#include <sys/prctl.h>
 +#endif
 +#endif
 +
 +
- #ifdef MOZ_CRASHREPORTER
- #include "nsExceptionHandler.h"
- #endif
- 
  using namespace mozilla;
  using namespace mozilla;
  
  
  #ifndef XPCOM_GLUE_AVOID_NSPR
  #ifndef XPCOM_GLUE_AVOID_NSPR
  
  
-@@ -475,20 +479,24 @@ NS_ProcessNextEvent(nsIThread* aThread, 
-     }
+ NS_IMPL_ISUPPORTS(IdlePeriod, nsIIdlePeriod)
+ 
+ NS_IMETHODIMP
+ IdlePeriod::GetIdlePeriodHint(TimeStamp* aIdleDeadline) {
+@@ -451,17 +455,22 @@ bool NS_ProcessNextEvent(nsIThread* aThr
      aThread = current.get();
      aThread = current.get();
    }
    }
  #endif
  #endif
@@ -45,22 +44,18 @@ diff --git a/xpcom/threads/nsThreadUtils.cpp b/xpcom/threads/nsThreadUtils.cpp
    return NS_SUCCEEDED(aThread->ProcessNextEvent(aMayWait, &val)) && val;
    return NS_SUCCEEDED(aThread->ProcessNextEvent(aMayWait, &val)) && val;
  }
  }
  
  
--void
--NS_SetCurrentThreadName(const char* aName)
--{
-+void NS_SetCurrentThreadName(const char* aName) {
+ void NS_SetCurrentThreadName(const char* aName) {
 +#if defined(ANDROID)
 +#if defined(ANDROID)
 +  // Workaround for Bug 1541216 - PR_SetCurrentThreadName() Fails to set the thread name on Android.
 +  // Workaround for Bug 1541216 - PR_SetCurrentThreadName() Fails to set the thread name on Android.
 +  prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(aName));
 +  prctl(PR_SET_NAME, reinterpret_cast<unsigned long>(aName));
 +#else
 +#else
    PR_SetCurrentThreadName(aName);
    PR_SetCurrentThreadName(aName);
 +#endif
 +#endif
-+
- #ifdef MOZ_CRASHREPORTER
    CrashReporter::SetCurrentThreadName(aName);
    CrashReporter::SetCurrentThreadName(aName);
- #endif
  }
  }
  
  
  #ifdef MOZILLA_INTERNAL_API
  #ifdef MOZILLA_INTERNAL_API
- nsIThread*
- NS_GetCurrentThread()
+ nsIThread* NS_GetCurrentThread() {
+   return nsThreadManager::get().GetCurrentThread();
+ }
+ 

+ 5 - 7
comm-esr60/mozilla-esr60/patches/1574573-70a1.patch → rel-257/mozilla-esr60/patches/1574573-70a1.patch

@@ -2,7 +2,7 @@
 # User David Major <dmajor@mozilla.com>
 # User David Major <dmajor@mozilla.com>
 # Date 1566003979 0
 # Date 1566003979 0
 # Node ID d9bd2bdfa7a6b7fc5359a0b3e0265ad19694fad7
 # Node ID d9bd2bdfa7a6b7fc5359a0b3e0265ad19694fad7
-# Parent  f439f876d0cfe7761d7219eee302b7623b26612f
+# Parent  9369a02e25706ac8dd33decee5c25c88147a3199
 Bug 1574573 - Disambiguate a use of `Handle` in XPCShellEnvironment.cpp r=Ehsan
 Bug 1574573 - Disambiguate a use of `Handle` in XPCShellEnvironment.cpp r=Ehsan
 
 
 Otherwise it could also refer to Handle from MacTypes.h.
 Otherwise it could also refer to Handle from MacTypes.h.
@@ -12,8 +12,7 @@ Differential Revision: https://phabricator.services.mozilla.com/D42358
 diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
 diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
 --- a/ipc/testshell/XPCShellEnvironment.cpp
 --- a/ipc/testshell/XPCShellEnvironment.cpp
 +++ b/ipc/testshell/XPCShellEnvironment.cpp
 +++ b/ipc/testshell/XPCShellEnvironment.cpp
-@@ -49,19 +49,17 @@ using mozilla::AutoSafeJSContext;
- using mozilla::dom::AutoJSAPI;
+@@ -50,17 +50,17 @@ using mozilla::dom::AutoJSAPI;
  using mozilla::dom::AutoEntryScript;
  using mozilla::dom::AutoEntryScript;
  using namespace JS;
  using namespace JS;
  
  
@@ -21,10 +20,10 @@ diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvir
  
  
  static const char kDefaultRuntimeScriptFilename[] = "xpcshell.js";
  static const char kDefaultRuntimeScriptFilename[] = "xpcshell.js";
  
  
--inline XPCShellEnvironment*
+ inline XPCShellEnvironment*
 -Environment(Handle<JSObject*> global)
 -Environment(Handle<JSObject*> global)
--{
-+inline XPCShellEnvironment* Environment(JS::Handle<JSObject*> global) {
++Environment(JS::Handle<JSObject*> global)
+ {
      AutoJSAPI jsapi;
      AutoJSAPI jsapi;
      if (!jsapi.Init(global)) {
      if (!jsapi.Init(global)) {
          return nullptr;
          return nullptr;
@@ -32,4 +31,3 @@ diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvir
      JSContext* cx = jsapi.cx();
      JSContext* cx = jsapi.cx();
      Rooted<Value> v(cx);
      Rooted<Value> v(cx);
      if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", &v) ||
      if (!JS_GetProperty(cx, global, "__XPCShellEnvironment", &v) ||
-         !v.get().isDouble())

+ 23 - 23
comm-esr60/mozilla-esr60/patches/1576463-71a1.patch → rel-257/mozilla-esr60/patches/1576463-71a1.patch

@@ -2,7 +2,7 @@
 # User Andrea Marchesini <amarchesini@mozilla.com>
 # User Andrea Marchesini <amarchesini@mozilla.com>
 # Date 1568179004 0
 # Date 1568179004 0
 # Node ID 30509dab7f702a13cb37d8244f8f49f33ac4d68e
 # Node ID 30509dab7f702a13cb37d8244f8f49f33ac4d68e
-# Parent  d5d76f39e5ff06a03edb9eb0f212bde0a71b77ba
+# Parent  d83622ebdc5251f54861020747d882c85e31b9b6
 Bug 1576463 - canvas toDataURL and toBlob should not throw for serialization errors, r=jya
 Bug 1576463 - canvas toDataURL and toBlob should not throw for serialization errors, r=jya
 
 
 Differential Revision: https://phabricator.services.mozilla.com/D45121
 Differential Revision: https://phabricator.services.mozilla.com/D45121
@@ -10,12 +10,12 @@ Differential Revision: https://phabricator.services.mozilla.com/D45121
 diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp
 diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp
 --- a/dom/base/ImageEncoder.cpp
 --- a/dom/base/ImageEncoder.cpp
 +++ b/dom/base/ImageEncoder.cpp
 +++ b/dom/base/ImageEncoder.cpp
-@@ -102,18 +102,21 @@ public:
+@@ -96,16 +96,18 @@ class EncodingCompleteEvent : public Can
  
  
      if (!mFailed) {
      if (!mFailed) {
        // The correct parentObject has to be set by the mEncodeCompleteCallback.
        // The correct parentObject has to be set by the mEncodeCompleteCallback.
        RefPtr<Blob> blob =
        RefPtr<Blob> blob =
-         Blob::CreateMemoryBlob(nullptr, mImgData, mImgSize, mType);
+           Blob::CreateMemoryBlob(nullptr, mImgData, mImgSize, mType);
        MOZ_ASSERT(blob);
        MOZ_ASSERT(blob);
  
  
        rv = mEncodeCompleteCallback->ReceiveBlob(blob.forget());
        rv = mEncodeCompleteCallback->ReceiveBlob(blob.forget());
@@ -23,26 +23,23 @@ diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp
 +      rv = mEncodeCompleteCallback->ReceiveBlob(nullptr);
 +      rv = mEncodeCompleteCallback->ReceiveBlob(nullptr);
      }
      }
  
  
-+
      mEncodeCompleteCallback = nullptr;
      mEncodeCompleteCallback = nullptr;
  
  
      return rv;
      return rv;
    }
    }
  
  
-   void SetMembers(void* aImgData, uint64_t aImgSize, const nsAutoString& aType)
-   {
-     mImgData = aImgData;
+   void SetMembers(void* aImgData, uint64_t aImgSize,
 diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRenderingContextHelper.cpp
 diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRenderingContextHelper.cpp
 --- a/dom/canvas/CanvasRenderingContextHelper.cpp
 --- a/dom/canvas/CanvasRenderingContextHelper.cpp
 +++ b/dom/canvas/CanvasRenderingContextHelper.cpp
 +++ b/dom/canvas/CanvasRenderingContextHelper.cpp
-@@ -46,17 +46,21 @@ CanvasRenderingContextHelper::ToBlob(JSC
-         rv.SuppressException();
-       } else {
-         AutoJSAPI jsapi;
-         if (jsapi.Init(mGlobal)) {
-           JS_updateMallocCounter(jsapi.cx(), size);
-         }
-       }
+@@ -29,19 +29,24 @@ void CanvasRenderingContextHelper::ToBlo
+    public:
+     EncodeCallback(nsIGlobalObject* aGlobal, BlobCallback* aCallback)
+         : mGlobal(aGlobal), mBlobCallback(aCallback) {}
+ 
+     // This is called on main thread.
+     nsresult ReceiveBlob(already_AddRefed<Blob> aBlob) override {
+       RefPtr<Blob> blob = aBlob;
  
  
 -      RefPtr<Blob> newBlob = Blob::Create(mGlobal, blob->Impl());
 -      RefPtr<Blob> newBlob = Blob::Create(mGlobal, blob->Impl());
 +      RefPtr<Blob> newBlob;
 +      RefPtr<Blob> newBlob;
@@ -51,6 +48,8 @@ diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRend
 +        newBlob = Blob::Create(mGlobal, blob->Impl());
 +        newBlob = Blob::Create(mGlobal, blob->Impl());
 +      }
 +      }
  
  
+       ErrorResult rv;
++
        mBlobCallback->Call(newBlob, rv);
        mBlobCallback->Call(newBlob, rv);
  
  
        mGlobal = nullptr;
        mGlobal = nullptr;
@@ -58,14 +57,15 @@ diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRend
  
  
        return rv.StealNSResult();
        return rv.StealNSResult();
      }
      }
+ 
 diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp
 diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp
 --- a/dom/html/HTMLCanvasElement.cpp
 --- a/dom/html/HTMLCanvasElement.cpp
 +++ b/dom/html/HTMLCanvasElement.cpp
 +++ b/dom/html/HTMLCanvasElement.cpp
-@@ -653,17 +653,20 @@ HTMLCanvasElement::ToDataURL(JSContext* 
- {
-   // do a trust check if this is a write-only canvas
-   if (mWriteOnly &&
-       !nsContentUtils::CallerHasPermission(aCx, NS_LITERAL_STRING("<all_urls>"))) {
+@@ -587,17 +587,20 @@ void HTMLCanvasElement::ToDataURL(JSCont
+                                   JS::Handle<JS::Value> aParams,
+                                   nsAString& aDataURL, ErrorResult& aRv) {
+   // mWriteOnly check is redundant, but optimizes for the common case.
+   if (mWriteOnly && !CallerCanRead(aCx)) {
      aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
      aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
      return;
      return;
    }
    }
@@ -77,9 +77,9 @@ diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp
 +  }
 +  }
  }
  }
  
  
- void
- HTMLCanvasElement::SetMozPrintCallback(PrintCallback* aCallback)
- {
+ void HTMLCanvasElement::SetMozPrintCallback(PrintCallback* aCallback) {
    mPrintCallback = aCallback;
    mPrintCallback = aCallback;
  }
  }
  
  
+ PrintCallback* HTMLCanvasElement::GetMozPrintCallback() const {
+   if (mOriginalCanvas) {

+ 16 - 0
rel-257/mozilla-esr60/patches/series

@@ -58,3 +58,19 @@ NOBUG-0c5f5c2e2a86-64a1.patch
 1477799-63a1.patch
 1477799-63a1.patch
 1473732-63a1.patch
 1473732-63a1.patch
 1578075-71a1.patch
 1578075-71a1.patch
+1574573-70a1.patch
+1576463-71a1.patch
+1518762-66a1.patch
+1519209-66a1.patch
+1516642-67a1.patch
+1401776-62a1.patch
+1516325-68a1.patch
+1541282-68a1.patch
+1496823-1-64a1.patch
+1496823-2-64a1.patch
+1496823-3-64a1.patch
+1496823-4-64a1.patch
+1496823-5-64a1.patch
+1496823-6-64a1.patch
+1496823-7-64a1.patch
+1496823-8-64a1.patch