From f6bc46eb38ea852c9d64d9a6214ca868c9a02d99 Mon Sep 17 00:00:00 2001 From: "jonas@sicking.cc" Date: Tue, 8 Apr 2008 20:20:39 -0700 Subject: [PATCH] Backing out due to test failures --- content/base/public/nsIDocument.h | 39 +++++++++++++++++++ content/base/src/Makefile.in | 1 - content/base/src/nsAttrAndChildArray.cpp | 1 - content/base/src/nsContentSink.cpp | 1 - content/base/src/nsContentUtils.cpp | 2 - content/base/src/nsDocument.cpp | 6 --- content/base/src/nsGenericDOMDataNode.cpp | 1 - content/base/src/nsGenericElement.cpp | 24 ++++-------- content/base/src/nsImageLoadingContent.cpp | 2 - content/base/src/nsObjectLoadingContent.cpp | 1 - content/events/public/nsPLDOMEvent.h | 1 - content/events/src/nsPLDOMEvent.cpp | 6 --- .../html/content/src/nsGenericHTMLElement.cpp | 1 - .../html/content/src/nsHTMLFormElement.cpp | 2 - .../html/content/src/nsHTMLHeadingElement.cpp | 1 - .../html/content/src/nsHTMLInputElement.cpp | 2 - .../html/content/src/nsHTMLLinkElement.cpp | 12 ++++-- .../html/content/src/nsHTMLOptionElement.cpp | 1 - .../content/src/nsHTMLTextAreaElement.cpp | 1 - .../html/document/src/nsHTMLContentSink.cpp | 1 - content/html/document/src/nsHTMLDocument.cpp | 1 - .../mathml/content/src/nsMathMLElement.cpp | 1 - content/svg/content/src/nsSVGUseElement.cpp | 1 - content/xbl/src/nsXBLBinding.cpp | 3 -- content/xbl/src/nsXBLInsertionPoint.cpp | 3 -- content/xbl/src/nsXBLPrototypeBinding.cpp | 3 -- content/xml/document/src/nsXMLContentSink.cpp | 1 - content/xtf/src/nsXTFElementWrapper.cpp | 1 - content/xul/content/src/nsXULElement.cpp | 1 - .../xul/templates/src/nsXULContentBuilder.cpp | 1 - layout/base/nsCSSFrameConstructor.cpp | 2 - layout/base/nsPresShell.cpp | 3 -- layout/generic/nsFrameSetFrame.cpp | 1 - layout/style/nsCSSStyleRule.cpp | 1 - layout/style/nsCSSStyleSheet.cpp | 1 - 35 files changed, 56 insertions(+), 74 deletions(-) diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 2e9ead1bcbaf..e9b025cc13e9 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -1061,6 +1061,45 @@ private: NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocument, NS_IDOCUMENT_IID) +/** + * Helper class to automatically handle batching of document updates. This + * class will call BeginUpdate on construction and EndUpdate on destruction on + * the given document with the given update type. The document could be null, + * in which case no updates will be called. The constructor also takes a + * boolean that can be set to false to prevent notifications. + */ +class mozAutoDocUpdate +{ +public: + mozAutoDocUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType, + PRBool aNotify) : + mDocument(aNotify ? aDocument : nsnull), + mUpdateType(aUpdateType) + { + if (mDocument) { + mDocument->BeginUpdate(mUpdateType); + } + } + + ~mozAutoDocUpdate() + { + if (mDocument) { + mDocument->EndUpdate(mUpdateType); + } + } + +private: + nsCOMPtr mDocument; + nsUpdateType mUpdateType; +}; + +#define MOZ_AUTO_DOC_UPDATE_PASTE2(tok,line) tok##line +#define MOZ_AUTO_DOC_UPDATE_PASTE(tok,line) \ + MOZ_AUTO_DOC_UPDATE_PASTE2(tok,line) +#define MOZ_AUTO_DOC_UPDATE(doc,type,notify) \ + mozAutoDocUpdate MOZ_AUTO_DOC_UPDATE_PASTE(_autoDocUpdater_, __LINE__) \ + (doc,type,notify) + /** * mozAutoSubtreeModified batches DOM mutations so that a DOMSubtreeModified * event is dispatched, if necessary, when the outermost mozAutoSubtreeModified diff --git a/content/base/src/Makefile.in b/content/base/src/Makefile.in index b7b842c26b30..ac4f9c7a2570 100644 --- a/content/base/src/Makefile.in +++ b/content/base/src/Makefile.in @@ -102,7 +102,6 @@ EXPORTS = \ nsStubImageDecoderObserver.h \ nsStubMutationObserver.h \ nsTextFragment.h \ - mozAutoDocUpdate.h \ $(NULL) CPPSRCS = \ diff --git a/content/base/src/nsAttrAndChildArray.cpp b/content/base/src/nsAttrAndChildArray.cpp index 2a2f4310ee21..f26e7c769a4a 100644 --- a/content/base/src/nsAttrAndChildArray.cpp +++ b/content/base/src/nsAttrAndChildArray.cpp @@ -642,7 +642,6 @@ nsAttrAndChildArray::Clear() ATTRS(mImpl)[i].~InternalAttr(); } - nsAutoScriptBlocker scriptBlocker; PRUint32 end = slotCount * ATTRSIZE + ChildCount(); for (i = slotCount * ATTRSIZE; i < end; ++i) { nsIContent* child = static_cast(mImpl->mBuffer[i]); diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp index 4232b2b8d0fa..f2caa26ceb58 100644 --- a/content/base/src/nsContentSink.cpp +++ b/content/base/src/nsContentSink.cpp @@ -93,7 +93,6 @@ #include "nsThreadUtils.h" #include "nsPresShellIterator.h" #include "nsPIDOMWindow.h" -#include "mozAutoDocUpdate.h" PRLogModuleInfo* gContentSinkLogModuleInfo; diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index d17a5083f53a..25e2ad85c239 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -162,8 +162,6 @@ static NS_DEFINE_CID(kXTFServiceCID, NS_XTFSERVICE_CID); #include "nsIScriptError.h" #include "nsIConsoleService.h" -#include "mozAutoDocUpdate.h" - const char kLoadAsData[] = "loadAsData"; static const char kJSStackContractID[] = "@mozilla.org/js/xpc/ContextStack;1"; diff --git a/content/base/src/nsDocument.cpp b/content/base/src/nsDocument.cpp index dc3a479f3aa4..b80ece6a43ce 100644 --- a/content/base/src/nsDocument.cpp +++ b/content/base/src/nsDocument.cpp @@ -160,8 +160,6 @@ static NS_DEFINE_CID(kDOMEventGroupCID, NS_DOMEVENTGROUP_CID); #include "nsFrameLoader.h" -#include "mozAutoDocUpdate.h" - #ifdef MOZ_LOGGING // so we can get logging even in release builds #define FORCE_PR_LOG 1 @@ -833,8 +831,6 @@ nsDocument::~nsDocument() // links one by one DestroyLinkMap(); - nsAutoScriptBlocker scriptBlocker; - PRInt32 indx; // must be signed PRUint32 count = mChildren.ChildCount(); for (indx = PRInt32(count) - 1; indx >= 0; --indx) { @@ -1089,8 +1085,6 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsDocument) // from the doc. tmp->DestroyLinkMap(); - nsAutoScriptBlocker scriptBlocker; - // Unlink the mChildren nsAttrAndChildArray. for (PRInt32 indx = PRInt32(tmp->mChildren.ChildCount()) - 1; indx >= 0; --indx) { diff --git a/content/base/src/nsGenericDOMDataNode.cpp b/content/base/src/nsGenericDOMDataNode.cpp index 2fac96dddec5..1b99baa4f4ba 100644 --- a/content/base/src/nsGenericDOMDataNode.cpp +++ b/content/base/src/nsGenericDOMDataNode.cpp @@ -62,7 +62,6 @@ #include "nsNodeUtils.h" #include "nsBindingManager.h" #include "nsCCUncollectableMarker.h" -#include "mozAutoDocUpdate.h" #include "pldhash.h" #include "prprf.h" diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index ef91fdb73eac..a5382247941c 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -138,8 +138,6 @@ #include "nsCycleCollectionParticipant.h" #include "nsCCUncollectableMarker.h" -#include "mozAutoDocUpdate.h" - #ifdef MOZ_SVG PRBool NS_SVG_TestFeature(const nsAString &fstr); #endif /* MOZ_SVG */ @@ -2045,8 +2043,7 @@ nsGenericElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, NS_PRECONDITION(!IsNativeAnonymous() || aBindingParent == this, "Native anonymous content must have itself as its " "own binding parent"); - NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(), "Need a script blocker!"); - + if (!aBindingParent && aParent) { aBindingParent = aParent->GetBindingParent(); } @@ -2178,7 +2175,6 @@ nsGenericElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent) NS_PRECONDITION(aDeep || (!GetCurrentDoc() && !GetBindingParent()), "Shallow unbind won't clear document and binding parent on " "kids!"); - NS_ASSERTION(!nsContentUtils::IsSafeToRunScript(), "Need a script blocker!"); // Make sure to unbind this node before doing the kids nsIDocument *document = HasFlag(NODE_FORCE_XBL_BINDINGS) ? GetOwnerDoc() : GetCurrentDoc(); @@ -3460,17 +3456,13 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(nsGenericElement) // Unlink child content (and unbind our subtree). { - PRUint32 childCount = tmp->mAttrsAndChildren.ChildCount(); - if (childCount) { - // Don't allow script to run while we're unbinding everything. - nsAutoScriptBlocker scriptBlocker; - while (childCount-- > 0) { - // Once we have XPCOMGC we shouldn't need to call UnbindFromTree. - // We could probably do a non-deep unbind here when IsInDoc is false - // for better performance. - tmp->mAttrsAndChildren.ChildAt(childCount)->UnbindFromTree(); - tmp->mAttrsAndChildren.RemoveChildAt(childCount); - } + PRUint32 i; + PRUint32 kids = tmp->mAttrsAndChildren.ChildCount(); + for (i = kids; i > 0; i--) { + // We could probably do a non-deep unbind here when IsInDoc is false + // for better performance. + tmp->mAttrsAndChildren.ChildAt(i-1)->UnbindFromTree(); + tmp->mAttrsAndChildren.RemoveChildAt(i-1); } } diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp index 757d097038a8..56277fc3f1fe 100644 --- a/content/base/src/nsImageLoadingContent.cpp +++ b/content/base/src/nsImageLoadingContent.cpp @@ -77,8 +77,6 @@ #include "nsEventDispatcher.h" #include "nsDOMClassInfo.h" -#include "mozAutoDocUpdate.h" - #ifdef DEBUG_chb static void PrintReqURL(imgIRequest* req) { if (!req) { diff --git a/content/base/src/nsObjectLoadingContent.cpp b/content/base/src/nsObjectLoadingContent.cpp index dd42347824b3..c37e39e1cb12 100644 --- a/content/base/src/nsObjectLoadingContent.cpp +++ b/content/base/src/nsObjectLoadingContent.cpp @@ -83,7 +83,6 @@ #include "nsFrameLoader.h" #include "nsObjectLoadingContent.h" -#include "mozAutoDocUpdate.h" static NS_DEFINE_CID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); diff --git a/content/events/public/nsPLDOMEvent.h b/content/events/public/nsPLDOMEvent.h index 6e0f8dfe7316..c146b1c4216a 100644 --- a/content/events/public/nsPLDOMEvent.h +++ b/content/events/public/nsPLDOMEvent.h @@ -66,7 +66,6 @@ public: NS_IMETHOD Run(); nsresult PostDOMEvent(); - nsresult RunDOMEventWhenSafe(); nsCOMPtr mEventNode; nsCOMPtr mEvent; diff --git a/content/events/src/nsPLDOMEvent.cpp b/content/events/src/nsPLDOMEvent.cpp index 13dec7344e73..c888616ae482 100644 --- a/content/events/src/nsPLDOMEvent.cpp +++ b/content/events/src/nsPLDOMEvent.cpp @@ -41,7 +41,6 @@ #include "nsIDOMDocument.h" #include "nsIDOMDocumentEvent.h" #include "nsIDOMEventTarget.h" -#include "nsContentUtils.h" NS_IMETHODIMP nsPLDOMEvent::Run() { @@ -77,8 +76,3 @@ nsresult nsPLDOMEvent::PostDOMEvent() { return NS_DispatchToCurrentThread(this); } - -nsresult nsPLDOMEvent::RunDOMEventWhenSafe() -{ - return nsContentUtils::AddScriptRunner(this) ? NS_OK : NS_ERROR_FAILURE; -} diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index 7de5176e8f00..990880c21f55 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -110,7 +110,6 @@ #include "nsEventDispatcher.h" #include "nsLayoutUtils.h" #include "nsContentCreatorFunctions.h" -#include "mozAutoDocUpdate.h" class nsINodeInfo; class nsIDOMNodeList; diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 83d7bf831033..9f812e119e70 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -87,8 +87,6 @@ #include "nsUnicharUtils.h" #include "nsEventDispatcher.h" -#include "mozAutoDocUpdate.h" - static const int NS_FORM_CONTROL_LIST_HASHTABLE_SIZE = 16; class nsFormControlList; diff --git a/content/html/content/src/nsHTMLHeadingElement.cpp b/content/html/content/src/nsHTMLHeadingElement.cpp index 725c97664c83..84051fee53d6 100644 --- a/content/html/content/src/nsHTMLHeadingElement.cpp +++ b/content/html/content/src/nsHTMLHeadingElement.cpp @@ -42,7 +42,6 @@ #include "nsPresContext.h" #include "nsMappedAttributes.h" #include "nsRuleData.h" -#include "mozAutoDocUpdate.h" class nsHTMLHeadingElement : public nsGenericHTMLElement, public nsIDOMHTMLHeadingElement diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index c50687954419..091f91a2623a 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -111,8 +111,6 @@ #include "nsImageLoadingContent.h" #include "nsIDOMWindowInternal.h" -#include "mozAutoDocUpdate.h" - // XXX align=left, hspace, vspace, border? other nav4 attrs static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID); diff --git a/content/html/content/src/nsHTMLLinkElement.cpp b/content/html/content/src/nsHTMLLinkElement.cpp index b5c8ab203b67..52299f3b9c78 100644 --- a/content/html/content/src/nsHTMLLinkElement.cpp +++ b/content/html/content/src/nsHTMLLinkElement.cpp @@ -209,6 +209,10 @@ nsHTMLLinkElement::BindToTree(nsIDocument* aDocument, nsIContent* aParent, UpdateStyleSheetInternal(nsnull); + // XXXbz we really shouldn't fire the event until after we've finished with + // the outermost BindToTree... In particular, this can effectively cause us + // to reenter this code, or for some part of the document to become unbound + // inside the event! CreateAndDispatchEvent(aDocument, NS_LITERAL_STRING("DOMLinkAdded")); return rv; @@ -239,8 +243,10 @@ nsHTMLLinkElement::UnbindFromTree(PRBool aDeep, PRBool aNullParent) mLinkState = eLinkState_Unknown; } - // Once we have XPCOMGC we shouldn't need to call UnbindFromTree during Unlink - // and so this messy event dispatch can go away. + // XXXbz we really shouldn't fire the event until after we've finished with + // the outermost UnbindFromTree... In particular, this can effectively cause + // us to reenter this code, or to be bound to a different tree inside the + // event! CreateAndDispatchEvent(oldDoc, NS_LITERAL_STRING("DOMLinkRemoved")); nsGenericHTMLElement::UnbindFromTree(aDeep, aNullParent); UpdateStyleSheetInternal(oldDoc); @@ -270,7 +276,7 @@ nsHTMLLinkElement::CreateAndDispatchEvent(nsIDocument* aDoc, nsRefPtr event = new nsPLDOMEvent(this, aEventName); if (event) { - event->RunDOMEventWhenSafe(); + event->PostDOMEvent(); } } diff --git a/content/html/content/src/nsHTMLOptionElement.cpp b/content/html/content/src/nsHTMLOptionElement.cpp index 2416af86f4a0..43213edbe5a9 100644 --- a/content/html/content/src/nsHTMLOptionElement.cpp +++ b/content/html/content/src/nsHTMLOptionElement.cpp @@ -69,7 +69,6 @@ #include "nsIDocument.h" #include "nsIDOMDocument.h" #include "nsContentCreatorFunctions.h" -#include "mozAutoDocUpdate.h" /** * Implementation of <option> diff --git a/content/html/content/src/nsHTMLTextAreaElement.cpp b/content/html/content/src/nsHTMLTextAreaElement.cpp index 08f64386175b..d2a8492899b2 100644 --- a/content/html/content/src/nsHTMLTextAreaElement.cpp +++ b/content/html/content/src/nsHTMLTextAreaElement.cpp @@ -75,7 +75,6 @@ #include "nsLayoutErrors.h" #include "nsStubMutationObserver.h" #include "nsDOMError.h" -#include "mozAutoDocUpdate.h" static NS_DEFINE_CID(kXULControllersCID, NS_XULCONTROLLERS_CID); diff --git a/content/html/document/src/nsHTMLContentSink.cpp b/content/html/document/src/nsHTMLContentSink.cpp index 0ad97304423b..686c2efe9d35 100644 --- a/content/html/document/src/nsHTMLContentSink.cpp +++ b/content/html/document/src/nsHTMLContentSink.cpp @@ -121,7 +121,6 @@ #include "nsIElementObserver.h" #include "nsNodeInfoManager.h" #include "nsContentCreatorFunctions.h" -#include "mozAutoDocUpdate.h" #ifdef NS_DEBUG static PRLogModuleInfo* gSinkLogModuleInfo; diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp index e5e2d5bb7bc2..f0228492f5b4 100644 --- a/content/html/document/src/nsHTMLDocument.cpp +++ b/content/html/document/src/nsHTMLDocument.cpp @@ -140,7 +140,6 @@ #include "nsIEditorStyleSheets.h" #include "nsIInlineSpellChecker.h" #include "nsRange.h" -#include "mozAutoDocUpdate.h" #define NS_MAX_DOCUMENT_WRITE_DEPTH 20 diff --git a/content/mathml/content/src/nsMathMLElement.cpp b/content/mathml/content/src/nsMathMLElement.cpp index 3c80b98e01c4..285dc2851c23 100644 --- a/content/mathml/content/src/nsMathMLElement.cpp +++ b/content/mathml/content/src/nsMathMLElement.cpp @@ -51,7 +51,6 @@ #include "nsIPresShell.h" #include "nsPresContext.h" #include "nsDOMClassInfoID.h" -#include "mozAutoDocUpdate.h" //---------------------------------------------------------------------- // nsISupports methods: diff --git a/content/svg/content/src/nsSVGUseElement.cpp b/content/svg/content/src/nsSVGUseElement.cpp index 0c4ffcdc06f4..36103ac671a1 100644 --- a/content/svg/content/src/nsSVGUseElement.cpp +++ b/content/svg/content/src/nsSVGUseElement.cpp @@ -65,7 +65,6 @@ NS_IMPL_NS_NEW_SVG_ELEMENT(Use) NS_IMPL_CYCLE_COLLECTION_CLASS(nsSVGUseElement) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(nsSVGUseElement, nsSVGUseElementBase) - nsAutoScriptBlocker scriptBlocker; NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mOriginal) tmp->DestroyAnonymousContent(); tmp->RemoveListener(); diff --git a/content/xbl/src/nsXBLBinding.cpp b/content/xbl/src/nsXBLBinding.cpp index 0300616242bf..5bd699b15a70 100644 --- a/content/xbl/src/nsXBLBinding.cpp +++ b/content/xbl/src/nsXBLBinding.cpp @@ -345,8 +345,6 @@ nsXBLBinding::InstallAnonymousContent(nsIContent* aAnonParent, nsIContent* aElem nsIDocument* doc = aElement->GetCurrentDoc(); PRBool allowScripts = AllowScripts(); - nsAutoScriptBlocker scriptBlocker; - PRUint32 childCount = aAnonParent->GetChildCount(); for (PRUint32 i = 0; i < childCount; i++) { nsIContent *child = aAnonParent->GetChildAt(i); @@ -1141,7 +1139,6 @@ nsXBLBinding::ChangeDocument(nsIDocument* aOldDocument, nsIDocument* aNewDocumen nsCOMPtr xuldoc(do_QueryInterface(aOldDocument)); #endif - nsAutoScriptBlocker scriptBlocker; anonymous->UnbindFromTree(); // Kill it. #ifdef MOZ_XUL diff --git a/content/xbl/src/nsXBLInsertionPoint.cpp b/content/xbl/src/nsXBLInsertionPoint.cpp index 20af66288f2a..5d8077f286ad 100644 --- a/content/xbl/src/nsXBLInsertionPoint.cpp +++ b/content/xbl/src/nsXBLInsertionPoint.cpp @@ -37,7 +37,6 @@ * ***** END LICENSE BLOCK ***** */ #include "nsXBLInsertionPoint.h" -#include "nsContentUtils.h" nsXBLInsertionPoint::nsXBLInsertionPoint(nsIContent* aParentElement, PRUint32 aIndex, @@ -126,8 +125,6 @@ nsXBLInsertionPoint::UnbindDefaultContent() // Hold a strong ref while doing this, just in case nsCOMPtr defContent = mDefaultContent; - nsAutoScriptBlocker scriptBlocker; - // Unbind the _kids_ of the default content, not just the default content // itself, since they are bound to some other parent. Basically we want to // undo the mess that InstallAnonymousContent created. diff --git a/content/xbl/src/nsXBLPrototypeBinding.cpp b/content/xbl/src/nsXBLPrototypeBinding.cpp index 2117b8433820..5d19d29fcc9c 100644 --- a/content/xbl/src/nsXBLPrototypeBinding.cpp +++ b/content/xbl/src/nsXBLPrototypeBinding.cpp @@ -141,7 +141,6 @@ class nsXBLInsertionPointEntry { public: ~nsXBLInsertionPointEntry() { if (mDefaultContent) { - nsAutoScriptBlocker scriptBlocker; // mDefaultContent is a sort of anonymous content within the XBL // document, and we own and manage it. Unhook it here, since we're going // away. @@ -249,7 +248,6 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(nsXBLInsertionPointEntry) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_NATIVE(nsXBLInsertionPointEntry) NS_IMPL_CYCLE_COLLECTION_UNLINK_NSCOMPTR(mInsertionParent) if (tmp->mDefaultContent) { - nsAutoScriptBlocker scriptBlocker; // mDefaultContent is a sort of anonymous content within the XBL // document, and we own and manage it. Unhook it here, since we're going // away. @@ -1287,7 +1285,6 @@ nsXBLPrototypeBinding::ConstructInsertionTable(nsIContent* aContent) // in situations where no content ends up being placed at the insertion point. PRUint32 defaultCount = child->GetChildCount(); if (defaultCount > 0) { - nsAutoScriptBlocker scriptBlocker; // Annotate the insertion point with our default content. xblIns->SetDefaultContent(child); diff --git a/content/xml/document/src/nsXMLContentSink.cpp b/content/xml/document/src/nsXMLContentSink.cpp index da53a9ee9977..b86f3aedc4bb 100644 --- a/content/xml/document/src/nsXMLContentSink.cpp +++ b/content/xml/document/src/nsXMLContentSink.cpp @@ -96,7 +96,6 @@ #include "nsNodeUtils.h" #include "nsIScriptGlobalObject.h" #include "nsEventDispatcher.h" -#include "mozAutoDocUpdate.h" #ifdef MOZ_SVG #include "nsGUIEvent.h" diff --git a/content/xtf/src/nsXTFElementWrapper.cpp b/content/xtf/src/nsXTFElementWrapper.cpp index 7509e3ac5846..3c0dc1d2a38d 100644 --- a/content/xtf/src/nsXTFElementWrapper.cpp +++ b/content/xtf/src/nsXTFElementWrapper.cpp @@ -62,7 +62,6 @@ #include "nsIProgrammingLanguage.h" #include "nsIXPConnect.h" #include "nsXTFWeakTearoff.h" -#include "mozAutoDocUpdate.h" nsXTFElementWrapper::nsXTFElementWrapper(nsINodeInfo* aNodeInfo, nsIXTFElement* aXTFElement) diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index c59607790559..3dd654175f9d 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -151,7 +151,6 @@ #include "nsXBLBinding.h" #include "nsEventDispatcher.h" #include "nsPresShellIterator.h" -#include "mozAutoDocUpdate.h" /** * Three bits are used for XUL Element's lazy state. diff --git a/content/xul/templates/src/nsXULContentBuilder.cpp b/content/xul/templates/src/nsXULContentBuilder.cpp index d0763fcb865c..6ef17b78523c 100644 --- a/content/xul/templates/src/nsXULContentBuilder.cpp +++ b/content/xul/templates/src/nsXULContentBuilder.cpp @@ -66,7 +66,6 @@ #include "nsContentUtils.h" #include "nsAttrName.h" #include "nsNodeUtils.h" -#include "mozAutoDocUpdate.h" #include "jsapi.h" #include "pldhash.h" diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index ab7f45d56d15..35c783aa8145 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -13452,8 +13452,6 @@ nsCSSFrameConstructor::ProcessPendingRestyles() // already processing, sending us into an infinite loop. mPendingRestyles.Clear(); - nsAutoScriptBlocker scriptBlocker; - // Make sure to not rebuild quote or counter lists while we're // processing restyles BeginUpdate(); diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp index 83e8b507f5ac..264ebadcf5fc 100644 --- a/layout/base/nsPresShell.cpp +++ b/layout/base/nsPresShell.cpp @@ -1704,8 +1704,6 @@ PresShell::Destroy() CancelAllPendingReflows(); CancelPostedReflowCallbacks(); - nsAutoScriptBlocker scriptBlocker; - // Destroy the frame manager. This will destroy the frame hierarchy mFrameConstructor->WillDestroyFrameTree(); FrameManager()->Destroy(); @@ -4607,7 +4605,6 @@ PresShell::DoFlushPendingNotifications(mozFlushType aType, // be good. if (aType >= Flush_Layout && !mIsDestroying) { - nsAutoScriptBlocker scriptBlocker; mFrameConstructor->RecalcQuotesAndCounters(); ProcessReflowCommands(aInterruptibleReflow); } diff --git a/layout/generic/nsFrameSetFrame.cpp b/layout/generic/nsFrameSetFrame.cpp index 459c236b2a80..4ddcbda9857d 100644 --- a/layout/generic/nsFrameSetFrame.cpp +++ b/layout/generic/nsFrameSetFrame.cpp @@ -75,7 +75,6 @@ #include "nsIContent.h" #include "nsDisplayList.h" #include "nsNodeUtils.h" -#include "mozAutoDocUpdate.h" // masks for mEdgeVisibility #define LEFT_VIS 0x0001 diff --git a/layout/style/nsCSSStyleRule.cpp b/layout/style/nsCSSStyleRule.cpp index 7c8631907601..9e486398f87e 100644 --- a/layout/style/nsCSSStyleRule.cpp +++ b/layout/style/nsCSSStyleRule.cpp @@ -76,7 +76,6 @@ #include "nsContentUtils.h" #include "nsContentErrors.h" -#include "mozAutoDocUpdate.h" #define NS_IF_CLONE(member_) \ PR_BEGIN_MACRO \ diff --git a/layout/style/nsCSSStyleSheet.cpp b/layout/style/nsCSSStyleSheet.cpp index 162b142c5ab2..60444f78b641 100644 --- a/layout/style/nsCSSStyleSheet.cpp +++ b/layout/style/nsCSSStyleSheet.cpp @@ -74,7 +74,6 @@ #include "nsContentUtils.h" #include "nsIJSContextStack.h" #include "nsIScriptSecurityManager.h" -#include "mozAutoDocUpdate.h" // ------------------------------- // Style Rule List for the DOM