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

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

Issue 730113003: Introduce new API orientation() to expose aria-orientation correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: incorporating comments Created 6 years, 1 month 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 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 if (!node) 841 if (!node)
842 return nullAtom; 842 return nullAtom;
843 if (!node->isElementNode()) 843 if (!node->isElementNode())
844 return nullAtom; 844 return nullAtom;
845 return toElement(node)->getAttribute(accesskeyAttr); 845 return toElement(node)->getAttribute(accesskeyAttr);
846 } 846 }
847 847
848 AccessibilityOrientation AXRenderObject::orientation() const 848 AccessibilityOrientation AXRenderObject::orientation() const
849 { 849 {
850 const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr); 850 const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr);
851 AccessibilityOrientation axorientation = AccessibilityOrientationUndefined;
852
853 switch (roleValue()) {
854 case ComboBoxRole:
855 case ListBoxRole:
856 case MenuRole:
857 case ScrollBarRole:
858 case TreeRole:
859 axorientation = AccessibilityOrientationVertical;
860 break;
861 case MenuBarRole:
862 case SliderRole:
863 case SplitterRole:
864 case TabListRole:
865 case ToolbarRole:
866 axorientation = AccessibilityOrientationHorizontal;
867 break;
868 case RadioGroupRole:
869 case TreeGridRole:
shreeramk 2014/11/21 11:07:47 Here, TreeGridRole case is not true. Reason: role
dmazzoni 2014/11/24 17:36:59 The logic sounds great. To make the code more rea
shreeramk 2014/11/25 08:58:37 Added code for TreeGridRole.
870 break;
871 default:
872 return AXObject::orientation();
873 }
874
851 if (equalIgnoringCase(ariaOrientation, "horizontal")) 875 if (equalIgnoringCase(ariaOrientation, "horizontal"))
852 return AccessibilityOrientationHorizontal; 876 axorientation = AccessibilityOrientationHorizontal;
853 if (equalIgnoringCase(ariaOrientation, "vertical")) 877 if (equalIgnoringCase(ariaOrientation, "vertical"))
854 return AccessibilityOrientationVertical; 878 axorientation = AccessibilityOrientationVertical;
855 879 return axorientation;
856 if (isScrollbar())
857 return AccessibilityOrientationVertical;
858
859 return AXObject::orientation();
860 } 880 }
861 881
862 String AXRenderObject::text() const 882 String AXRenderObject::text() const
863 { 883 {
864 if (isPasswordFieldAndShouldHideValue()) 884 if (isPasswordFieldAndShouldHideValue())
865 return String(); 885 return String();
866 886
867 return AXNodeObject::text(); 887 return AXNodeObject::text();
868 } 888 }
869 889
(...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after
2453 if (label && label->renderer()) { 2473 if (label && label->renderer()) {
2454 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2474 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2455 result.unite(labelRect); 2475 result.unite(labelRect);
2456 } 2476 }
2457 } 2477 }
2458 2478
2459 return result; 2479 return result;
2460 } 2480 }
2461 2481
2462 } // namespace blink 2482 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.cpp ('k') | Source/modules/accessibility/AXScrollView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698