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

Side by Side Diff: Source/modules/accessibility/AXObject.h

Issue 885163002: [Contextual Search] Check for ARIA widget roles. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added aria-attribute check and unit test. Created 5 years, 10 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) 2008, 2009, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Nuanti Ltd. 3 * Copyright (C) 2008 Nuanti Ltd.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 30 matching lines...) Expand all
41 41
42 class AXObject; 42 class AXObject;
43 class AXObjectCache; 43 class AXObjectCache;
44 class AXObjectCacheImpl; 44 class AXObjectCacheImpl;
45 class Element; 45 class Element;
46 class FrameView; 46 class FrameView;
47 class IntPoint; 47 class IntPoint;
48 class Node; 48 class Node;
49 class RenderObject; 49 class RenderObject;
50 class ScrollableArea; 50 class ScrollableArea;
51 class WebElement;
52 class WebNode;
51 class Widget; 53 class Widget;
52 54
53 typedef unsigned AXID; 55 typedef unsigned AXID;
54 56
55 enum AccessibilityRole { 57 enum AccessibilityRole {
56 UnknownRole = 0, 58 UnknownRole = 0,
57 AlertDialogRole, 59 AlertDialogRole,
58 AlertRole, 60 AlertRole,
59 AnnotationRole, 61 AnnotationRole,
60 ApplicationRole, 62 ApplicationRole,
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 int lineForPosition(const VisiblePosition&) const; 603 int lineForPosition(const VisiblePosition&) const;
602 virtual int index(const VisiblePosition&) const { return -1; } 604 virtual int index(const VisiblePosition&) const { return -1; }
603 virtual void lineBreaks(Vector<int>&) const { } 605 virtual void lineBreaks(Vector<int>&) const { }
604 606
605 // Static helper functions. 607 // Static helper functions.
606 static bool isARIAControl(AccessibilityRole); 608 static bool isARIAControl(AccessibilityRole);
607 static bool isARIAInput(AccessibilityRole); 609 static bool isARIAInput(AccessibilityRole);
608 static AccessibilityRole ariaRoleToWebCoreRole(const String&); 610 static AccessibilityRole ariaRoleToWebCoreRole(const String&);
609 static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&); 611 static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&);
610 static const AtomicString& roleName(AccessibilityRole); 612 static const AtomicString& roleName(AccessibilityRole);
613 static bool isARIAWidget(const WebNode&);
dmazzoni 2015/02/05 00:40:23 This should take a Node& instead
Donn Denman 2015/02/06 22:53:36 Done.
611 614
612 protected: 615 protected:
613 AXID m_id; 616 AXID m_id;
614 AccessibilityChildrenVector m_children; 617 AccessibilityChildrenVector m_children;
615 mutable bool m_haveChildren; 618 mutable bool m_haveChildren;
616 AccessibilityRole m_role; 619 AccessibilityRole m_role;
617 AXObjectInclusion m_lastKnownIsIgnoredValue; 620 AXObjectInclusion m_lastKnownIsIgnoredValue;
618 LayoutRect m_explicitElementRect; 621 LayoutRect m_explicitElementRect;
619 622
620 virtual bool computeAccessibilityIsIgnored() const { return true; } 623 virtual bool computeAccessibilityIsIgnored() const { return true; }
(...skipping 15 matching lines...) Expand all
636 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount(). 639 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount().
637 mutable int m_lastModificationCount; 640 mutable int m_lastModificationCount;
638 mutable bool m_cachedIsIgnored; 641 mutable bool m_cachedIsIgnored;
639 mutable const AXObject* m_cachedLiveRegionRoot; 642 mutable const AXObject* m_cachedLiveRegionRoot;
640 643
641 AXObjectCacheImpl* m_axObjectCache; 644 AXObjectCacheImpl* m_axObjectCache;
642 645
643 // Updates the cached attribute values. This may be recursive, so to prevent deadlocks, 646 // Updates the cached attribute values. This may be recursive, so to prevent deadlocks,
644 // functions called here may only search up the tree (ancestors), not down. 647 // functions called here may only search up the tree (ancestors), not down.
645 void updateCachedAttributeValuesIfNeeded() const; 648 void updateCachedAttributeValuesIfNeeded() const;
649
650 private:
651 static bool includesARIAWidgetRole(const String&);
652 static bool hasInteractiveARIAAttribute(const WebElement&);
646 }; 653 };
647 654
648 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 655 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
649 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate) 656 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate)
650 657
651 } // namespace blink 658 } // namespace blink
652 659
653 #endif // AXObject_h 660 #endif // AXObject_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/accessibility/AXObject.cpp » ('j') | Source/modules/accessibility/AXObject.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698