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

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

Issue 1561533003: AXMenuListOption should respect role attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h ('k') | 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) 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 { 42 {
43 ASSERT(!m_element); 43 ASSERT(!m_element);
44 } 44 }
45 45
46 void AXMenuListOption::detach() 46 void AXMenuListOption::detach()
47 { 47 {
48 m_element = nullptr; 48 m_element = nullptr;
49 AXMockObject::detach(); 49 AXMockObject::detach();
50 } 50 }
51 51
52 AccessibilityRole AXMenuListOption::roleValue() const
53 {
54 const AtomicString& ariaRole = getAttribute(roleAttr);
55 if (ariaRole.isEmpty())
56 return MenuListOptionRole;
57
58 AccessibilityRole role = ariaRoleToWebCoreRole(ariaRole);
59 if (role)
60 return role;
61 return MenuListOptionRole;
62 }
63
52 Element* AXMenuListOption::actionElement() const 64 Element* AXMenuListOption::actionElement() const
53 { 65 {
54 return m_element; 66 return m_element;
55 } 67 }
56 68
57 bool AXMenuListOption::isEnabled() const 69 bool AXMenuListOption::isEnabled() const
58 { 70 {
59 // isDisabledFormControl() returns true if the parent <select> element is di sabled, 71 // isDisabledFormControl() returns true if the parent <select> element is di sabled,
60 // which we don't want. 72 // which we don't want.
61 return m_element && !m_element->ownElementDisabled(); 73 return m_element && !m_element->ownElementDisabled();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 157
146 } 158 }
147 159
148 DEFINE_TRACE(AXMenuListOption) 160 DEFINE_TRACE(AXMenuListOption)
149 { 161 {
150 visitor->trace(m_element); 162 visitor->trace(m_element);
151 AXMockObject::trace(visitor); 163 AXMockObject::trace(visitor);
152 } 164 }
153 165
154 } // namespace blink 166 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698