зеркало из https://github.com/mozilla/gecko-dev.git
Bug 939775 - Remove UpdateTextFragmentTrees and nsSVGMutationObserver. r=dholbert
This commit is contained in:
Родитель
758bdd6040
Коммит
159c018097
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче