Commit 338b38e0 authored by kojii's avatar kojii Committed by Commit bot

Avoid updateStyleAndLayoutTree in determineAccessibilityRole

This patch avoids updating layout tree in
AXNodeObject::determineAccessibilityRole().

Element::isFocusable() requires styles to be updated. However, when
layout code calls determineAccessibilityRole(), updating layout tree
should be avoided since it may destroy the calling object.

This patch replaces it to supportsFocus(), since the main purpose is
to give elements with tabIndex explicitly set get some role.

This is a speculative fix.

BUG=590369, 647602, 665168

Review-Url: https://codereview.chromium.org/2532023002
Cr-Commit-Position: refs/heads/master@{#435009}
parent 4de4c083
......@@ -527,11 +527,11 @@ AccessibilityRole AXNodeObject::determineAccessibilityRole() {
return role;
if (getNode()->isElementNode()) {
Element* element = toElement(getNode());
if (element->isInCanvasSubtree()) {
getDocument()->updateStyleAndLayoutTreeForNode(element);
if (element->isFocusable())
return GroupRole;
}
// A generic element with tabIndex explicitly set gets GroupRole.
// The layout checks for focusability aren't critical here; a false
// positive would be harmless.
if (element->isInCanvasSubtree() && element->supportsFocus())
return GroupRole;
}
return UnknownRole;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment