nsIFrame* frame = nsnull; aScrollbar->GetFrame(&frame);  nsIContent* content = frame->GetContent();  PRBool old = PR_TRUE;  nsAutoString value;  if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, value)) old = PR_FALSE;  if (aVisible == old) return;  if (!aVisible) { content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE); } else {    content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE); }
nsGfxScrollFrameInner::SetScrollbarVisibility(nsIBox* aScrollbar, PRBool aVisible){  if (!aScrollbar)    return;  nsIFrame* frame = nsnull;  aScrollbar->GetFrame(&frame);  nsIContent* content = frame->GetContent();    PRBool old = PR_TRUE;  nsAutoString value;    if (NS_CONTENT_ATTR_HAS_VALUE == content->GetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, value))    old = PR_FALSE;    if (aVisible == old)    return;  if (!aVisible) {    content->SetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, NS_LITERAL_STRING("true"), PR_TRUE);  } else {    // disable laziness; we never want to recreate these scrollbars again    // once we've created them    // disable laziness FIRST so only one recreation happens.    content->UnsetAttr(kNameSpaceID_None, nsXULAtoms::collapsed, PR_TRUE);  }  nsCOMPtr<nsIScrollbarFrame> scrollbar(do_QueryInterface(aScrollbar));  if (scrollbar) {    // See if we have a mediator.    nsCOMPtr<nsIScrollbarMediator> mediator;    scrollbar->GetScrollbarMediator(getter_AddRefs(mediator));    if (mediator) {      // Inform the mediator of the visibility change.      mediator->VisibilityChanged(aVisible);    }  }}