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

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

Issue 2772913003: AXObject::performDefaultAction() should focus if it can't click (Closed)
Patch Set: Add test Created 3 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) 2010 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2010 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 30 matching lines...) Expand all
41 return new AXMenuList(layoutObject, axObjectCache); 41 return new AXMenuList(layoutObject, axObjectCache);
42 } 42 }
43 43
44 AccessibilityRole AXMenuList::determineAccessibilityRole() { 44 AccessibilityRole AXMenuList::determineAccessibilityRole() {
45 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) 45 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
46 return m_ariaRole; 46 return m_ariaRole;
47 47
48 return PopUpButtonRole; 48 return PopUpButtonRole;
49 } 49 }
50 50
51 bool AXMenuList::press() const { 51 bool AXMenuList::press() {
52 if (!m_layoutObject) 52 if (!m_layoutObject)
53 return false; 53 return false;
54 54
55 HTMLSelectElement* select = toLayoutMenuList(m_layoutObject)->selectElement(); 55 HTMLSelectElement* select = toLayoutMenuList(m_layoutObject)->selectElement();
56 if (select->popupIsVisible()) 56 if (select->popupIsVisible())
57 select->hidePopup(); 57 select->hidePopup();
58 else 58 else
59 select->showPopup(); 59 select->showPopup();
60 return true; 60 return true;
61 } 61 }
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 150
151 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get()); 151 AXMenuListPopup* popup = toAXMenuListPopup(children()[0].get());
152 popup->didHide(); 152 popup->didHide();
153 153
154 if (getNode() && getNode()->isFocused()) 154 if (getNode() && getNode()->isFocused())
155 axObjectCache().postNotification( 155 axObjectCache().postNotification(
156 this, AXObjectCacheImpl::AXFocusedUIElementChanged); 156 this, AXObjectCacheImpl::AXFocusedUIElementChanged);
157 } 157 }
158 158
159 } // namespace blink 159 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698