AX: Do the early return when role is different than UnknownRole
[WebKit-https.git] / Source / WebCore / accessibility / AccessibilityRenderObject.cpp
index abeecab..ea2d21d 100644 (file)
@@ -2446,13 +2446,10 @@ AccessibilityRole AccessibilityRenderObject::determineAccessibilityRole()
     if (!m_renderer)
         return UnknownRole;
 
-    m_ariaRole = determineAriaRoleAttribute();
+    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
+        return m_ariaRole;
     
     Node* node = m_renderer->node();
-    AccessibilityRole ariaRole = ariaRoleAttribute();
-    if (ariaRole != UnknownRole)
-        return ariaRole;
-
     RenderBoxModelObject* cssBox = renderBoxModelObject();
 
     if (node && node->isLink()) {