nsFrameState parentState; parent->GetFrameState(&parentState); if (parentState & NS_FRAME_IS_SPECIAL) {
if (parent->GetStateBits() & NS_FRAME_IS_SPECIAL) {
GetCorrectedParent(nsIPresContext* aPresContext, nsIFrame* aFrame,                   nsIFrame** aSpecialParent){  nsIFrame *parent;  aFrame->GetParent(&parent);  *aSpecialParent = parent;  if (parent) {    nsCOMPtr<nsIAtom> parentPseudo = parent->GetStyleContext()->GetPseudoType();    if (parentPseudo == nsCSSAnonBoxes::mozGCWrapperBlock ||        parentPseudo == nsCSSAnonBoxes::mozGCWrapperInline) {      nsCOMPtr<nsIAtom> pseudo = aFrame->GetStyleContext()->GetPseudoType();      if (pseudo == nsCSSPseudoElements::before) {        // Use the wrapped frame, which is after the |:before|.        parent = GetNextSiblingAcrossLines(aPresContext, aFrame);      } else if (pseudo == nsCSSPseudoElements::after) {        parent->GetFirstInFlow()->FirstChild(aPresContext, nsnull, &parent);        // Now we have either the wrapped frame or the :before, but we        // want the wrapped frame.        if (nsCOMPtr<nsIAtom>(parent->GetStyleContext()->GetPseudoType()) ==            nsCSSPseudoElements::before)          parent = GetNextSiblingAcrossLines(aPresContext, parent);      } else {        parent->GetParent(&parent);      }    }    nsFrameState parentState;    parent->GetFrameState(&parentState);    if (parentState & NS_FRAME_IS_SPECIAL) {      GetIBSpecialSibling(aPresContext, parent, aSpecialParent);    } else {      *aSpecialParent = parent;    }  }  return NS_OK;}