Bug 974127 - nsContentUtils::IsUserFocusIgnored can loop infinitely, r=ehsan
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Fri, 21 Feb 2014 01:52:02 +0200
changeset 170140 d3b246449a75f182807b6b45aecdf11902f01fcc
parent 170139 774001539b7ee989428bb41be52320855600c811
child 170141 128cbf1edc402482d096b0acc820549b0a7ebe68
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersehsan
bugs974127
milestone30.0a1
Bug 974127 - nsContentUtils::IsUserFocusIgnored can loop infinitely, r=ehsan
content/base/src/nsContentUtils.cpp
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -5837,19 +5837,17 @@ nsContentUtils::IsUserFocusIgnored(nsINo
   while (aNode) {
     nsCOMPtr<nsIMozBrowserFrame> browserFrame = do_QueryInterface(aNode);
     if (browserFrame &&
         aNode->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::ignoreuserfocus) &&
         browserFrame->GetReallyIsBrowserOrApp()) {
       return true;
     }
     nsPIDOMWindow* win = aNode->OwnerDoc()->GetWindow();
-    if (win) {
-      aNode = win->GetFrameElementInternal();
-    }
+    aNode = win ? win->GetFrameElementInternal() : nullptr;
   }
 
   return false;
 }
 
 bool
 nsContentUtils::HasScrollgrab(nsIContent* aContent)
 {