Bug 1034640 - crash in nsAccessibilityService::CreateAccessibleByFrameType, r=tbsaunde
authorAlexander Surkov <surkov.alexander@gmail.com>
Tue, 15 Jul 2014 10:17:16 -0400
changeset 194125 06a47123670eed7a7f7b74868db45a6f9e5fa838
parent 194124 8a29d7e989007132f4350455b1051c4fbf1fb737
child 194126 6876da7d8806680ec3336ccbeff2928bc46f18c7
push id46266
push usersurkov.alexander@gmail.com
push dateTue, 15 Jul 2014 14:25:39 +0000
treeherdermozilla-inbound@06a47123670e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstbsaunde
bugs1034640
milestone33.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1034640 - crash in nsAccessibilityService::CreateAccessibleByFrameType, r=tbsaunde
accessible/base/nsAccessibilityService.cpp
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1555,19 +1555,19 @@ nsAccessibilityService::CreateAccessible
         newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
       else
         newAcc = new HyperTextAccessibleWrap(aContent, document);
       break;
 
     case eHTMLTableRowType: {
       // Accessible HTML table row may be a child of tbody/tfoot/thead of
       // accessible HTML table or a direct child of accessible of HTML table.
-      Accessible* table = aContext->IsTable() ?
-        aContext :
-        (aContext->Parent()->IsTable() ? aContext->Parent() : nullptr);
+      Accessible* table = aContext->IsTable() ? aContext : nullptr;
+      if (!table && aContext->Parent() && aContext->Parent()->IsTable())
+        table = aContext->Parent();
 
       if (table) {
         nsIContent* parentContent = aContent->GetParent();
         nsIFrame* parentFrame = parentContent->GetPrimaryFrame();
         if (parentFrame->GetType() != nsGkAtoms::tableOuterFrame) {
           parentContent = parentContent->GetParent();
           parentFrame = parentContent->GetPrimaryFrame();
         }