зеркало из https://github.com/mozilla/gecko-dev.git
Bug 913586 (Part 3) - Update Maybe users in content. r=bent
--HG-- extra : rebase_source : 79526555fcb097068b9d0b54b90e35b0d53eb43e
This commit is contained in:
Родитель
558486ff50
Коммит
312b2ad608
|
@ -1566,10 +1566,10 @@ nsDocument::nsDocument(const char* aContentType)
|
|||
// Start out mLastStyleSheetSet as null, per spec
|
||||
SetDOMStringToNull(mLastStyleSheetSet);
|
||||
|
||||
if (sProcessingStack.empty()) {
|
||||
sProcessingStack.construct();
|
||||
if (!sProcessingStack) {
|
||||
sProcessingStack.emplace();
|
||||
// Add the base queue sentinel to the processing stack.
|
||||
sProcessingStack.ref().AppendElement((CustomElementData*) nullptr);
|
||||
sProcessingStack->AppendElement((CustomElementData*) nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5633,7 +5633,7 @@ nsDocument::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
|
|||
|
||||
if (!elementData->mElementIsBeingCreated) {
|
||||
CustomElementData* lastData =
|
||||
sProcessingStack.ref().SafeLastElement(nullptr);
|
||||
sProcessingStack->SafeLastElement(nullptr);
|
||||
|
||||
// A new element queue needs to be pushed if the queue at the
|
||||
// top of the stack is associated with another microtask level.
|
||||
|
@ -5649,10 +5649,10 @@ nsDocument::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType aType,
|
|||
if (shouldPushElementQueue) {
|
||||
// Push a sentinel value on the processing stack to mark the
|
||||
// boundary between the element queues.
|
||||
sProcessingStack.ref().AppendElement((CustomElementData*) nullptr);
|
||||
sProcessingStack->AppendElement((CustomElementData*) nullptr);
|
||||
}
|
||||
|
||||
sProcessingStack.ref().AppendElement(elementData);
|
||||
sProcessingStack->AppendElement(elementData);
|
||||
elementData->mAssociatedMicroTask =
|
||||
static_cast<int32_t>(nsContentUtils::MicroTaskLevel());
|
||||
|
||||
|
@ -5674,7 +5674,7 @@ nsDocument::ProcessBaseElementQueue()
|
|||
{
|
||||
// Prevent re-entrance. Also, if a microtask checkpoint is reached
|
||||
// and there is no processing stack to process, then we are done.
|
||||
if (sProcessingBaseElementQueue || sProcessingStack.empty()) {
|
||||
if (sProcessingBaseElementQueue || !sProcessingStack) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -5689,7 +5689,7 @@ nsDocument::ProcessTopElementQueue(bool aIsBaseQueue)
|
|||
{
|
||||
MOZ_ASSERT(nsContentUtils::IsSafeToRunScript());
|
||||
|
||||
nsTArray<CustomElementData*>& stack = sProcessingStack.ref();
|
||||
nsTArray<CustomElementData*>& stack = *sProcessingStack;
|
||||
uint32_t firstQueue = stack.LastIndexOf((CustomElementData*) nullptr);
|
||||
|
||||
if (aIsBaseQueue && firstQueue != 0) {
|
||||
|
@ -11813,7 +11813,7 @@ void
|
|||
nsDocument::XPCOMShutdown()
|
||||
{
|
||||
gPendingPointerLockRequest = nullptr;
|
||||
sProcessingStack.destroyIfConstructed();
|
||||
sProcessingStack.reset();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -1997,17 +1997,17 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
// into the DOM.
|
||||
uint32_t count = newContent->GetChildCount();
|
||||
|
||||
fragChildren.construct();
|
||||
fragChildren.emplace();
|
||||
|
||||
// Copy the children into a separate array to avoid having to deal with
|
||||
// mutations to the fragment later on here.
|
||||
fragChildren.ref().SetCapacity(count);
|
||||
fragChildren->SetCapacity(count);
|
||||
for (nsIContent* child = newContent->GetFirstChild();
|
||||
child;
|
||||
child = child->GetNextSibling()) {
|
||||
NS_ASSERTION(child->GetCurrentDoc() == nullptr,
|
||||
"How did we get a child with a current doc?");
|
||||
fragChildren.ref().AppendElement(child);
|
||||
fragChildren->AppendElement(child);
|
||||
}
|
||||
|
||||
// Hold a strong ref to nodeToInsertBefore across the removals
|
||||
|
@ -2040,7 +2040,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
|
||||
// Verify that all the things in fragChildren have no parent.
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
if (fragChildren.ref().ElementAt(i)->GetParentNode()) {
|
||||
if (fragChildren->ElementAt(i)->GetParentNode()) {
|
||||
aError.Throw(NS_ERROR_DOM_HIERARCHY_REQUEST_ERR);
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2071,7 +2071,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
if (IsNodeOfType(nsINode::eDOCUMENT)) {
|
||||
bool sawElement = false;
|
||||
for (uint32_t i = 0; i < count; ++i) {
|
||||
nsIContent* child = fragChildren.ref().ElementAt(i);
|
||||
nsIContent* child = fragChildren->ElementAt(i);
|
||||
if (child->IsElement()) {
|
||||
if (sawElement) {
|
||||
// No good
|
||||
|
@ -2159,7 +2159,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
mutationBatch->SetNextSibling(GetChildAt(insPos));
|
||||
}
|
||||
|
||||
uint32_t count = fragChildren.ref().Length();
|
||||
uint32_t count = fragChildren->Length();
|
||||
if (!count) {
|
||||
return result;
|
||||
}
|
||||
|
@ -2167,14 +2167,14 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
bool appending =
|
||||
!IsNodeOfType(eDOCUMENT) && uint32_t(insPos) == GetChildCount();
|
||||
int32_t firstInsPos = insPos;
|
||||
nsIContent* firstInsertedContent = fragChildren.ref().ElementAt(0);
|
||||
nsIContent* firstInsertedContent = fragChildren->ElementAt(0);
|
||||
|
||||
// Iterate through the fragment's children, and insert them in the new
|
||||
// parent
|
||||
for (uint32_t i = 0; i < count; ++i, ++insPos) {
|
||||
// XXXbz how come no reparenting here? That seems odd...
|
||||
// Insert the child.
|
||||
aError = InsertChildAt(fragChildren.ref().ElementAt(i), insPos,
|
||||
aError = InsertChildAt(fragChildren->ElementAt(i), insPos,
|
||||
!appending);
|
||||
if (aError.Failed()) {
|
||||
// Make sure to notify on any children that we did succeed to insert
|
||||
|
@ -2201,7 +2201,7 @@ nsINode::ReplaceOrInsertBefore(bool aReplace, nsINode* aNewChild,
|
|||
// Optimize for the case when there are no listeners
|
||||
if (nsContentUtils::
|
||||
HasMutationListeners(doc, NS_EVENT_BITS_MUTATION_NODEINSERTED)) {
|
||||
Element::FireNodeInserted(doc, this, fragChildren.ref());
|
||||
Element::FireNodeInserted(doc, this, *fragChildren);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1162,8 +1162,8 @@ nsScriptLoader::EvaluateScript(nsScriptLoadRequest* aRequest,
|
|||
// execution currentScript of the master should refer to this
|
||||
// script. So let's update the mCurrentScript of the ScriptLoader
|
||||
// of the master document too.
|
||||
masterScriptUpdater.construct(master->ScriptLoader(),
|
||||
aRequest->mElement);
|
||||
masterScriptUpdater.emplace(master->ScriptLoader(),
|
||||
aRequest->mElement);
|
||||
}
|
||||
|
||||
JS::CompileOptions options(entryScript.cx());
|
||||
|
|
Загрузка…
Ссылка в новой задаче