Bug 903106, <tr>.sectionRowIndex crashes, r=dz

This commit is contained in:
Olli Pettay 2013-08-09 00:00:23 +03:00
parent 35b2fd6629
commit d182d65e5c
3 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,3 @@
<script>
document.createElement("tr").sectionRowIndex;
</script>

View File

@ -53,3 +53,4 @@ pref(dom.experimental_forms_range,true) load 838256-1.html
load 862084.html
load 865147.html
load 877910.html
load 903106.html

View File

@ -49,9 +49,9 @@ HTMLTableSectionElement*
HTMLTableRowElement::GetSection() const
{
nsIContent* parent = GetParent();
if (parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead ||
parent->Tag() == nsGkAtoms::tbody ||
parent->Tag() == nsGkAtoms::tfoot)) {
if (parent && parent->IsHTML() && (parent->Tag() == nsGkAtoms::thead ||
parent->Tag() == nsGkAtoms::tbody ||
parent->Tag() == nsGkAtoms::tfoot)) {
return static_cast<HTMLTableSectionElement*>(parent);
}
return nullptr;