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

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: 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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 Node* node = m_renderer->node(); 840 Node* node = m_renderer->node();
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 if (ariaRoleAttribute() == ComboBoxRole
dmazzoni 2014/11/20 16:48:06 You're only checking the aria role, but some of th
851 if (equalIgnoringCase(ariaOrientation, "horizontal")) 851 || ariaRoleAttribute() == ListBoxRole
852 return AccessibilityOrientationHorizontal; 852 || ariaRoleAttribute() == MenuRole
853 if (equalIgnoringCase(ariaOrientation, "vertical")) 853 || ariaRoleAttribute() == MenuBarRole
854 return AccessibilityOrientationVertical; 854 || ariaRoleAttribute() == RadioGroupRole
855 || ariaRoleAttribute() == ScrollBarRole
856 || ariaRoleAttribute() == SliderRole
857 || ariaRoleAttribute() == SplitterRole
858 || ariaRoleAttribute() == TabListRole
859 || ariaRoleAttribute() == ToolbarRole
860 || ariaRoleAttribute() == TreeRole
861 || ariaRoleAttribute() == TreeGridRole) {
855 862
856 if (isScrollbar()) 863 const AtomicString& ariaOrientation = getAttribute(aria_orientationAttr) ;
857 return AccessibilityOrientationVertical; 864
865 // Adding implicit horizontal orientation
866 if (equalIgnoringCase(ariaOrientation, "horizontal")
867 || ariaRoleAttribute() == MenuBarRole
868 || ariaRoleAttribute() == SplitterRole
869 || ariaRoleAttribute() == SliderRole
870 || ariaRoleAttribute() == TabListRole
871 || ariaRoleAttribute() == ToolbarRole)
872 return AccessibilityOrientationHorizontal;
873
874 // Adding implicit vertical orientation
875 if (equalIgnoringCase(ariaOrientation, "vertical")
876 || ariaRoleAttribute() == ComboBoxRole
877 || ariaRoleAttribute() == ListBoxRole
878 || ariaRoleAttribute() == MenuRole
879 || ariaRoleAttribute() == ScrollBarRole
880 || ariaRoleAttribute() == TreeRole)
881 return AccessibilityOrientationVertical;
882 }
858 883
859 return AXObject::orientation(); 884 return AXObject::orientation();
860 } 885 }
861 886
862 String AXRenderObject::text() const 887 String AXRenderObject::text() const
863 { 888 {
864 if (isPasswordFieldAndShouldHideValue()) 889 if (isPasswordFieldAndShouldHideValue())
865 return String(); 890 return String();
866 891
867 return AXNodeObject::text(); 892 return AXNodeObject::text();
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after
2444 if (label && label->renderer()) { 2469 if (label && label->renderer()) {
2445 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2470 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2446 result.unite(labelRect); 2471 result.unite(labelRect);
2447 } 2472 }
2448 } 2473 }
2449 2474
2450 return result; 2475 return result;
2451 } 2476 }
2452 2477
2453 } // namespace blink 2478 } // 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