OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 |
OLD | NEW |