mirror of
https://github.com/roytam1/basilisk55.git
synced 2026-05-26 15:02:46 +00:00
import from UXP: [parser] Account for some corner-case structural document issues. (49e8159c)
This commit is contained in:
@@ -201,6 +201,13 @@ nsHtml5TreeOperation::Append(nsIContent* aNode,
|
||||
{
|
||||
MOZ_ASSERT(aBuilder);
|
||||
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;
|
||||
nsHtml5OtherDocUpdate update(aParent->OwnerDoc(),
|
||||
aBuilder->GetDocument());
|
||||
@@ -220,6 +227,13 @@ nsHtml5TreeOperation::AppendToDocument(nsIContent* aNode,
|
||||
MOZ_ASSERT(aBuilder);
|
||||
MOZ_ASSERT(aBuilder->GetDocument() == aNode->OwnerDoc());
|
||||
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;
|
||||
|
||||
nsIDocument* doc = aBuilder->GetDocument();
|
||||
@@ -309,6 +323,14 @@ nsHtml5TreeOperation::FosterParent(nsIContent* aNode,
|
||||
{
|
||||
MOZ_ASSERT(aBuilder);
|
||||
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();
|
||||
|
||||
if (IsElementOrTemplateContent(foster)) {
|
||||
|
||||
Reference in New Issue
Block a user