if (aWhichLayer != NS_FRAME_PAINT_LAYER_FOREGROUND) return NS_OK; if (aDirtyRect.width<=0 || aDirtyRect.height<=0) return NS_OK;  nsSVGRenderingContext SVGCtx(aPresContext, &aRenderingContext, aDirtyRect); Paint(&SVGCtx);   nsIFrame* kid = mFrames.FirstChild(); while (kid) { nsISVGFrame* SVGFrame=0; kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame); if (SVGFrame) SVGFrame->Paint(&SVGCtx); kid->GetNextSibling(&kid); }  SVGCtx.Render();
nsSVGOuterSVGFrame::Paint(nsIPresContext* aPresContext,                          nsIRenderingContext& aRenderingContext,                          const nsRect& aDirtyRect,                          nsFramePaintLayer aWhichLayer,                          PRUint32 aFlags){  //    if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) {//      const nsStyleDisplay* disp = (const nsStyleDisplay*)//        mStyleContext->GetStyleData(eStyleStruct_Display);//      if (disp->IsVisible() && mRect.width && mRect.height) {//        // Paint our background and border//        const nsStyleBorder* border = (const nsStyleBorder*)//          mStyleContext->GetStyleData(eStyleStruct_Border);//        const nsStyleOutline* outline = (const nsStyleOutline*)//          mStyleContext->GetStyleData(eStyleStruct_Outline);//        nsRect  rect(0, 0, mRect.width, mRect.height);// //       nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,// //                                       aDirtyRect, rect, *border, 0, 0);//        nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,//                                    aDirtyRect, rect, *border, mStyleContext, 0);//        nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this,//                                    aDirtyRect, rect, *border, *outline, mStyleContext, 0);      //      }//    }    if (aWhichLayer != NS_FRAME_PAINT_LAYER_FOREGROUND) return NS_OK;  if (aDirtyRect.width<=0 || aDirtyRect.height<=0) return NS_OK;  nsSVGRenderingContext SVGCtx(aPresContext, &aRenderingContext, aDirtyRect);  Paint(&SVGCtx);  // paint children:  nsIFrame* kid = mFrames.FirstChild();  while (kid) {    nsISVGFrame* SVGFrame=0;    kid->QueryInterface(NS_GET_IID(nsISVGFrame),(void**)&SVGFrame);    if (SVGFrame)      SVGFrame->Paint(&SVGCtx);    kid->GetNextSibling(&kid);  }    SVGCtx.Render();    return NS_OK;  // see if we have to draw a selection frame around this container  //return nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer);}