Bug 1182551 - Updating nsSecureBrowserUIImpl so that insecure pages with mixed content iframes don't get marked as broken. r=keeler
authorTanvi Vyas <tanvi@mozilla.com>
Thu, 13 Aug 2015 17:13:48 -0700
changeset 257743 7d8a664fd55b6d1faf6b088c90706d5c2e4a59ec
parent 257742 e8d8f8d2d9c0b2c874738c1b8ad2ae51019defa3
child 257744 a0ab71814ee94ab9d872fdb8a7ef0fe3e31a23ad
push id29226
push userryanvm@gmail.com
push dateFri, 14 Aug 2015 13:01:14 +0000
treeherdermozilla-central@1b2402247429 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskeeler
bugs1182551
milestone43.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 1182551 - Updating nsSecureBrowserUIImpl so that insecure pages with mixed content iframes don't get marked as broken. r=keeler
security/manager/ssl/nsSecureBrowserUIImpl.cpp
--- a/security/manager/ssl/nsSecureBrowserUIImpl.cpp
+++ b/security/manager/ssl/nsSecureBrowserUIImpl.cpp
@@ -258,28 +258,34 @@ nsSecureBrowserUIImpl::MapInternalToExte
       !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 so, the state should be broken or insecure; overriding the previous
+  // state set by the lock parameter.
+  uint32_t tempState = STATE_IS_BROKEN;
+  if (lock == lis_no_security) {
+      // this is to ensure that http: pages with mixed content in nested
+      // iframes don't get marked as broken instead of insecure
+      tempState = STATE_IS_INSECURE;
+  }
   if (docShell->GetHasMixedActiveContentLoaded() &&
       docShell->GetHasMixedDisplayContentLoaded()) {
-      *aState = STATE_IS_BROKEN |
+      *aState = tempState |
                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT |
                 nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
   } else if (docShell->GetHasMixedActiveContentLoaded()) {
-      *aState = STATE_IS_BROKEN |
+      *aState = tempState |
                 nsIWebProgressListener::STATE_LOADED_MIXED_ACTIVE_CONTENT;
   } else if (docShell->GetHasMixedDisplayContentLoaded()) {
-      *aState = STATE_IS_BROKEN |
+      *aState = tempState |
                 nsIWebProgressListener::STATE_LOADED_MIXED_DISPLAY_CONTENT;
   }
 
   // Has Mixed Content Been Blocked in nsMixedContentBlocker?
   if (docShell->GetHasMixedActiveContentBlocked())
     *aState |= nsIWebProgressListener::STATE_BLOCKED_MIXED_ACTIVE_CONTENT;
 
   if (docShell->GetHasMixedDisplayContentBlocked())