nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject; nsresult rv = doc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject)); NS_ENSURE_TRUE(scriptGlobalObject, NS_ERROR_FAILURE);  nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(scriptGlobalObject);
nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(doc->GetScriptGlobalObject());
nsTextInputListener::UpdateTextInputCommands(const nsAString& commandsToUpdate){  nsIContent* content = mFrame->GetContent();  NS_ENSURE_TRUE(content, NS_ERROR_FAILURE);    nsCOMPtr<nsIDocument> doc = content->GetDocument();  NS_ENSURE_TRUE(doc, NS_ERROR_FAILURE);  nsCOMPtr<nsIScriptGlobalObject> scriptGlobalObject;  nsresult rv = doc->GetScriptGlobalObject(getter_AddRefs(scriptGlobalObject));  NS_ENSURE_TRUE(scriptGlobalObject, NS_ERROR_FAILURE);  nsCOMPtr<nsIDOMWindowInternal> domWindow = do_QueryInterface(scriptGlobalObject);  NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);  return domWindow->UpdateCommands(commandsToUpdate);}