mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1461701: Remove nsUpdateType and UPDATE_CONTENT_MODEL. r=smaug
MozReview-Commit-ID: 33iBMZqnkAc
This commit is contained in:
parent
cb56e2c9f3
commit
11794a944d
@ -266,7 +266,7 @@ CharacterData::SetTextInternal(uint32_t aOffset, uint32_t aCount,
|
||||
}
|
||||
|
||||
nsIDocument *document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(document, aNotify);
|
||||
|
||||
bool haveMutationListeners = aNotify &&
|
||||
nsContentUtils::HasMutationListeners(this,
|
||||
|
@ -2455,7 +2455,7 @@ Element::SetSingleClassFromParser(nsAtom* aSingleClassName)
|
||||
nsAttrValue value(aSingleClassName);
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, false);
|
||||
mozAutoDocUpdate updateBatch(document, false);
|
||||
|
||||
// In principle, BeforeSetAttr should be called here if a node type
|
||||
// existed that wanted to do something special for class, but there
|
||||
@ -2525,7 +2525,7 @@ Element::SetAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
// Hold a script blocker while calling ParseAttribute since that can call
|
||||
// out to id-observers
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(document, aNotify);
|
||||
|
||||
nsresult rv = BeforeSetAttr(aNamespaceID, aName, &value, aNotify);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
@ -2583,7 +2583,7 @@ Element::SetParsedAttr(int32_t aNamespaceID, nsAtom* aName,
|
||||
PreIdMaybeChange(aNamespaceID, aName, &value);
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(document, aNotify);
|
||||
return SetAttrAndNotify(aNamespaceID, aName, aPrefix,
|
||||
oldValueSet ? &oldValue : nullptr,
|
||||
aParsedValue, nullptr, modType, hasListeners, aNotify,
|
||||
@ -2915,7 +2915,7 @@ Element::UnsetAttr(int32_t aNameSpaceID, nsAtom* aName,
|
||||
}
|
||||
|
||||
nsIDocument *document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(document, aNotify);
|
||||
|
||||
if (aNotify) {
|
||||
nsNodeUtils::AttributeWillChange(this, aNameSpaceID, aName,
|
||||
@ -3916,7 +3916,7 @@ Element::InsertAdjacentHTML(const nsAString& aPosition, const nsAString& aText,
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
|
||||
// Needed when insertAdjacentHTML is used in combination with contenteditable
|
||||
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(doc, true);
|
||||
nsAutoScriptLoaderDisabler sld(doc);
|
||||
|
||||
// Batch possible DOMSubtreeModified events.
|
||||
|
@ -2279,7 +2279,7 @@ FragmentOrElement::SetInnerHTMLInternal(const nsAString& aInnerHTML, ErrorResult
|
||||
target->FireNodeRemovedForChildren();
|
||||
|
||||
// Needed when innerHTML is used in combination with contenteditable
|
||||
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(doc, true);
|
||||
|
||||
// Remove childnodes.
|
||||
nsAutoMutationBatch mb(target, true, false);
|
||||
|
@ -30,7 +30,7 @@ Text::SplitText(uint32_t aOffset, ErrorResult& aRv)
|
||||
}
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(document, true);
|
||||
|
||||
// Use Clone for creating the new node so that the new node is of same class
|
||||
// as this node!
|
||||
|
@ -21,15 +21,12 @@
|
||||
class MOZ_STACK_CLASS mozAutoDocUpdate
|
||||
{
|
||||
public:
|
||||
mozAutoDocUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType,
|
||||
bool aNotify) :
|
||||
mDocument(aNotify ? aDocument : nullptr),
|
||||
mUpdateType(aUpdateType)
|
||||
mozAutoDocUpdate(nsIDocument* aDocument, bool aNotify)
|
||||
: mDocument(aNotify ? aDocument : nullptr)
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->BeginUpdate(mUpdateType);
|
||||
}
|
||||
else {
|
||||
mDocument->BeginUpdate();
|
||||
} else {
|
||||
nsContentUtils::AddScriptBlocker();
|
||||
}
|
||||
}
|
||||
@ -37,24 +34,22 @@ public:
|
||||
~mozAutoDocUpdate()
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->EndUpdate(mUpdateType);
|
||||
}
|
||||
else {
|
||||
mDocument->EndUpdate();
|
||||
} else {
|
||||
nsContentUtils::RemoveScriptBlocker();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
nsCOMPtr<nsIDocument> 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) \
|
||||
#define MOZ_AUTO_DOC_UPDATE(doc,notify) \
|
||||
mozAutoDocUpdate MOZ_AUTO_DOC_UPDATE_PASTE(_autoDocUpdater_, __LINE__) \
|
||||
(doc,type,notify)
|
||||
(doc,notify)
|
||||
|
||||
|
||||
/**
|
||||
@ -73,14 +68,14 @@ public:
|
||||
mDocument(aNotify ? aDocument : nullptr)
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->BeginUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->BeginUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
~mozAutoDocConditionalContentUpdateBatch()
|
||||
{
|
||||
if (mDocument) {
|
||||
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->EndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1295,7 +1295,7 @@ nsContentSink::NotifyAppend(nsIContent* aContainer, uint32_t aStartIndex)
|
||||
|
||||
{
|
||||
// Scope so we call EndUpdate before we decrease mInNotification
|
||||
MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_CONTENT_MODEL, !mBeganUpdate);
|
||||
MOZ_AUTO_DOC_UPDATE(mDocument, !mBeganUpdate);
|
||||
nsNodeUtils::ContentAppended(aContainer,
|
||||
aContainer->GetChildAt_Deprecated(aStartIndex));
|
||||
mLastNotificationTime = PR_Now();
|
||||
@ -1487,7 +1487,7 @@ nsContentSink::FavorPerformanceHint(bool perfOverStarvation, uint32_t starvation
|
||||
}
|
||||
|
||||
void
|
||||
nsContentSink::BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
|
||||
nsContentSink::BeginUpdate(nsIDocument* aDocument)
|
||||
{
|
||||
// Remember nested updates from updates that we started.
|
||||
if (mInNotification > 0 && mUpdatesInNotification < 2) {
|
||||
@ -1506,7 +1506,7 @@ nsContentSink::BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
|
||||
}
|
||||
|
||||
void
|
||||
nsContentSink::EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType)
|
||||
nsContentSink::EndUpdate(nsIDocument* aDocument)
|
||||
{
|
||||
// If we're in a script and we didn't do the notification,
|
||||
// something else in the script processing caused the
|
||||
|
@ -5271,8 +5271,7 @@ nsContentUtils::SetNodeTextContent(nsIContent* aContent,
|
||||
|
||||
// Might as well stick a batch around this since we're performing several
|
||||
// mutations.
|
||||
mozAutoDocUpdate updateBatch(aContent->GetComposedDoc(),
|
||||
UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(aContent->GetComposedDoc(), true);
|
||||
nsAutoMutationBatch mb;
|
||||
|
||||
if (aTryReuse && !aValue.IsEmpty()) {
|
||||
|
@ -2246,7 +2246,7 @@ nsIDocument::ResetToURI(nsIURI* aURI,
|
||||
mInUnlinkOrDeletion = true;
|
||||
uint32_t count = mChildren.ChildCount();
|
||||
{ // Scope for update
|
||||
MOZ_AUTO_DOC_UPDATE(this, UPDATE_CONTENT_MODEL, true);
|
||||
MOZ_AUTO_DOC_UPDATE(this, true);
|
||||
|
||||
// Invalidate cached array of child nodes
|
||||
InvalidateChildNodes();
|
||||
@ -5012,7 +5012,7 @@ nsIDocument::MaybeEndOutermostXBLUpdate()
|
||||
}
|
||||
|
||||
void
|
||||
nsIDocument::BeginUpdate(nsUpdateType aUpdateType)
|
||||
nsIDocument::BeginUpdate()
|
||||
{
|
||||
// If the document is going away, then it's probably okay to do things to it
|
||||
// in the wrong DocGroup. We're unlikely to run JS or do anything else
|
||||
@ -5031,13 +5031,13 @@ nsIDocument::BeginUpdate(nsUpdateType aUpdateType)
|
||||
|
||||
++mUpdateNestLevel;
|
||||
nsContentUtils::AddScriptBlocker();
|
||||
NS_DOCUMENT_NOTIFY_OBSERVERS(BeginUpdate, (this, aUpdateType));
|
||||
NS_DOCUMENT_NOTIFY_OBSERVERS(BeginUpdate, (this));
|
||||
}
|
||||
|
||||
void
|
||||
nsDocument::EndUpdate(nsUpdateType aUpdateType)
|
||||
nsDocument::EndUpdate()
|
||||
{
|
||||
NS_DOCUMENT_NOTIFY_OBSERVERS(EndUpdate, (this, aUpdateType));
|
||||
NS_DOCUMENT_NOTIFY_OBSERVERS(EndUpdate, (this));
|
||||
|
||||
nsContentUtils::RemoveScriptBlocker();
|
||||
|
||||
@ -6366,7 +6366,7 @@ nsIDocument::SetTitle(const nsAString& aTitle, ErrorResult& aRv)
|
||||
|
||||
// Batch updates so that mutation events don't change "the title
|
||||
// element" under us
|
||||
mozAutoDocUpdate updateBatch(this, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(this, true);
|
||||
|
||||
nsCOMPtr<Element> title = GetTitleElement();
|
||||
if (rootElement->IsSVGElement(nsGkAtoms::svg)) {
|
||||
|
@ -165,7 +165,7 @@ public:
|
||||
static bool IsWebAnimationsEnabled(JSContext* aCx, JSObject* aObject);
|
||||
static bool IsWebAnimationsEnabled(mozilla::dom::CallerType aCallerType);
|
||||
|
||||
virtual void EndUpdate(nsUpdateType aUpdateType) override;
|
||||
virtual void EndUpdate() override;
|
||||
virtual void BeginLoad() override;
|
||||
virtual void EndLoad() override;
|
||||
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "nsIApplicationCache.h"
|
||||
#include "nsIApplicationCacheContainer.h"
|
||||
#include "nsIContentViewer.h"
|
||||
#include "nsIDocumentObserver.h" // for typedef (nsUpdateType)
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
#include "nsILoadContext.h"
|
||||
#include "nsILoadGroup.h" // for member (in nsCOMPtr)
|
||||
@ -1860,8 +1859,8 @@ public:
|
||||
// BeginUpdate must be called before any batch of modifications of the
|
||||
// content model or of style data, EndUpdate must be called afterward.
|
||||
// To make this easy and painless, use the mozAutoDocUpdate helper class.
|
||||
void BeginUpdate(nsUpdateType aUpdateType);
|
||||
virtual void EndUpdate(nsUpdateType aUpdateType) = 0;
|
||||
void BeginUpdate();
|
||||
virtual void EndUpdate() = 0;
|
||||
|
||||
virtual void BeginLoad() = 0;
|
||||
virtual void EndLoad() = 0;
|
||||
|
@ -18,10 +18,6 @@ class nsIDocument;
|
||||
{ 0x71041fa3, 0x6dd7, 0x4cde, \
|
||||
{ 0xbb, 0x76, 0xae, 0xcc, 0x69, 0xe1, 0x75, 0x78 } }
|
||||
|
||||
typedef uint32_t nsUpdateType;
|
||||
|
||||
#define UPDATE_CONTENT_MODEL 0x00000001
|
||||
|
||||
// Document observer interface
|
||||
class nsIDocumentObserver : public nsIMutationObserver
|
||||
{
|
||||
@ -32,26 +28,25 @@ public:
|
||||
* Notify that a content model update is beginning. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void BeginUpdate(nsIDocument *aDocument,
|
||||
nsUpdateType aUpdateType) = 0;
|
||||
virtual void BeginUpdate(nsIDocument* aDocument) = 0;
|
||||
|
||||
/**
|
||||
* Notify that a content model update is finished. This call can be
|
||||
* nested.
|
||||
*/
|
||||
virtual void EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType) = 0;
|
||||
virtual void EndUpdate(nsIDocument* aDocument) = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load is beginning.
|
||||
*/
|
||||
virtual void BeginLoad(nsIDocument *aDocument) = 0;
|
||||
virtual void BeginLoad(nsIDocument* aDocument) = 0;
|
||||
|
||||
/**
|
||||
* Notify the observer that a document load has finished. Note that
|
||||
* the associated reflow of the document will be done <b>before</b>
|
||||
* EndLoad is invoked, not after.
|
||||
*/
|
||||
virtual void EndLoad(nsIDocument *aDocument) = 0;
|
||||
virtual void EndLoad(nsIDocument* aDocument) = 0;
|
||||
|
||||
/**
|
||||
* Notification that the state of a content node has changed.
|
||||
@ -86,11 +81,10 @@ public:
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
|
||||
|
||||
#define NS_DECL_NSIDOCUMENTOBSERVER_BEGINUPDATE \
|
||||
virtual void BeginUpdate(nsIDocument* aDocument, \
|
||||
nsUpdateType aUpdateType) override;
|
||||
virtual void BeginUpdate(nsIDocument* aDocument) override;
|
||||
|
||||
#define NS_DECL_NSIDOCUMENTOBSERVER_ENDUPDATE \
|
||||
virtual void EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) override;
|
||||
virtual void EndUpdate(nsIDocument* aDocument) override;
|
||||
|
||||
#define NS_DECL_NSIDOCUMENTOBSERVER_BEGINLOAD \
|
||||
virtual void BeginLoad(nsIDocument* aDocument) override;
|
||||
@ -119,11 +113,11 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentObserver, NS_IDOCUMENT_OBSERVER_IID)
|
||||
|
||||
#define NS_IMPL_NSIDOCUMENTOBSERVER_CORE_STUB(_class) \
|
||||
void \
|
||||
_class::BeginUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) \
|
||||
_class::BeginUpdate(nsIDocument* aDocument) \
|
||||
{ \
|
||||
} \
|
||||
void \
|
||||
_class::EndUpdate(nsIDocument* aDocument, nsUpdateType aUpdateType) \
|
||||
_class::EndUpdate(nsIDocument* aDocument) \
|
||||
{ \
|
||||
} \
|
||||
NS_IMPL_NSIMUTATIONOBSERVER_CORE_STUB(_class)
|
||||
|
@ -597,7 +597,7 @@ nsINode::Normalize()
|
||||
}
|
||||
}
|
||||
|
||||
mozAutoDocUpdate batch(doc, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate batch(doc, true);
|
||||
|
||||
// Merge and remove all nodes
|
||||
nsAutoString tmpStr;
|
||||
@ -1295,7 +1295,7 @@ nsINode::doInsertChildAt(nsIContent* aKid, uint32_t aIndex,
|
||||
|
||||
// Do this before checking the child-count since this could cause mutations
|
||||
nsIDocument* doc = GetUncomposedDoc();
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(), UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(), aNotify);
|
||||
|
||||
if (OwnerDoc() != aKid->OwnerDoc()) {
|
||||
ErrorResult error;
|
||||
@ -1644,7 +1644,7 @@ nsINode::doRemoveChildAt(uint32_t aIndex, bool aNotify,
|
||||
MOZ_ASSERT(!IsAttr());
|
||||
|
||||
nsMutationGuard::DidMutate();
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(), UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(), aNotify);
|
||||
|
||||
nsIContent* previousSibling = aKid->GetPreviousSibling();
|
||||
|
||||
@ -1965,8 +1965,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
// Scope for the mutation batch and scriptblocker, so they go away
|
||||
// while kungFuDeathGrip is still alive.
|
||||
{
|
||||
mozAutoDocUpdate batch(newContent->GetComposedDoc(),
|
||||
UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate batch(newContent->GetComposedDoc(), true);
|
||||
nsAutoMutationBatch mb(oldParent, true, true);
|
||||
oldParent->RemoveChildAt_Deprecated(removeIndex, true);
|
||||
if (nsAutoMutationBatch::GetCurrentBatch() == &mb) {
|
||||
@ -2043,8 +2042,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
// Scope for the mutation batch and scriptblocker, so they go away
|
||||
// while kungFuDeathGrip is still alive.
|
||||
{
|
||||
mozAutoDocUpdate batch(newContent->GetComposedDoc(),
|
||||
UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate batch(newContent->GetComposedDoc(), true);
|
||||
nsAutoMutationBatch mb(newContent, false, true);
|
||||
|
||||
for (uint32_t i = count; i > 0;) {
|
||||
@ -2114,7 +2112,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
||||
}
|
||||
}
|
||||
|
||||
mozAutoDocUpdate batch(GetComposedDoc(), UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate batch(GetComposedDoc(), true);
|
||||
nsAutoMutationBatch mb;
|
||||
|
||||
// Figure out which index we want to insert at. Note that we use
|
||||
|
@ -107,7 +107,7 @@ nsStyledElement::SetInlineStyleDeclaration(DeclarationBlock* aDeclaration,
|
||||
static_cast<uint8_t>(MutationEventBinding::ADDITION);
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL, aNotify);
|
||||
mozAutoDocUpdate updateBatch(document, aNotify);
|
||||
return SetAttrAndNotify(kNameSpaceID_None, nsGkAtoms::style, nullptr,
|
||||
oldValueSet ? &oldValue : nullptr, attrValue,
|
||||
nullptr, modType,
|
||||
|
@ -2292,8 +2292,7 @@ IMEContentObserver::DocumentObserver::Destroy()
|
||||
}
|
||||
|
||||
void
|
||||
IMEContentObserver::DocumentObserver::BeginUpdate(nsIDocument* aDocument,
|
||||
nsUpdateType aUpdateType)
|
||||
IMEContentObserver::DocumentObserver::BeginUpdate(nsIDocument* aDocument)
|
||||
{
|
||||
if (NS_WARN_IF(Destroyed()) || NS_WARN_IF(!IsObserving())) {
|
||||
return;
|
||||
@ -2303,8 +2302,7 @@ IMEContentObserver::DocumentObserver::BeginUpdate(nsIDocument* aDocument,
|
||||
}
|
||||
|
||||
void
|
||||
IMEContentObserver::DocumentObserver::EndUpdate(nsIDocument* aDocument,
|
||||
nsUpdateType aUpdateType)
|
||||
IMEContentObserver::DocumentObserver::EndUpdate(nsIDocument* aDocument)
|
||||
{
|
||||
if (NS_WARN_IF(Destroyed()) || NS_WARN_IF(!IsObserving()) ||
|
||||
NS_WARN_IF(!IsUpdating())) {
|
||||
|
@ -2959,8 +2959,7 @@ nsGenericHTMLElement::SetInnerText(const nsAString& aValue)
|
||||
|
||||
// Might as well stick a batch around this since we're performing several
|
||||
// mutations.
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(),
|
||||
UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(GetComposedDoc(), true);
|
||||
nsAutoMutationBatch mb;
|
||||
|
||||
mb.Init(this, true, false);
|
||||
|
@ -493,8 +493,7 @@ SinkContext::FlushTags()
|
||||
mSink->mUpdatesInNotification = 0;
|
||||
{
|
||||
// Scope so we call EndUpdate before we decrease mInNotification
|
||||
mozAutoDocUpdate updateBatch(mSink->mDocument, UPDATE_CONTENT_MODEL,
|
||||
true);
|
||||
mozAutoDocUpdate updateBatch(mSink->mDocument, true);
|
||||
mSink->mBeganUpdate = true;
|
||||
|
||||
// Start from the base of the stack (growing downward) and do
|
||||
@ -955,7 +954,7 @@ HTMLContentSink::NotifyInsert(nsIContent* aContent,
|
||||
|
||||
{
|
||||
// Scope so we call EndUpdate before we decrease mInNotification
|
||||
MOZ_AUTO_DOC_UPDATE(mDocument, UPDATE_CONTENT_MODEL, !mBeganUpdate);
|
||||
MOZ_AUTO_DOC_UPDATE(mDocument, !mBeganUpdate);
|
||||
nsNodeUtils::ContentInserted(NODE_FROM(aContent, mDocument),
|
||||
aChildContent);
|
||||
mLastNotificationTime = PR_Now();
|
||||
|
@ -2111,11 +2111,11 @@ nsHTMLDocument::MaybeEditingStateChanged()
|
||||
}
|
||||
|
||||
void
|
||||
nsHTMLDocument::EndUpdate(nsUpdateType aUpdateType)
|
||||
nsHTMLDocument::EndUpdate()
|
||||
{
|
||||
const bool reset = !mPendingMaybeEditingStateChanged;
|
||||
mPendingMaybeEditingStateChanged = true;
|
||||
nsDocument::EndUpdate(aUpdateType);
|
||||
nsDocument::EndUpdate();
|
||||
if (reset) {
|
||||
mPendingMaybeEditingStateChanged = false;
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
};
|
||||
friend class nsAutoEditingState;
|
||||
|
||||
void EndUpdate(nsUpdateType aUpdateType) override;
|
||||
void EndUpdate() override;
|
||||
|
||||
virtual void SetMayStartLayout(bool aMayStartLayout) override;
|
||||
|
||||
|
@ -1433,8 +1433,7 @@ nsSVGElement::DidChangeValue(nsAtom* aName,
|
||||
: static_cast<uint8_t>(MutationEventBinding::ADDITION);
|
||||
|
||||
nsIDocument* document = GetComposedDoc();
|
||||
mozAutoDocUpdate updateBatch(document, UPDATE_CONTENT_MODEL,
|
||||
kNotifyDocumentObservers);
|
||||
mozAutoDocUpdate updateBatch(document, kNotifyDocumentObservers);
|
||||
// XXX Really, the fourth argument to SetAttrAndNotify should be null if
|
||||
// aEmptyOrOldValue does not represent the actual previous value of the
|
||||
// attribute, but currently SVG elements do not even use the old attribute
|
||||
|
@ -401,9 +401,9 @@ nsXMLContentSink::OnTransformDone(nsresult aResult,
|
||||
if (rootElement) {
|
||||
NS_ASSERTION(mDocument->ComputeIndexOf(rootElement) != -1,
|
||||
"rootElement not in doc?");
|
||||
mDocument->BeginUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->BeginUpdate();
|
||||
nsNodeUtils::ContentInserted(mDocument, rootElement);
|
||||
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->EndUpdate();
|
||||
}
|
||||
|
||||
// Start the layout process
|
||||
@ -1539,7 +1539,7 @@ nsXMLContentSink::FlushTags()
|
||||
++mInNotification;
|
||||
{
|
||||
// Scope so we call EndUpdate before we decrease mInNotification
|
||||
mozAutoDocUpdate updateBatch(mDocument, UPDATE_CONTENT_MODEL, true);
|
||||
mozAutoDocUpdate updateBatch(mDocument, true);
|
||||
mBeganUpdate = true;
|
||||
|
||||
// Don't release last text node in case we need to add to it again
|
||||
|
@ -2894,10 +2894,9 @@ XULDocument::MaybeBroadcast()
|
||||
}
|
||||
|
||||
void
|
||||
XULDocument::EndUpdate(nsUpdateType aUpdateType)
|
||||
XULDocument::EndUpdate()
|
||||
{
|
||||
XMLDocument::EndUpdate(aUpdateType);
|
||||
|
||||
XMLDocument::EndUpdate();
|
||||
MaybeBroadcast();
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ public:
|
||||
bool aWasAlternate,
|
||||
nsresult aStatus) override;
|
||||
|
||||
virtual void EndUpdate(nsUpdateType aUpdateType) override;
|
||||
virtual void EndUpdate() override;
|
||||
|
||||
virtual bool IsDocumentRightToLeft() override;
|
||||
|
||||
|
@ -271,26 +271,12 @@ HTMLEditor::DeleteRefToAnonymousNode(ManualNACPtr aContent,
|
||||
// Need to check whether aShell has been destroyed (but not yet deleted).
|
||||
// See bug 338129.
|
||||
if (aContent->IsInComposedDoc() && aShell && !aShell->IsDestroying()) {
|
||||
// Call BeginUpdate() so that the nsCSSFrameConstructor/PresShell
|
||||
// knows we're messing with the frame tree.
|
||||
//
|
||||
// FIXME(emilio): Shouldn't this use the document update mechanism instead?
|
||||
// Also, is it really needed? This is NAC anyway.
|
||||
nsCOMPtr<nsIDocument> document = GetDocument();
|
||||
if (document) {
|
||||
aShell->BeginUpdate(document, UPDATE_CONTENT_MODEL);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(aContent->IsRootOfAnonymousSubtree());
|
||||
MOZ_ASSERT(!aContent->GetPreviousSibling(), "NAC has no siblings");
|
||||
|
||||
// FIXME(emilio): This is the only caller to PresShell::ContentRemoved that
|
||||
// passes NAC into it. This is not great!
|
||||
aShell->ContentRemoved(aContent, nullptr);
|
||||
|
||||
if (document) {
|
||||
aShell->EndUpdate(document, UPDATE_CONTENT_MODEL);
|
||||
}
|
||||
}
|
||||
|
||||
// The ManualNACPtr destructor will invoke UnbindFromTree.
|
||||
|
@ -69,7 +69,7 @@ public:
|
||||
MOZ_RELEASE_ASSERT(IsInFlush(), "Tried to double-open doc update.");
|
||||
MOZ_RELEASE_ASSERT(mParser, "Started doc update without parser.");
|
||||
mFlushState = eInDocUpdate;
|
||||
mDocument->BeginUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->BeginUpdate();
|
||||
}
|
||||
|
||||
inline void EndDocUpdate()
|
||||
@ -77,7 +77,7 @@ public:
|
||||
MOZ_RELEASE_ASSERT(IsInDocUpdate(),
|
||||
"Tried to end doc update without one open.");
|
||||
mFlushState = eInFlush;
|
||||
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->EndUpdate();
|
||||
}
|
||||
|
||||
inline void BeginFlush()
|
||||
|
@ -63,14 +63,14 @@ public:
|
||||
mDocument = nullptr;
|
||||
} else {
|
||||
mDocument = aCurrentDoc;
|
||||
aCurrentDoc->BeginUpdate(UPDATE_CONTENT_MODEL);
|
||||
aCurrentDoc->BeginUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
~nsHtml5OtherDocUpdate()
|
||||
{
|
||||
if (MOZ_UNLIKELY(mDocument)) {
|
||||
mDocument->EndUpdate(UPDATE_CONTENT_MODEL);
|
||||
mDocument->EndUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user