| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) | 520 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) |
| 521 return m_ariaRole; | 521 return m_ariaRole; |
| 522 if (getNode()->isTextNode()) | 522 if (getNode()->isTextNode()) |
| 523 return StaticTextRole; | 523 return StaticTextRole; |
| 524 | 524 |
| 525 AccessibilityRole role = nativeAccessibilityRoleIgnoringAria(); | 525 AccessibilityRole role = nativeAccessibilityRoleIgnoringAria(); |
| 526 if (role != UnknownRole) | 526 if (role != UnknownRole) |
| 527 return role; | 527 return role; |
| 528 if (getNode()->isElementNode()) { | 528 if (getNode()->isElementNode()) { |
| 529 Element* element = toElement(getNode()); | 529 Element* element = toElement(getNode()); |
| 530 if (element->isInCanvasSubtree()) { | 530 // A generic element with tabIndex explicitly set gets GroupRole. |
| 531 getDocument()->updateStyleAndLayoutTreeForNode(element); | 531 // The layout checks for focusability aren't critical here; a false |
| 532 if (element->isFocusable()) | 532 // positive would be harmless. |
| 533 return GroupRole; | 533 if (element->isInCanvasSubtree() && element->supportsFocus()) |
| 534 } | 534 return GroupRole; |
| 535 } | 535 } |
| 536 return UnknownRole; | 536 return UnknownRole; |
| 537 } | 537 } |
| 538 | 538 |
| 539 AccessibilityRole AXNodeObject::determineAriaRoleAttribute() const { | 539 AccessibilityRole AXNodeObject::determineAriaRoleAttribute() const { |
| 540 const AtomicString& ariaRole = getAttribute(roleAttr); | 540 const AtomicString& ariaRole = getAttribute(roleAttr); |
| 541 if (ariaRole.isNull() || ariaRole.isEmpty()) | 541 if (ariaRole.isNull() || ariaRole.isEmpty()) |
| 542 return UnknownRole; | 542 return UnknownRole; |
| 543 | 543 |
| 544 AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole); | 544 AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole); |
| (...skipping 2350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2895 } | 2895 } |
| 2896 return placeholder; | 2896 return placeholder; |
| 2897 } | 2897 } |
| 2898 | 2898 |
| 2899 DEFINE_TRACE(AXNodeObject) { | 2899 DEFINE_TRACE(AXNodeObject) { |
| 2900 visitor->trace(m_node); | 2900 visitor->trace(m_node); |
| 2901 AXObject::trace(visitor); | 2901 AXObject::trace(visitor); |
| 2902 } | 2902 } |
| 2903 | 2903 |
| 2904 } // namespace blink | 2904 } // namespace blink |
| OLD | NEW |