diff --git a/content/html/content/crashtests/741250.xhtml b/content/html/content/crashtests/741250.xhtml new file mode 100644 index 000000000000..e18a9409fe14 --- /dev/null +++ b/content/html/content/crashtests/741250.xhtml @@ -0,0 +1,9 @@ + +
+ + diff --git a/content/html/content/crashtests/crashtests.list b/content/html/content/crashtests/crashtests.list index 08eafc9a5c88..75186d62b47f 100644 --- a/content/html/content/crashtests/crashtests.list +++ b/content/html/content/crashtests/crashtests.list @@ -34,3 +34,4 @@ load 682058.xhtml load 682460.html load 673853.html load 738744.xhtml +load 741250.xhtml diff --git a/content/html/content/src/nsHTMLFormElement.cpp b/content/html/content/src/nsHTMLFormElement.cpp index 3bf04572bc2b..91a194965e7a 100644 --- a/content/html/content/src/nsHTMLFormElement.cpp +++ b/content/html/content/src/nsHTMLFormElement.cpp @@ -2366,7 +2366,10 @@ nsFormControlList::AddElementToTable(nsGenericHTMLFormElement* aChild, // the list in the hash nsSimpleContentList *list = new nsSimpleContentList(mForm); - NS_ASSERTION(content->GetParent(), "Item in list without parent"); + // If an element has a @form, we can assume it *might* be able to not have + // a parent and still be in the form. + NS_ASSERTION(content->HasAttr(kNameSpaceID_None, nsGkAtoms::form) || + content->GetParent(), "Item in list without parent"); // Determine the ordering between the new and old element. bool newFirst = nsContentUtils::PositionIsBefore(aChild, content);