Bug 939775 - Remove UpdateTextFragmentTrees and nsSVGMutationObserver. r=dholbert

This commit is contained in:
Robert Longson 2013-12-23 09:40:50 +00:00
Родитель 758bdd6040
Коммит 159c018097
1 изменённых файлов: 0 добавлений и 61 удалений

Просмотреть файл

@ -14,7 +14,6 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsIObjectLoadingContent.h"
#include "nsRenderingContext.h"
#include "nsStubMutationObserver.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGForeignObjectFrame.h"
#include "mozilla/dom/SVGSVGElement.h"
@ -24,53 +23,6 @@
using namespace mozilla;
using namespace mozilla::dom;
class nsSVGMutationObserver : public nsStubMutationObserver
{
public:
// nsIMutationObserver interface
NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED
// nsISupports interface:
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
private:
NS_IMETHOD_(nsrefcnt) AddRef() { return 1; }
NS_IMETHOD_(nsrefcnt) Release() { return 1; }
static void UpdateTextFragmentTrees(nsIFrame *aFrame);
};
//----------------------------------------------------------------------
// nsISupports methods
NS_INTERFACE_MAP_BEGIN(nsSVGMutationObserver)
NS_INTERFACE_MAP_ENTRY(nsIMutationObserver)
NS_INTERFACE_MAP_END
static nsSVGMutationObserver sSVGMutationObserver;
//----------------------------------------------------------------------
// nsIMutationObserver methods
void
nsSVGMutationObserver::AttributeChanged(nsIDocument* aDocument,
Element* aElement,
int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
{
if (aNameSpaceID != kNameSpaceID_XML || aAttribute != nsGkAtoms::space) {
return;
}
nsIFrame* frame = aElement->GetPrimaryFrame();
if (!frame) {
return;
}
// if not, are there text elements amongst its descendents
UpdateTextFragmentTrees(frame);
}
//----------------------------------------------------------------------
// Implementation helpers
@ -101,16 +53,6 @@ nsSVGOuterSVGFrame::UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame)
return mForeignObjectHash->RemoveEntry(aFrame);
}
void
nsSVGMutationObserver::UpdateTextFragmentTrees(nsIFrame *aFrame)
{
nsIFrame* kid = aFrame->GetFirstPrincipalChild();
while (kid) {
UpdateTextFragmentTrees(kid);
kid = kid->GetNextSibling();
}
}
//----------------------------------------------------------------------
// Implementation
@ -165,9 +107,6 @@ nsSVGOuterSVGFrame::Init(nsIContent* aContent,
if (doc->GetRootElement() == mContent) {
mIsRootContent = true;
}
// sSVGMutationObserver has the same lifetime as the document so does
// not need to be removed
doc->AddMutationObserverUnlessExists(&sSVGMutationObserver);
}
}