Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1216)

Unified Diff: Source/modules/accessibility/AXNodeObject.cpp

Issue 1052123003: Adds null check for isHTMLTableCellElement for AX presentational Role. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/accessibility/AXNodeObject.cpp
diff --git a/Source/modules/accessibility/AXNodeObject.cpp b/Source/modules/accessibility/AXNodeObject.cpp
index 5f34fd13931091e44b4f231ea4db6d2e4983393f..c9294b0ff1f2039b98b16582f4c5c83e50ccc39a 100644
--- a/Source/modules/accessibility/AXNodeObject.cpp
+++ b/Source/modules/accessibility/AXNodeObject.cpp
@@ -205,13 +205,13 @@ static bool isPresentationRoleInTable(AXObject* parent, Node* child)
// cell(its role)-> tr(tr role)-> tfoot, tbody, thead(ignored role) -> table(table role).
// If table has presentation role, it will be like
// cell(group)-> tr(unknown) -> tfoot, tbody, thead(ignored) -> table(presentation).
- if (isHTMLTableCellElement(child) && isHTMLTableRowElement(*parentNode))
+ if (child && isHTMLTableCellElement(*child) && isHTMLTableRowElement(*parentNode))
return parent->hasInheritedPresentationalRole();
if (isHTMLTableRowElement(child) && isHTMLTableSectionElement(*parentNode)) {
// Because TableSections have ignored role, presentation should be checked with its parent node
AXObject* tableObject = parent->parentObject();
- Node* tableNode = tableObject->node();
+ Node* tableNode = tableObject ? tableObject->node() : 0;
return isHTMLTableElement(tableNode) && tableObject->hasInheritedPresentationalRole();
}
return false;
@@ -230,7 +230,7 @@ static bool isRequiredOwnedElement(AXObject* parent, AccessibilityRole childRole
if (childRole == MenuItemCheckBoxRole || childRole == MenuItemRole || childRole == MenuItemRadioRole)
return isHTMLMenuElement(*parentNode);
- if (isHTMLTableCellElement(childNode))
+ if (childNode && isHTMLTableCellElement(*childNode))
return isHTMLTableRowElement(*parentNode);
if (isHTMLTableRowElement(childNode))
return isHTMLTableSectionElement(*parentNode);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698