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

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

Issue 2805493002: Boolean properties for Accessibility Object Model Phase 1 (Closed)
Patch Set: Back to previous patchset, ready to land Created 3 years, 7 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 10 matching lines...) Expand all
21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #include "modules/accessibility/AXListBoxOption.h" 29 #include "modules/accessibility/AXListBoxOption.h"
30 30
31 #include "core/dom/AccessibleNode.h"
31 #include "core/html/HTMLOptionElement.h" 32 #include "core/html/HTMLOptionElement.h"
32 #include "core/html/HTMLSelectElement.h" 33 #include "core/html/HTMLSelectElement.h"
33 #include "core/layout/LayoutObject.h" 34 #include "core/layout/LayoutObject.h"
34 #include "modules/accessibility/AXObjectCacheImpl.h" 35 #include "modules/accessibility/AXObjectCacheImpl.h"
35 36
36 namespace blink { 37 namespace blink {
37 38
38 using namespace HTMLNames; 39 using namespace HTMLNames;
39 40
40 AXListBoxOption::AXListBoxOption(LayoutObject* layout_object, 41 AXListBoxOption::AXListBoxOption(LayoutObject* layout_object,
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 if (layout_object->IsListBox() && parent->HasInheritedPresentationalRole()) 76 if (layout_object->IsListBox() && parent->HasInheritedPresentationalRole())
76 return true; 77 return true;
77 78
78 return false; 79 return false;
79 } 80 }
80 81
81 bool AXListBoxOption::IsEnabled() const { 82 bool AXListBoxOption::IsEnabled() const {
82 if (!GetNode()) 83 if (!GetNode())
83 return false; 84 return false;
84 85
85 if (EqualIgnoringASCIICase(GetAttribute(aria_disabledAttr), "true")) 86 if (AOMPropertyOrARIAAttributeIsTrue(AOMBooleanProperty::kDisabled))
86 return false; 87 return false;
87 88
88 if (ToElement(GetNode())->hasAttribute(disabledAttr)) 89 if (ToElement(GetNode())->hasAttribute(disabledAttr))
89 return false; 90 return false;
90 91
91 return true; 92 return true;
92 } 93 }
93 94
94 bool AXListBoxOption::IsSelected() const { 95 bool AXListBoxOption::IsSelected() const {
95 return isHTMLOptionElement(GetNode()) && 96 return isHTMLOptionElement(GetNode()) &&
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if (!GetNode()) 182 if (!GetNode())
182 return 0; 183 return 0;
183 184
184 if (isHTMLOptionElement(GetNode())) 185 if (isHTMLOptionElement(GetNode()))
185 return toHTMLOptionElement(GetNode())->OwnerSelectElement(); 186 return toHTMLOptionElement(GetNode())->OwnerSelectElement();
186 187
187 return 0; 188 return 0;
188 } 189 }
189 190
190 } // namespace blink 191 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698