Bug 438867 - SVG not rendered after html hr element. r+sr=roc
authorRobert Longson <longsonr@gmail.com>
Sun, 22 Jun 2008 16:59:48 +0100
changeset 15471 6e33fd6c3485835fe91350b32066ce1cdc7cc118
parent 15470 e18acf82630ffd3c62e73cf2d0b5caaaa8b42292
child 15472 561b6c2a6e61a24607e02ad586bd3597c306463c
push idunknown
push userunknown
push dateunknown
bugs438867
milestone1.9.1a1pre
Bug 438867 - SVG not rendered after html hr element. r+sr=roc
layout/svg/base/src/nsSVGContainerFrame.cpp
layout/svg/base/src/nsSVGOuterSVGFrame.cpp
--- a/layout/svg/base/src/nsSVGContainerFrame.cpp
+++ b/layout/svg/base/src/nsSVGContainerFrame.cpp
@@ -93,17 +93,19 @@ nsSVGContainerFrame::Init(nsIContent* aC
   return rv;
 }
 
 NS_IMETHODIMP
 nsSVGDisplayContainerFrame::Init(nsIContent* aContent,
                                  nsIFrame* aParent,
                                  nsIFrame* aPrevInFlow)
 {
-  AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
+  if (!(GetStateBits() & NS_STATE_IS_OUTER_SVG)) {
+    AddStateBits(aParent->GetStateBits() & NS_STATE_SVG_NONDISPLAY_CHILD);
+  }
   nsresult rv = nsSVGContainerFrameBase::Init(aContent, aParent, aPrevInFlow);
   return rv;
 }
 
 void
 nsSVGDisplayContainerFrame::Destroy()
 {
   nsSVGUtils::StyleEffects(this);
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -161,16 +161,18 @@ nsSVGOuterSVGFrame::nsSVGOuterSVGFrame(n
 {
 }
 
 NS_IMETHODIMP
 nsSVGOuterSVGFrame::Init(nsIContent* aContent,
                          nsIFrame* aParent,
                          nsIFrame* aPrevInFlow)
 {
+  AddStateBits(NS_STATE_IS_OUTER_SVG);
+
   nsresult rv = nsSVGOuterSVGFrameBase::Init(aContent, aParent, aPrevInFlow);
 
   nsIDocument* doc = mContent->GetCurrentDoc();
   if (doc) {
     // we only care about our content's zoom and pan values if it's the root element
     if (doc->GetRootContent() == mContent) {
       nsSVGSVGElement *SVGElement = static_cast<nsSVGSVGElement*>(mContent);
       SVGElement->GetCurrentTranslate(getter_AddRefs(mCurrentTranslate));
@@ -179,18 +181,16 @@ nsSVGOuterSVGFrame::Init(nsIContent* aCo
     // AddMutationObserver checks that the observer is not already added.
     // sSVGMutationObserver has the same lifetime as the document so does
     // not need to be removed
     doc->AddMutationObserver(&sSVGMutationObserver);
   }
 
   SuspendRedraw();  // UnsuspendRedraw is in DidReflow
 
-  AddStateBits(NS_STATE_IS_OUTER_SVG);
-
   return rv;
 }
 
 //----------------------------------------------------------------------
 // nsISupports methods
 
 NS_INTERFACE_MAP_BEGIN(nsSVGOuterSVGFrame)
   NS_INTERFACE_MAP_ENTRY(nsISVGSVGFrame)