Backed out changeset 1d88072cf36a (bug 1277803)
authorIris Hsiao <ihsiao@mozilla.com>
Fri, 07 Oct 2016 11:23:59 +0800
changeset 316920 4fa3174811052c6220a016ab98287c1a4763cffd
parent 316919 45798b451d74fa2a411122e4d8875c0e962dca1f
child 316921 d7790b3df5921e31f1a7cdf49475e97133892f1c
push id30787
push userryanvm@gmail.com
push dateFri, 07 Oct 2016 13:42:34 +0000
treeherdermozilla-central@ea8624a9b11e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1277803
milestone52.0a1
backs out1d88072cf36af970f3341b99f4eeada61875586a
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
Backed out changeset 1d88072cf36a (bug 1277803) CLOSED TREE
browser/base/content/tabbrowser.xml
dom/base/nsGkAtomList.h
layout/xul/nsImageBoxFrame.cpp
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -6455,17 +6455,17 @@
                     class="tab-background-end"/>
         </xul:hbox>
         <xul:hbox xbl:inherits="pinned,selected=visuallyselected,titlechanged,attention"
                   class="tab-content" align="center">
           <xul:image xbl:inherits="fadein,pinned,busy,progress,selected=visuallyselected"
                      class="tab-throbber"
                      role="presentation"
                      layer="true" />
-          <xul:image xbl:inherits="src=image,loadingprincipal=iconLoadingPrincipal,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
+          <xul:image xbl:inherits="src=image,fadein,pinned,selected=visuallyselected,busy,crashed,sharing"
                      anonid="tab-icon-image"
                      class="tab-icon-image"
                      validate="never"
                      role="presentation"/>
           <xul:image xbl:inherits="sharing,selected=visuallyselected"
                      anonid="sharing-icon"
                      class="tab-sharing-icon-overlay"
                      role="presentation"/>
--- a/dom/base/nsGkAtomList.h
+++ b/dom/base/nsGkAtomList.h
@@ -552,17 +552,16 @@ GK_ATOM(listcol, "listcol")
 GK_ATOM(listcols, "listcols")
 GK_ATOM(listener, "listener")
 GK_ATOM(listhead, "listhead")
 GK_ATOM(listheader, "listheader")
 GK_ATOM(listing, "listing")
 GK_ATOM(listitem, "listitem")
 GK_ATOM(listrows, "listrows")
 GK_ATOM(load, "load")
-GK_ATOM(loadingprincipal, "loadingprincipal")
 GK_ATOM(localedir, "localedir")
 GK_ATOM(localName, "local-name")
 GK_ATOM(longdesc, "longdesc")
 GK_ATOM(loop, "loop")
 GK_ATOM(low, "low")
 GK_ATOM(lowerFirst, "lower-first")
 GK_ATOM(lowest, "lowest")
 GK_ATOM(lowsrc, "lowsrc")
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -43,17 +43,16 @@
 #include "nsIURI.h"
 #include "nsThreadUtils.h"
 #include "nsDisplayList.h"
 #include "ImageLayers.h"
 #include "ImageContainer.h"
 #include "nsIContent.h"
 
 #include "nsContentUtils.h"
-#include "nsSerializationHelper.h"
 
 #include "mozilla/BasicEvents.h"
 #include "mozilla/EventDispatcher.h"
 #include "mozilla/Maybe.h"
 
 #define ONLOAD_CALLED_TOO_EARLY 1
 
 using namespace mozilla;
@@ -222,51 +221,27 @@ nsImageBoxFrame::UpdateImage()
 
   // get the new image src
   nsAutoString src;
   mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::src, src);
   mUseSrcAttr = !src.IsEmpty();
   if (mUseSrcAttr) {
     nsIDocument* doc = mContent->GetComposedDoc();
     if (doc) {
-      // Use the serialized loadingPrincipal from the image element. Fall back
-      // to mContent's principal (SystemPrincipal) if not available.
-      nsContentPolicyType contentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE;
-      nsCOMPtr<nsIPrincipal> loadingPrincipal = mContent->NodePrincipal();
-      nsAutoString imageLoadingPrincipal;
-      mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::loadingprincipal,
-                        imageLoadingPrincipal);
-      if (!imageLoadingPrincipal.IsEmpty()) {
-        nsCOMPtr<nsISupports> serializedPrincipal;
-        NS_DeserializeObject(NS_ConvertUTF16toUTF8(imageLoadingPrincipal),
-                             getter_AddRefs(serializedPrincipal));
-        loadingPrincipal = do_QueryInterface(serializedPrincipal);
-
-        if (loadingPrincipal) {
-          // Set the content policy type to TYPE_INTERNAL_IMAGE_FAVICON for
-          // indicating it's a favicon loading.
-          contentPolicyType = nsIContentPolicy::TYPE_INTERNAL_IMAGE_FAVICON;
-        } else {
-          // Fallback if the deserialization is failed.
-          loadingPrincipal = mContent->NodePrincipal();
-        }
-      }
-
       nsCOMPtr<nsIURI> baseURI = mContent->GetBaseURI();
       nsCOMPtr<nsIURI> uri;
       nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(uri),
                                                 src,
                                                 doc,
                                                 baseURI);
       if (uri) {
-        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, loadingPrincipal,
+        nsresult rv = nsContentUtils::LoadImage(uri, mContent, doc, mContent->NodePrincipal(),
                                                 doc->GetDocumentURI(), doc->GetReferrerPolicy(),
                                                 mListener, mLoadFlags,
-                                                EmptyString(), getter_AddRefs(mImageRequest),
-                                                contentPolicyType);
+                                                EmptyString(), getter_AddRefs(mImageRequest));
 
         if (NS_SUCCEEDED(rv) && mImageRequest) {
           nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
                                                         mImageRequest,
                                                         &mRequestRegistered);
         }
       }
     }