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

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

Issue 2707263011: Test aria-pressed=mixed on windows (Closed)
Patch Set: git cl try Created 3 years, 6 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 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 bool modal = false; 1211 bool modal = false;
1212 if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kModal, modal)) 1212 if (HasAOMPropertyOrARIAAttribute(AOMBooleanProperty::kModal, modal))
1213 return modal; 1213 return modal;
1214 1214
1215 if (GetNode() && isHTMLDialogElement(*GetNode())) 1215 if (GetNode() && isHTMLDialogElement(*GetNode()))
1216 return ToElement(GetNode())->IsInTopLayer(); 1216 return ToElement(GetNode())->IsInTopLayer();
1217 1217
1218 return false; 1218 return false;
1219 } 1219 }
1220 1220
1221 bool AXNodeObject::IsPressed() const { 1221 AccessibilityButtonState AXNodeObject::PressedState() const {
1222 if (!IsButton())
1223 return false;
1224
1225 Node* node = this->GetNode();
1226 if (!node)
1227 return false;
1228
1229 // ARIA button with aria-pressed not undefined, then check for aria-pressed 1222 // ARIA button with aria-pressed not undefined, then check for aria-pressed
1230 // attribute rather than getNode()->active() 1223 // attribute rather than getNode()->active()
1231 if (AriaRoleAttribute() == kToggleButtonRole) { 1224 if (this->GetNode() && RoleValue() == kToggleButtonRole) {
1232 if (EqualIgnoringASCIICase(GetAttribute(aria_pressedAttr), "true") || 1225 auto pressed = GetAttribute(aria_pressedAttr);
1233 EqualIgnoringASCIICase(GetAttribute(aria_pressedAttr), "mixed")) 1226 if (EqualIgnoringASCIICase(pressed, "true"))
1234 return true; 1227 return kButtonStateOn;
1235 return false; 1228 if (EqualIgnoringASCIICase(pressed, "mixed"))
1229 return kButtonStateMixed;
1236 } 1230 }
1237 1231
1238 return node->IsActive(); 1232 return kButtonStateOff;
1239 } 1233 }
1240 1234
1241 bool AXNodeObject::IsReadOnly() const { 1235 bool AXNodeObject::IsReadOnly() const {
1242 Node* node = this->GetNode(); 1236 Node* node = this->GetNode();
1243 if (!node) 1237 if (!node)
1244 return true; 1238 return true;
1245 1239
1246 if (isHTMLTextAreaElement(*node)) 1240 if (isHTMLTextAreaElement(*node))
1247 return toHTMLTextAreaElement(*node).IsReadOnly(); 1241 return toHTMLTextAreaElement(*node).IsReadOnly();
1248 1242
(...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after
3233 return String(); 3227 return String();
3234 return ToTextControlElement(node)->StrippedPlaceholder(); 3228 return ToTextControlElement(node)->StrippedPlaceholder();
3235 } 3229 }
3236 3230
3237 DEFINE_TRACE(AXNodeObject) { 3231 DEFINE_TRACE(AXNodeObject) {
3238 visitor->Trace(node_); 3232 visitor->Trace(node_);
3239 AXObjectImpl::Trace(visitor); 3233 AXObjectImpl::Trace(visitor);
3240 } 3234 }
3241 3235
3242 } // namespace blink 3236 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698