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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp

Issue 2532023002: Avoid updateStyleAndLayoutTree in determineAccessibilityRole (Closed)
Patch Set: dmazzoni/tkent review Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« 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