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

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

Issue 1809573003: Fix support for accessible action verbs and performing the default action. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix two tests Created 4 years, 9 months 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
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 667 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 678
679 return siblingWithAriaRole("menuitem", node()); 679 return siblingWithAriaRole("menuitem", node());
680 } 680 }
681 681
682 Element* AXNodeObject::mouseButtonListener() const 682 Element* AXNodeObject::mouseButtonListener() const
683 { 683 {
684 Node* node = this->node(); 684 Node* node = this->node();
685 if (!node) 685 if (!node)
686 return 0; 686 return 0;
687 687
688 // check if our parent is a mouse button listener
689 if (!node->isElementNode()) 688 if (!node->isElementNode())
690 node = node->parentElement(); 689 node = node->parentElement();
691 690
692 if (!node) 691 if (!node)
693 return 0; 692 return 0;
694 693
695 // FIXME: Do the continuation search like anchorElement does
696 for (Element* element = toElement(node); element; element = element->parentE lement()) { 694 for (Element* element = toElement(node); element; element = element->parentE lement()) {
697 if (element->getAttributeEventListener(EventTypeNames::click) || element ->getAttributeEventListener(EventTypeNames::mousedown) || element->getAttributeE ventListener(EventTypeNames::mouseup)) 695 // It's a pretty common practice to put click listeners on the body or d ocument, but that's
696 // almost never what the user wants when clicking on an accessible eleme nt.
697 if (isHTMLBodyElement(element))
698 break;
699
700 if (element->hasEventListeners(EventTypeNames::click) || element->hasEve ntListeners(EventTypeNames::mousedown) || element->hasEventListeners(EventTypeNa mes::mouseup) || element->hasEventListeners(EventTypeNames::DOMActivate))
698 return element; 701 return element;
699 } 702 }
700 703
701 return 0; 704 return 0;
702 } 705 }
703 706
704 AccessibilityRole AXNodeObject::remapAriaRoleDueToParent(AccessibilityRole role) const 707 AccessibilityRole AXNodeObject::remapAriaRoleDueToParent(AccessibilityRole role) const
705 { 708 {
706 // Some objects change their role based on their parent. 709 // Some objects change their role based on their parent.
707 // However, asking for the unignoredParent calls accessibilityIsIgnored(), w hich can trigger a loop. 710 // However, asking for the unignoredParent calls accessibilityIsIgnored(), w hich can trigger a loop.
(...skipping 2043 matching lines...) Expand 10 before | Expand all | Expand 10 after
2751 return placeholder; 2754 return placeholder;
2752 } 2755 }
2753 2756
2754 DEFINE_TRACE(AXNodeObject) 2757 DEFINE_TRACE(AXNodeObject)
2755 { 2758 {
2756 visitor->trace(m_node); 2759 visitor->trace(m_node);
2757 AXObject::trace(visitor); 2760 AXObject::trace(visitor);
2758 } 2761 }
2759 2762
2760 } // namespace blink 2763 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698