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

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

Issue 1346733002: Added layout test for aria-orientation and cleaned up code. Also exposed hr element with an orienta… (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 1237 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 HTMLInputElement* inputElement = toHTMLInputElement(node()); 1248 HTMLInputElement* inputElement = toHTMLInputElement(node());
1249 placeholder = inputElement->strippedPlaceholder(); 1249 placeholder = inputElement->strippedPlaceholder();
1250 } else if (isHTMLTextAreaElement(*node())) { 1250 } else if (isHTMLTextAreaElement(*node())) {
1251 HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(node()) ; 1251 HTMLTextAreaElement* textAreaElement = toHTMLTextAreaElement(node()) ;
1252 placeholder = textAreaElement->strippedPlaceholder(); 1252 placeholder = textAreaElement->strippedPlaceholder();
1253 } 1253 }
1254 } 1254 }
1255 return placeholder; 1255 return placeholder;
1256 } 1256 }
1257 1257
1258 AccessibilityOrientation AXNodeObject::orientation() const
1259 {
1260 const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr);
1261 AccessibilityOrientation orientation = AccessibilityOrientationUndefined;
1262
1263 switch (roleValue()) {
1264 case ComboBoxRole:
1265 case ListBoxRole:
1266 case MenuRole:
1267 case ScrollBarRole:
1268 case TreeRole:
1269 orientation = AccessibilityOrientationVertical;
1270 if (equalIgnoringCase(ariaOrientation, "horizontal"))
1271 orientation = AccessibilityOrientationHorizontal;
1272
1273 return orientation;
1274 case MenuBarRole:
1275 case SliderRole:
1276 case SplitterRole:
1277 case TabListRole:
1278 case ToolbarRole:
1279 orientation = AccessibilityOrientationHorizontal;
1280 if (equalIgnoringCase(ariaOrientation, "vertical"))
1281 orientation = AccessibilityOrientationVertical;
1282
1283 return orientation;
1284 default:
1285 return AXObject::orientation();
1286 }
1287 }
1288
1258 String AXNodeObject::text() const 1289 String AXNodeObject::text() const
1259 { 1290 {
1260 // If this is a user defined static text, use the accessible name computatio n. 1291 // If this is a user defined static text, use the accessible name computatio n.
1261 if (ariaRoleAttribute() == StaticTextRole) 1292 if (ariaRoleAttribute() == StaticTextRole)
1262 return ariaAccessibilityDescription(); 1293 return ariaAccessibilityDescription();
1263 1294
1264 if (!isTextControl()) 1295 if (!isTextControl())
1265 return String(); 1296 return String();
1266 1297
1267 Node* node = this->node(); 1298 Node* node = this->node();
(...skipping 1516 matching lines...) Expand 10 before | Expand all | Expand 10 after
2784 return textAlternative; 2815 return textAlternative;
2785 } 2816 }
2786 2817
2787 DEFINE_TRACE(AXNodeObject) 2818 DEFINE_TRACE(AXNodeObject)
2788 { 2819 {
2789 visitor->trace(m_node); 2820 visitor->trace(m_node);
2790 AXObject::trace(visitor); 2821 AXObject::trace(visitor);
2791 } 2822 }
2792 2823
2793 } // namespace blink 2824 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698