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

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

Issue 2666873005: Implement aria-modal (Closed)
Patch Set: Created 3 years, 10 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 1134 matching lines...) Expand 10 before | Expand all | Expand 10 after
1145 1145
1146 const AtomicString& expanded = getAttribute(aria_expandedAttr); 1146 const AtomicString& expanded = getAttribute(aria_expandedAttr);
1147 if (equalIgnoringCase(expanded, "true")) 1147 if (equalIgnoringCase(expanded, "true"))
1148 return ExpandedExpanded; 1148 return ExpandedExpanded;
1149 if (equalIgnoringCase(expanded, "false")) 1149 if (equalIgnoringCase(expanded, "false"))
1150 return ExpandedCollapsed; 1150 return ExpandedCollapsed;
1151 1151
1152 return ExpandedUndefined; 1152 return ExpandedUndefined;
1153 } 1153 }
1154 1154
1155 bool AXNodeObject::isModal() const {
1156 if (roleValue() != DialogRole && roleValue() != AlertDialogRole)
1157 return false;
1158
1159 if (hasAttribute(aria_modalAttr)) {
1160 const AtomicString& modal = getAttribute(aria_modalAttr);
1161 if (equalIgnoringCase(modal, "true"))
1162 return true;
1163 if (equalIgnoringCase(modal, "false"))
1164 return false;
1165 }
1166
1167 if (getNode() && isHTMLDialogElement(*getNode()))
1168 return toElement(getNode())->isInTopLayer();
1169
1170 return false;
1171 }
1172
1155 bool AXNodeObject::isPressed() const { 1173 bool AXNodeObject::isPressed() const {
1156 if (!isButton()) 1174 if (!isButton())
1157 return false; 1175 return false;
1158 1176
1159 Node* node = this->getNode(); 1177 Node* node = this->getNode();
1160 if (!node) 1178 if (!node)
1161 return false; 1179 return false;
1162 1180
1163 // ARIA button with aria-pressed not undefined, then check for aria-pressed 1181 // ARIA button with aria-pressed not undefined, then check for aria-pressed
1164 // attribute rather than getNode()->active() 1182 // attribute rather than getNode()->active()
(...skipping 1919 matching lines...) Expand 10 before | Expand all | Expand 10 after
3084 return String(); 3102 return String();
3085 return toTextControlElement(node)->strippedPlaceholder(); 3103 return toTextControlElement(node)->strippedPlaceholder();
3086 } 3104 }
3087 3105
3088 DEFINE_TRACE(AXNodeObject) { 3106 DEFINE_TRACE(AXNodeObject) {
3089 visitor->trace(m_node); 3107 visitor->trace(m_node);
3090 AXObject::trace(visitor); 3108 AXObject::trace(visitor);
3091 } 3109 }
3092 3110
3093 } // namespace blink 3111 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698