mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 14:58:37 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
f0dfd9ac73
4 changed files with 40 additions and 0 deletions
|
|
@ -1963,6 +1963,40 @@ nsINode::Append(const Sequence<OwningNodeOrString>& aNodes,
|
|||
AppendChild(*node, aRv);
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#dom-parentnode-replacechildren
|
||||
void nsINode::ReplaceChildren(const Sequence<OwningNodeOrString>& aNodes,
|
||||
ErrorResult& aRv) {
|
||||
nsCOMPtr<nsIDocument> doc = OwnerDoc();
|
||||
nsCOMPtr<nsINode> node = ConvertNodesOrStringsIntoNode(aNodes, doc, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EnsurePreInsertionValidity(*node, nullptr, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Needed when used in combination with contenteditable (maybe)
|
||||
mozAutoDocUpdate updateBatch(doc, UPDATE_CONTENT_MODEL, true);
|
||||
|
||||
nsAutoMutationBatch mb(this, true, false);
|
||||
|
||||
// Replace all with node within this.
|
||||
while (mFirstChild) {
|
||||
int32_t index = IndexOf(mFirstChild);
|
||||
if (index == -1) {
|
||||
NS_ASSERTION(index != -1, "First child must have an index");
|
||||
return;
|
||||
}
|
||||
RemoveChildAt(index, true);
|
||||
}
|
||||
mb.RemovalDone();
|
||||
|
||||
AppendChild(*node, aRv);
|
||||
mb.NodesAdded();
|
||||
}
|
||||
|
||||
void
|
||||
nsINode::doRemoveChildAt(uint32_t aIndex, bool aNotify,
|
||||
nsIContent* aKid, nsAttrAndChildArray& aChildArray)
|
||||
|
|
|
|||
|
|
@ -1980,6 +1980,7 @@ public:
|
|||
|
||||
void Prepend(const Sequence<OwningNodeOrString>& aNodes, ErrorResult& aRv);
|
||||
void Append(const Sequence<OwningNodeOrString>& aNodes, ErrorResult& aRv);
|
||||
void ReplaceChildren(const Sequence<OwningNodeOrString>& aNodes, ErrorResult& aRv);
|
||||
|
||||
void GetBoxQuads(const BoxQuadOptions& aOptions,
|
||||
nsTArray<RefPtr<DOMQuad> >& aResult,
|
||||
|
|
|
|||
|
|
@ -2343,6 +2343,9 @@ ScriptLoader::EvaluateScript(ScriptLoadRequest* aRequest)
|
|||
FinishDynamicImport(cx, request, rv);
|
||||
}
|
||||
} else {
|
||||
// Update our current script.
|
||||
AutoCurrentScriptUpdater scriptUpdater(this, aRequest->Element());
|
||||
|
||||
JS::CompileOptions options(cx);
|
||||
rv = FillCompileOptionsForRequest(aes, aRequest, global, &options);
|
||||
|
||||
|
|
|
|||
|
|
@ -22,4 +22,6 @@ interface ParentNode {
|
|||
void prepend((Node or DOMString)... nodes);
|
||||
[CEReactions, Throws, Unscopable]
|
||||
void append((Node or DOMString)... nodes);
|
||||
[CEReactions, Throws, Unscopable]
|
||||
void replaceChildren((Node or DOMString)... nodes);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue