Merge mozilla-central to autoland. CLOSED TREE
authorCsoregi Natalia <ncsoregi@mozilla.com>
Fri, 16 Aug 2019 07:03:46 +0300
changeset 488426 37aaf28a693732407ded4ab9e7e153bc680f02a6
parent 488425 11919743f599ec393c72c61ee7e18ed52b56e435 (current diff)
parent 488384 d887276421d30c773431c006b0607cd30f4d9259 (diff)
child 488427 1050dca058c32f29609390345646ffde7e9f6114
push id113908
push userccoroiu@mozilla.com
push dateFri, 16 Aug 2019 09:57:53 +0000
treeherdermozilla-inbound@83fad6abe38a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to autoland. CLOSED TREE
devtools/client/debugger/src/actions/tests/helpers/mockCommandClient.js
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -326,16 +326,17 @@
 #include "mozilla/MediaManager.h"
 
 #include "AutoplayPolicy.h"
 #include "nsIURIMutator.h"
 #include "mozilla/DocumentStyleRootIterator.h"
 #include "mozilla/PendingFullscreenEvent.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/ClearOnShutdown.h"
+#include "mozilla/ResultExtensions.h"
 #include "nsHTMLTags.h"
 #include "MobileViewportManager.h"
 #include "NodeUbiReporting.h"
 #include "nsICookieService.h"
 #include "mozilla/net/ChannelEventQueue.h"
 #include "mozilla/net/RequestContextService.h"
 #include "StorageAccessPermissionRequest.h"
 #include "mozilla/dom/WindowProxyHolder.h"
@@ -5745,16 +5746,24 @@ void Document::SetBaseURI(nsIURI* aURI) 
       return;
     }
   }
 
   mDocumentBaseURI = aURI;
   RefreshLinkHrefs();
 }
 
+Result<nsCOMPtr<nsIURI>, nsresult> Document::ResolveWithBaseURI(
+    const nsAString& aURI) {
+  nsCOMPtr<nsIURI> resolvedURI;
+  MOZ_TRY(
+      NS_NewURI(getter_AddRefs(resolvedURI), aURI, nullptr, GetDocBaseURI()));
+  return std::move(resolvedURI);
+}
+
 URLExtraData* Document::DefaultStyleAttrURLData() {
   MOZ_ASSERT(NS_IsMainThread());
   nsIURI* baseURI = GetDocBaseURI();
   nsIPrincipal* principal = NodePrincipal();
   bool equals;
   if (!mCachedURLData || mCachedURLData->BaseURI() != baseURI ||
       mCachedURLData->Principal() != principal || !mCachedReferrerInfo ||
       NS_FAILED(mCachedURLData->ReferrerInfo()->Equals(mCachedReferrerInfo,
--- a/dom/base/Document.h
+++ b/dom/base/Document.h
@@ -906,16 +906,21 @@ class Document : public nsINode,
     return GetFallbackBaseURI();
   }
 
   nsIURI* GetBaseURI(bool aTryUseXHRDocBaseURI = false) const final;
 
   void SetBaseURI(nsIURI* aURI);
 
   /**
+   * Resolves a URI based on the document's base URI.
+   */
+  Result<nsCOMPtr<nsIURI>, nsresult> ResolveWithBaseURI(const nsAString& aURI);
+
+  /**
    * Return the URL data which style system needs for resolving url value.
    * This method attempts to use the cached object in mCachedURLData, but
    * if the base URI, document URI, or principal has changed since last
    * call to this function, or the function is called the first time for
    * the document, a new one is created.
    */
   URLExtraData* DefaultStyleAttrURLData();
 
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -3706,16 +3706,24 @@ nsresult nsWindow::Create(nsIWidget* aPa
           GdkVisual* visual = gdk_screen_get_rgba_visual(screen);
           if (visual) {
             gtk_widget_set_visual(mShell, visual);
             mHasAlphaVisual = true;
           }
         }
       }
 
+      // We have a toplevel window with transparency. Mark it as transparent
+      // now as nsWindow::SetTransparencyMode() can't be called after
+      // nsWindow is created (Bug 1344839).
+      if (mWindowType == eWindowType_toplevel &&
+          (mHasAlphaVisual || mTransparencyBitmapForTitlebar)) {
+        mIsTransparent = true;
+      }
+
       // We only move a general managed toplevel window if someone has
       // actually placed the window somewhere.  If no placement has taken
       // place, we just let the window manager Do The Right Thing.
       NativeResize();
 
       if (mWindowType == eWindowType_dialog) {
         SetDefaultIcon();
         gtk_window_set_wmclass(GTK_WINDOW(mShell), "Dialog",
@@ -4439,39 +4447,31 @@ void nsWindow::SetTransparencyMode(nsTra
     topWindow->SetTransparencyMode(aMode);
     return;
   }
 
   bool isTransparent = aMode == eTransparencyTransparent;
 
   if (mIsTransparent == isTransparent) {
     return;
-  }
-  if (mWindowType != eWindowType_popup && !mHasAlphaVisual &&
-      !mTransparencyBitmapForTitlebar) {
-    // https://bugzilla.mozilla.org/show_bug.cgi?id=1344839 reported
-    // problems cleaning the layer manager for toplevel windows, so ignore
-    // the request to workaround that.
+  } else if (mWindowType != eWindowType_popup) {
     NS_WARNING("Cannot set transparency mode on non-popup windows.");
     return;
   }
 
   if (!isTransparent) {
     ClearTransparencyBitmap();
   }  // else the new default alpha values are "all 1", so we don't
   // need to change anything yet
 
   mIsTransparent = isTransparent;
 
-  if (!mHasAlphaVisual && !mTransparencyBitmapForTitlebar) {
-    // The choice of layer manager depends on
-    // GtkCompositorWidgetInitData::Shaped(), which will need to change, so
-    // clean out the old layer manager.
-    CleanLayerManagerRecursive();
-  }
+  // Need to clean our LayerManager up while still alive because
+  // we don't want to use layers acceleration on shaped windows
+  CleanLayerManagerRecursive();
 }
 
 nsTransparencyMode nsWindow::GetTransparencyMode() {
   if (!mShell) {
     // Pass the request to the toplevel window
     GtkWidget* topWidget = GetToplevelWidget();
     if (!topWidget) {
       return eTransparencyOpaque;