if (isMsgPane)
if (isMsgPane) {
nsPluginDocument::CreateSyntheticPluginDocument(){  // do not allow message panes to host full-page plugins  // returning an error causes helper apps to take over  nsCOMPtr<nsIDocShellTreeItem> dsti (do_QueryReferent(mDocumentContainer));  if (dsti) {    PRBool isMsgPane = PR_FALSE;    dsti->NameEquals(NS_LITERAL_STRING("messagepane").get(), &isMsgPane);    if (isMsgPane)      return NS_ERROR_FAILURE;  }  // make our generic document  nsresult rv = nsMediaDocument::CreateSyntheticDocument();  NS_ENSURE_SUCCESS(rv, rv);  // then attach our plugin  nsCOMPtr<nsIContent> body = do_QueryInterface(mBodyContent);  if (!body) {    NS_WARNING("no body on plugin document!");    return NS_ERROR_FAILURE;  }  // remove margins from body  NS_NAMED_LITERAL_STRING(zero, "0");  body->SetAttr(kNameSpaceID_None, nsHTMLAtoms::marginwidth, zero, PR_FALSE);  body->SetAttr(kNameSpaceID_None, nsHTMLAtoms::marginheight, zero, PR_FALSE);  // make plugin content  nsCOMPtr<nsINodeInfo> nodeInfo;  rv = mNodeInfoManager->GetNodeInfo(nsHTMLAtoms::embed, nsnull,                                     kNameSpaceID_None,                                    getter_AddRefs(nodeInfo));  NS_ENSURE_SUCCESS(rv, rv);  mPluginContent = NS_NewHTMLSharedElement(nodeInfo);  if (!mPluginContent) {    return NS_ERROR_OUT_OF_MEMORY;  }  // make it a named element  mPluginContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::name,                          NS_LITERAL_STRING("plugin"), PR_FALSE);  // fill viewport and auto-resize  NS_NAMED_LITERAL_STRING(percent100, "100%");  mPluginContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::width, percent100,                          PR_FALSE);  mPluginContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::height, percent100,                          PR_FALSE);  // set URL  nsCAutoString src;  mDocumentURI->GetSpec(src);  mPluginContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::src,                          NS_ConvertUTF8toUTF16(src), PR_FALSE);  // set mime type  mPluginContent->SetAttr(kNameSpaceID_None, nsHTMLAtoms::type,                          NS_ConvertUTF8toUTF16(mMimeType), PR_FALSE);  body->AppendChildTo(mPluginContent, PR_FALSE);  return NS_OK;}