mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-29 20:07:30 +09:00
[parser] Account for some corner-case structural document issues.
This commit is contained in:
parent
501a90aad3
commit
c91765edda
1 changed files with 22 additions and 0 deletions
|
|
@ -200,6 +200,13 @@ nsHtml5TreeOperation::Append(nsIContent* aNode,
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aBuilder);
|
MOZ_ASSERT(aBuilder);
|
||||||
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
Detach(aNode, aBuilder);
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
// Can this happen? If it can, give up.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
nsHtml5OtherDocUpdate update(aParent->OwnerDoc(),
|
nsHtml5OtherDocUpdate update(aParent->OwnerDoc(),
|
||||||
aBuilder->GetDocument());
|
aBuilder->GetDocument());
|
||||||
|
|
@ -219,6 +226,13 @@ nsHtml5TreeOperation::AppendToDocument(nsIContent* aNode,
|
||||||
MOZ_ASSERT(aBuilder);
|
MOZ_ASSERT(aBuilder);
|
||||||
MOZ_ASSERT(aBuilder->GetDocument() == aNode->OwnerDoc());
|
MOZ_ASSERT(aBuilder->GetDocument() == aNode->OwnerDoc());
|
||||||
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
Detach(aNode, aBuilder);
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
// Can this happen? If it can, give up.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsIDocument* doc = aBuilder->GetDocument();
|
nsIDocument* doc = aBuilder->GetDocument();
|
||||||
|
|
@ -308,6 +322,14 @@ nsHtml5TreeOperation::FosterParent(nsIContent* aNode,
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aBuilder);
|
MOZ_ASSERT(aBuilder);
|
||||||
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
MOZ_ASSERT(aBuilder->IsInDocUpdate());
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
Detach(aNode, aBuilder);
|
||||||
|
if (MOZ_UNLIKELY(aNode->GetParentNode())) {
|
||||||
|
// Can this happen? If it can, give up.
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
nsIContent* foster = aTable->GetParent();
|
nsIContent* foster = aTable->GetParent();
|
||||||
|
|
||||||
if (IsElementOrTemplateContent(foster)) {
|
if (IsElementOrTemplateContent(foster)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue