NS_ENSURE_TRUE(privateWin, NS_ERROR_FAILURE);
DocumentViewerImpl::GetPopupNode(nsIDOMNode** aNode){  NS_ENSURE_ARG_POINTER(aNode);  nsresult rv;  // get the document  nsCOMPtr<nsIDocument> document;  rv = GetDocument(getter_AddRefs(document));  NS_ENSURE_SUCCESS(rv, rv);  NS_ENSURE_TRUE(document, NS_ERROR_FAILURE);  // get the script global object  nsCOMPtr<nsIScriptGlobalObject> global;  rv = document->GetScriptGlobalObject(getter_AddRefs(global));  NS_ENSURE_SUCCESS(rv, rv);  NS_ENSURE_TRUE(global, NS_ERROR_FAILURE);  // get the internal dom window  nsCOMPtr<nsIDOMWindowInternal> internalWin(do_QueryInterface(global, &rv));  NS_ENSURE_SUCCESS(rv, rv);  NS_ENSURE_TRUE(internalWin, NS_ERROR_FAILURE);  // get the private dom window  nsCOMPtr<nsPIDOMWindow> privateWin(do_QueryInterface(internalWin, &rv));  NS_ENSURE_SUCCESS(rv, rv);  NS_ENSURE_TRUE(privateWin, NS_ERROR_FAILURE);  // get the focus controller  nsCOMPtr<nsIFocusController> focusController;  rv = privateWin->GetRootFocusController(getter_AddRefs(focusController));  NS_ENSURE_SUCCESS(rv, rv);  NS_ENSURE_TRUE(focusController, NS_ERROR_FAILURE);  // get the popup node  rv = focusController->GetPopupNode(aNode); // addref happens here  NS_ENSURE_SUCCESS(rv, rv);  return rv;}