Backout changeset 3a41b53f8ada (bug 539356) because of performance and correctness regressions

This commit is contained in:
Ehsan Akhgari 2012-07-03 20:30:11 -04:00
Родитель 0a629a3bf0
Коммит 202d711270
4 изменённых файлов: 0 добавлений и 70 удалений

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

@ -67,22 +67,9 @@ nsSVGForeignObjectFrame::Init(nsIContent* aContent,
(NS_STATE_SVG_NONDISPLAY_CHILD | NS_STATE_SVG_CLIPPATH_CHILD));
AddStateBits(NS_FRAME_FONT_INFLATION_CONTAINER |
NS_FRAME_FONT_INFLATION_FLOW_ROOT);
if (NS_SUCCEEDED(rv) &&
!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
nsSVGUtils::GetOuterSVGFrame(this)->RegisterForeignObject(this);
}
return rv;
}
void nsSVGForeignObjectFrame::DestroyFrom(nsIFrame* aDestructRoot)
{
// Only unregister if we registered in the first place:
if (!(mState & NS_STATE_SVG_NONDISPLAY_CHILD)) {
nsSVGUtils::GetOuterSVGFrame(this)->UnregisterForeignObject(this);
}
nsSVGForeignObjectFrameBase::DestroyFrom(aDestructRoot);
}
nsIAtom *
nsSVGForeignObjectFrame::GetType() const
{

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

@ -33,7 +33,6 @@ public:
NS_IMETHOD Init(nsIContent* aContent,
nsIFrame* aParent,
nsIFrame* aPrevInFlow);
virtual void DestroyFrom(nsIFrame* aDestructRoot);
NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID,
nsIAtom* aAttribute,
PRInt32 aModType);

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

@ -17,7 +17,6 @@
#include "nsIObjectLoadingContent.h"
#include "nsRenderingContext.h"
#include "nsStubMutationObserver.h"
#include "nsSVGForeignObjectFrame.h"
#include "nsSVGIntegrationUtils.h"
#include "nsSVGSVGElement.h"
#include "nsSVGTextFrame.h"
@ -80,33 +79,6 @@ nsSVGMutationObserver::AttributeChanged(nsIDocument* aDocument,
//----------------------------------------------------------------------
// Implementation helpers
void
nsSVGOuterSVGFrame::RegisterForeignObject(nsSVGForeignObjectFrame* aFrame)
{
NS_ASSERTION(aFrame, "Who on earth is calling us?!");
if (!mForeignObjectHash.IsInitialized()) {
mForeignObjectHash.Init();
}
NS_ASSERTION(!mForeignObjectHash.GetEntry(aFrame),
"nsSVGForeignObjectFrame already registered!");
mForeignObjectHash.PutEntry(aFrame);
NS_ASSERTION(mForeignObjectHash.GetEntry(aFrame),
"Failed to register nsSVGForeignObjectFrame!");
}
void
nsSVGOuterSVGFrame::UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame)
{
NS_ASSERTION(aFrame, "Who on earth is calling us?!");
NS_ASSERTION(mForeignObjectHash.GetEntry(aFrame),
"nsSVGForeignObjectFrame not in registry!");
return mForeignObjectHash.RemoveEntry(aFrame);
}
void
nsSVGMutationObserver::UpdateTextFragmentTrees(nsIFrame *aFrame)
{

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

@ -10,8 +10,6 @@
#include "nsISVGSVGFrame.h"
#include "nsSVGContainerFrame.h"
class nsSVGForeignObjectFrame;
////////////////////////////////////////////////////////////////////////
// nsSVGOuterSVGFrame class
@ -29,13 +27,6 @@ public:
NS_DECL_QUERYFRAME
NS_DECL_FRAMEARENA_HELPERS
#ifdef DEBUG
~nsSVGOuterSVGFrame() {
NS_ASSERTION(mForeignObjectHash.Count() == 0,
"foreignObject(s) still registered!");
}
#endif
// nsIFrame:
virtual nscoord GetMinWidth(nsRenderingContext *aRenderingContext);
virtual nscoord GetPrefWidth(nsRenderingContext *aRenderingContext);
@ -102,18 +93,6 @@ public:
// nsSVGContainerFrame methods:
virtual gfxMatrix GetCanvasTM(PRUint32 aFor);
/* Methods to allow descendant nsSVGForeignObjectFrame frames to register and
* unregister themselves with their nearest nsSVGOuterSVGFrame ancestor. This
* is temporary until display list based invalidation is impleented for SVG.
* Maintaining a list of our foreignObject descendants allows us to search
* them for areas that need to be invalidated, without having to also search
* the SVG frame tree for foreignObjects. This is important so that bug 539356
* does not slow down SVG in general (only foreignObjects, until bug 614732 is
* fixed).
*/
void RegisterForeignObject(nsSVGForeignObjectFrame* aFrame);
void UnregisterForeignObject(nsSVGForeignObjectFrame* aFrame);
virtual bool HasChildrenOnlyTransform(gfxMatrix *aTransform) const;
#ifdef XP_MACOSX
@ -151,13 +130,6 @@ protected:
*/
bool IsRootOfImage();
// This is temporary until display list based invalidation is implemented for
// SVG.
// A hash-set containing our nsSVGForeignObjectFrame descendants. Note we use
// a hash-set to avoid the O(N^2) behavior we'd get tearing down an SVG frame
// subtree if we were to use a list (see bug 381285 comment 20).
nsTHashtable<nsVoidPtrHashKey> mForeignObjectHash;
nsAutoPtr<gfxMatrix> mCanvasTM;
float mFullZoom;