mShell->StyleChangeReflow();
nsIFrame* rootFrame;  mShell->GetRootFrame(&rootFrame); if (rootFrame) {    nsIFrame* child = nsnull; rootFrame->FirstChild(this, nsnull, &child); nsresult rv; nsCOMPtr<nsIBox> box = do_QueryInterface(child, &rv); if (NS_SUCCEEDED(rv) && box) { nsBoxLayoutState state(this); box->MarkStyleChange(state); } else {     mShell->StyleChangeReflow(); } }
nsPresContext::ClearStyleDataAndReflow(){  if (mShell) {    // Clear out all our style data.    mShell->StyleSet()->ClearStyleData(this);    // Force a reflow of the root frame    // XXX We really should only do a reflow if a preference that affects    // formatting changed, e.g., a font change. If it's just a color change    // then we only need to repaint...    mShell->StyleChangeReflow();  }}