Bug 947079 - Hack to prevent getting a mixed content icon on a fully secure page. r=keeler
authorTanvi Vyas <tvyas@mozilla.com>
Thu, 26 Mar 2015 11:54:53 -0700
changeset 264817 a2882af29c29c556704d0a201e5e94fc8aa5fe4b
parent 264816 765a0adb9d7cb221786d544984cc833a75536bd6
child 264818 23edaf5ea79a6c0df12a54541426ce34e4ad532d
push id4718
push userraliiev@mozilla.com
push dateMon, 11 May 2015 18:39:53 +0000
treeherdermozilla-beta@c20c4ef55f08 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs947079
milestone39.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
Bug 947079 - Hack to prevent getting a mixed content icon on a fully secure page. r=keeler
security/manager/boot/src/nsSecureBrowserUIImpl.cpp
--- a/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/boot/src/nsSecureBrowserUIImpl.cpp
@@ -256,17 +256,29 @@ nsSecureBrowserUIImpl::MapInternalToExte
     docShellTreeItem->GetSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     NS_ASSERTION(sameTypeRoot, "No document shell root tree item from document shell tree item!");
     docShell = do_QueryInterface(sameTypeRoot);
     if (!docShell)
       return NS_OK;
   }
 
   // Has a Mixed Content Load initiated in nsMixedContentBlocker?
-  // If so, the state should be broken; overriding the previous state
+  // * If not, the state should not be broken because of mixed content;
+  // overriding the previous state if it is inaccurately flagged as mixed.
+  if (lock == lis_mixed_security &&
+      !docShell->GetHasMixedActiveContentLoaded() &&
+      !docShell->GetHasMixedDisplayContentLoaded() &&
+      !docShell->GetHasMixedActiveContentBlocked() &&
+      !docShell->GetHasMixedDisplayContentBlocked()) {
+    *aState = STATE_IS_SECURE;
+    if (ev) {
+      *aState |= nsIWebProgressListener::STATE_IDENTITY_EV_TOPLEVEL;
+    }
+  }
+  // * If so, the state should be broken; overriding the previous state
   // set by the lock parameter.
   if (docShell->GetHasMixedActiveContentLoaded() &&
       docShell->GetHasMixedDisplayContentLoaded()) {
       *aState = STATE_IS_BROKEN |
                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT |
                 nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
   } else if (docShell->GetHasMixedActiveContentLoaded()) {
       *aState = STATE_IS_BROKEN |