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

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

Issue 742353004: Implement computedRole and computedName (behind a flag) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update webexposed/element-instance-property-listing.html and add some SVG test cases Created 6 years 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 22 matching lines...) Expand all
33 #include "core/editing/VisiblePosition.h" 33 #include "core/editing/VisiblePosition.h"
34 #include "platform/geometry/FloatQuad.h" 34 #include "platform/geometry/FloatQuad.h"
35 #include "platform/geometry/LayoutRect.h" 35 #include "platform/geometry/LayoutRect.h"
36 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
37 #include "wtf/RefPtr.h" 37 #include "wtf/RefPtr.h"
38 #include "wtf/Vector.h" 38 #include "wtf/Vector.h"
39 39
40 namespace blink { 40 namespace blink {
41 41
42 class AXObject; 42 class AXObject;
43 class AXObjectCache;
43 class AXObjectCacheImpl; 44 class AXObjectCacheImpl;
44 class Element; 45 class Element;
45 class FrameView; 46 class FrameView;
46 class IntPoint; 47 class IntPoint;
47 class Node; 48 class Node;
48 class RenderObject; 49 class RenderObject;
49 class ScrollableArea; 50 class ScrollableArea;
50 class Widget; 51 class Widget;
51 52
52 typedef unsigned AXID; 53 typedef unsigned AXID;
53 54
54 enum AccessibilityRole { 55 enum AccessibilityRole {
55 AlertDialogRole = 1, 56 UnknownRole = 0,
57 AlertDialogRole,
56 AlertRole, 58 AlertRole,
57 AnnotationRole, 59 AnnotationRole,
58 ApplicationRole, 60 ApplicationRole,
59 ArticleRole, 61 ArticleRole,
60 BannerRole, 62 BannerRole,
61 BlockquoteRole, 63 BlockquoteRole,
62 BusyIndicatorRole, 64 BusyIndicatorRole,
63 ButtonRole, 65 ButtonRole,
64 CanvasRole, 66 CanvasRole,
65 CellRole, 67 CellRole,
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 TableRole, 158 TableRole,
157 TextAreaRole, 159 TextAreaRole,
158 TextFieldRole, 160 TextFieldRole,
159 TimeRole, 161 TimeRole,
160 TimerRole, 162 TimerRole,
161 ToggleButtonRole, 163 ToggleButtonRole,
162 ToolbarRole, 164 ToolbarRole,
163 TreeGridRole, 165 TreeGridRole,
164 TreeItemRole, 166 TreeItemRole,
165 TreeRole, 167 TreeRole,
166 UnknownRole,
167 UserInterfaceTooltipRole, 168 UserInterfaceTooltipRole,
168 WebAreaRole, 169 WebAreaRole,
169 WindowRole, 170 WindowRole,
171 NumRoles
170 }; 172 };
171 173
172 enum AccessibilityTextSource { 174 enum AccessibilityTextSource {
173 AlternativeText, 175 AlternativeText,
174 ChildrenText, 176 ChildrenText,
175 SummaryText, 177 SummaryText,
176 HelpText, 178 HelpText,
177 VisibleText, 179 VisibleText,
178 TitleTagText, 180 TitleTagText,
179 PlaceholderText, 181 PlaceholderText,
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 virtual bool liveRegionAtomic() const { return false; } 473 virtual bool liveRegionAtomic() const { return false; }
472 virtual bool liveRegionBusy() const { return false; } 474 virtual bool liveRegionBusy() const { return false; }
473 475
474 const AtomicString& containerLiveRegionStatus() const; 476 const AtomicString& containerLiveRegionStatus() const;
475 const AtomicString& containerLiveRegionRelevant() const; 477 const AtomicString& containerLiveRegionRelevant() const;
476 bool containerLiveRegionAtomic() const; 478 bool containerLiveRegionAtomic() const;
477 bool containerLiveRegionBusy() const; 479 bool containerLiveRegionBusy() const;
478 480
479 // Accessibility Text. 481 // Accessibility Text.
480 virtual String textUnderElement() const { return String(); } 482 virtual String textUnderElement() const { return String(); }
481
482 // Accessibility Text - (To be deprecated).
483 virtual String accessibilityDescription() const { return String(); } 483 virtual String accessibilityDescription() const { return String(); }
484 virtual String title() const { return String(); } 484 virtual String title() const { return String(); }
485 virtual String helpText() const { return String(); } 485 virtual String helpText() const { return String(); }
486 // Returns result of Accessible Name Calculation algorithm
487 // TODO(aboxhall): ensure above and replace title() with this logic
488 virtual String computedName() const { return String(); }
486 489
487 // Location and click point in frame-relative coordinates. 490 // Location and click point in frame-relative coordinates.
488 virtual LayoutRect elementRect() const { return m_explicitElementRect; } 491 virtual LayoutRect elementRect() const { return m_explicitElementRect; }
489 void setElementRect(LayoutRect r) { m_explicitElementRect = r; } 492 void setElementRect(LayoutRect r) { m_explicitElementRect = r; }
490 virtual void markCachedElementRectDirty() const; 493 virtual void markCachedElementRectDirty() const;
491 virtual IntPoint clickPoint(); 494 virtual IntPoint clickPoint();
492 495
493 // Hit testing. 496 // Hit testing.
494 // Called on the root AX object to return the deepest available element. 497 // Called on the root AX object to return the deepest available element.
495 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } 498 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 virtual VisiblePosition visiblePositionForIndex(int) const { return VisibleP osition(); } 573 virtual VisiblePosition visiblePositionForIndex(int) const { return VisibleP osition(); }
571 int lineForPosition(const VisiblePosition&) const; 574 int lineForPosition(const VisiblePosition&) const;
572 virtual int index(const VisiblePosition&) const { return -1; } 575 virtual int index(const VisiblePosition&) const { return -1; }
573 virtual void lineBreaks(Vector<int>&) const { } 576 virtual void lineBreaks(Vector<int>&) const { }
574 577
575 // Static helper functions. 578 // Static helper functions.
576 static bool isARIAControl(AccessibilityRole); 579 static bool isARIAControl(AccessibilityRole);
577 static bool isARIAInput(AccessibilityRole); 580 static bool isARIAInput(AccessibilityRole);
578 static AccessibilityRole ariaRoleToWebCoreRole(const String&); 581 static AccessibilityRole ariaRoleToWebCoreRole(const String&);
579 static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&); 582 static IntRect boundingBoxForQuads(RenderObject*, const Vector<FloatQuad>&);
583 static const AtomicString& roleName(AccessibilityRole);
580 584
581 protected: 585 protected:
582 AXID m_id; 586 AXID m_id;
583 AccessibilityChildrenVector m_children; 587 AccessibilityChildrenVector m_children;
584 mutable bool m_haveChildren; 588 mutable bool m_haveChildren;
585 AccessibilityRole m_role; 589 AccessibilityRole m_role;
586 AXObjectInclusion m_lastKnownIsIgnoredValue; 590 AXObjectInclusion m_lastKnownIsIgnoredValue;
587 LayoutRect m_explicitElementRect; 591 LayoutRect m_explicitElementRect;
588 592
589 virtual bool computeAccessibilityIsIgnored() const { return true; } 593 virtual bool computeAccessibilityIsIgnored() const { return true; }
(...skipping 23 matching lines...) Expand all
613 // functions called here may only search up the tree (ancestors), not down. 617 // functions called here may only search up the tree (ancestors), not down.
614 void updateCachedAttributeValuesIfNeeded() const; 618 void updateCachedAttributeValuesIfNeeded() const;
615 }; 619 };
616 620
617 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 621 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
618 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate) 622 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate)
619 623
620 } // namespace blink 624 } // namespace blink
621 625
622 #endif // AXObject_h 626 #endif // AXObject_h
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXNodeObject.cpp ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698