Skip to content

Commit

Permalink
Bug 819303 - crash in nsTextEquivUtils::AppendTextEquivFromTextConten…
Browse files Browse the repository at this point in the history
…t. f=marcoz r=surkov
  • Loading branch information
dbolter committed Dec 7, 2012
1 parent 5677c44 commit 7493ebc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
8 changes: 5 additions & 3 deletions accessible/src/html/HTMLTableAccessible.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ HTMLTableCellAccessible::NativeAttributes()
if (ChildCount() == 1) {
Accessible* abbr = FirstChild();
if (abbr->IsAbbreviation()) {
nsTextEquivUtils::
AppendTextEquivFromTextContent(abbr->GetContent()->GetFirstChild(),
&abbrText);
nsIContent* firstChildNode = abbr->GetContent()->GetFirstChild();
if (firstChildNode) {
nsTextEquivUtils::
AppendTextEquivFromTextContent(firstChildNode, &abbrText);
}
}
}
if (abbrText.IsEmpty())
Expand Down
9 changes: 9 additions & 0 deletions accessible/tests/mochitest/attributes/test_obj.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@
testAttrs("th2", { "abbr": "SS#" }, true);
testAttrs("th2", { "axis": "social" }, true);

// don't barf on an empty abbr element.
testAbsentAttrs("th3", { "abbr": "" }, true);

// application accessible
if (WIN) {
var gfxInfo = Components.classes["@mozilla.org/gfx/info;1"].
Expand Down Expand Up @@ -154,6 +157,11 @@
title="Expand support for nsIAccessibleEvent::OBJECT_ATTRIBUTE_CHANGE">
Mozilla Bug 563862
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=819303"
title="crash in nsTextEquivUtils::AppendTextEquivFromTextContent">
Mozilla Bug 819303
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
Expand Down Expand Up @@ -211,6 +219,7 @@
<tr>
<th id="th1"><abbr title="Social Security Number">SS#</abbr></th>
<th id="th2" abbr="SS#" axis="social">Social Security Number</th>
<th id="th3"><abbr></abbr></th>
</tr>
</table>

Expand Down

0 comments on commit 7493ebc

Please sign in to comment.