AX: Do the early return when role is different than UnknownRole
authork.czech@samsung.com <k.czech@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Oct 2014 09:02:00 +0000 (09:02 +0000)
committerk.czech@samsung.com <k.czech@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Oct 2014 09:02:00 +0000 (09:02 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137880

Reviewed by Chris Fleizach.

We do not need to call ariaRoleAttribute() to check whether m_ariaRole is different than UnknownRole.
Just check m_ariaRole instead.

No new tests, no behavior change, just some cleanup

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRole):
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::determineAccessibilityRole):
* accessibility/AccessibilityTableRow.cpp:
(WebCore::AccessibilityTableRow::determineAccessibilityRole):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175100 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityNodeObject.cpp
Source/WebCore/accessibility/AccessibilityRenderObject.cpp
Source/WebCore/accessibility/AccessibilityTableRow.cpp

index 913c479..d6102be 100644 (file)
@@ -1,3 +1,22 @@
+2014-10-23  Krzysztof Czech  <k.czech@samsung.com>
+
+        AX: Do the early return when role is different than UnknownRole
+        https://bugs.webkit.org/show_bug.cgi?id=137880
+
+        Reviewed by Chris Fleizach.
+
+        We do not need to call ariaRoleAttribute() to check whether m_ariaRole is different than UnknownRole.
+        Just check m_ariaRole instead.
+
+        No new tests, no behavior change, just some cleanup
+
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
+        * accessibility/AccessibilityRenderObject.cpp:
+        (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
+        * accessibility/AccessibilityTableRow.cpp:
+        (WebCore::AccessibilityTableRow::determineAccessibilityRole):
+
 2014-10-23  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         CSS JIT: Implement :matches
index 0d61c31..5f1f459 100644 (file)
@@ -281,12 +281,9 @@ AccessibilityRole AccessibilityNodeObject::determineAccessibilityRole()
     if (!node())
         return UnknownRole;
 
-    m_ariaRole = determineAriaRoleAttribute();
+    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
+        return m_ariaRole;
     
-    AccessibilityRole ariaRole = ariaRoleAttribute();
-    if (ariaRole != UnknownRole)
-        return ariaRole;
-
     if (node()->isLink())
         return WebCoreLinkRole;
     if (node()->isTextNode())
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()) {
index 641a014..665295e 100644 (file)
@@ -61,11 +61,8 @@ AccessibilityRole AccessibilityTableRow::determineAccessibilityRole()
     if (!isTableRow())
         return AccessibilityRenderObject::determineAccessibilityRole();
 
-    m_ariaRole = determineAriaRoleAttribute();
-
-    AccessibilityRole ariaRole = ariaRoleAttribute();
-    if (ariaRole != UnknownRole)
-        return ariaRole;
+    if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
+        return m_ariaRole;
 
     return RowRole;
 }