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

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

Issue 1841333002: Various fixes for aria-activedescendant. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added selectable and selected states to ARIA list box options. Created 4 years, 8 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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 * 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 return true; 117 return true;
118 118
119 if (accessibilityIsIgnoredByDefault(ignoredReasons)) 119 if (accessibilityIsIgnoredByDefault(ignoredReasons))
120 return true; 120 return true;
121 121
122 return false; 122 return false;
123 } 123 }
124 124
125 bool AXListBoxOption::canSetSelectedAttribute() const 125 bool AXListBoxOption::canSetSelectedAttribute() const
126 { 126 {
127 if (ancestorExposesActiveDescendant())
dmazzoni 2016/03/31 05:48:30 This shouldn't be before some of the other checks,
128 return true;
129
127 if (!isHTMLOptionElement(getNode())) 130 if (!isHTMLOptionElement(getNode()))
128 return false; 131 return false;
129 132
130 if (toHTMLOptionElement(getNode())->isDisabledFormControl()) 133 if (toHTMLOptionElement(getNode())->isDisabledFormControl())
131 return false; 134 return false;
132 135
133 HTMLSelectElement* selectElement = listBoxOptionParentNode(); 136 HTMLSelectElement* selectElement = listBoxOptionParentNode();
134 if (selectElement && selectElement->isDisabledFormControl()) 137 if (selectElement && selectElement->isDisabledFormControl())
135 return false; 138 return false;
136 139
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 unsigned length = listItems.size(); 205 unsigned length = listItems.size();
203 for (unsigned i = 0; i < length; i++) { 206 for (unsigned i = 0; i < length; i++) {
204 if (listItems[i] == getNode()) 207 if (listItems[i] == getNode())
205 return i; 208 return i;
206 } 209 }
207 210
208 return -1; 211 return -1;
209 } 212 }
210 213
211 } // namespace blink 214 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698