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

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

Issue 1121473004: Expose scroll containers via accessibility APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move scrolling logic from ScrollView to WebArea Created 5 years, 7 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 virtual Element* anchorElement() const { return 0; } 670 virtual Element* anchorElement() const { return 0; }
671 virtual Element* actionElement() const { return 0; } 671 virtual Element* actionElement() const { return 0; }
672 virtual Widget* widgetForAttachmentView() const { return 0; } 672 virtual Widget* widgetForAttachmentView() const { return 0; }
673 String language() const; 673 String language() const;
674 bool hasAttribute(const QualifiedName&) const; 674 bool hasAttribute(const QualifiedName&) const;
675 const AtomicString& getAttribute(const QualifiedName&) const; 675 const AtomicString& getAttribute(const QualifiedName&) const;
676 676
677 // Selected text. 677 // Selected text.
678 virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); } 678 virtual PlainTextRange selectedTextRange() const { return PlainTextRange(); }
679 679
680 // Scrollable containers.
681 bool isScrollableContainer() const;
682 IntPoint scrollOffset() const;
683 IntPoint minimumScrollOffset() const;
684 IntPoint maximumScrollOffset() const;
685 void setScrollOffset(const IntPoint&) const;
686
687 // If this object itself scrolls, return its ScrollableArea.
688 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; }
689
680 // Modify or take an action on an object. 690 // Modify or take an action on an object.
681 virtual void increment() { } 691 virtual void increment() { }
682 virtual void decrement() { } 692 virtual void decrement() { }
683 bool performDefaultAction() const { return press(); } 693 bool performDefaultAction() const { return press(); }
684 virtual bool press() const; 694 virtual bool press() const;
685 // Make this object visible by scrolling as many nested scrollable views as needed. 695 // Make this object visible by scrolling as many nested scrollable views as needed.
686 void scrollToMakeVisible() const; 696 void scrollToMakeVisible() const;
687 // Same, but if the whole object can't be made visible, try for this subrect , in local coordinates. 697 // Same, but if the whole object can't be made visible, try for this subrect , in local coordinates.
688 void scrollToMakeVisibleWithSubFocus(const IntRect&) const; 698 void scrollToMakeVisibleWithSubFocus(const IntRect&) const;
689 // Scroll this object to a given point in global coordinates of the top-leve l window. 699 // Scroll this object to a given point in global coordinates of the top-leve l window.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 protected: 732 protected:
723 AXID m_id; 733 AXID m_id;
724 AccessibilityChildrenVector m_children; 734 AccessibilityChildrenVector m_children;
725 mutable bool m_haveChildren; 735 mutable bool m_haveChildren;
726 AccessibilityRole m_role; 736 AccessibilityRole m_role;
727 AXObjectInclusion m_lastKnownIsIgnoredValue; 737 AXObjectInclusion m_lastKnownIsIgnoredValue;
728 LayoutRect m_explicitElementRect; 738 LayoutRect m_explicitElementRect;
729 739
730 virtual const AXObject* inheritsPresentationalRoleFrom() const { return 0; } 740 virtual const AXObject* inheritsPresentationalRoleFrom() const { return 0; }
731 741
732 // If this object itself scrolls, return its ScrollableArea.
733 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; }
734 virtual void scrollTo(const IntPoint&) const { }
735
736 AccessibilityRole buttonRoleType() const; 742 AccessibilityRole buttonRoleType() const;
737 743
738 unsigned getLengthForTextRange() const { return text().length(); } 744 unsigned getLengthForTextRange() const { return text().length(); }
739 745
740 bool m_detached; 746 bool m_detached;
741 747
742 mutable AXObject* m_parent; 748 mutable AXObject* m_parent;
743 749
744 // The following cached attribute values (the ones starting with m_cached*) 750 // The following cached attribute values (the ones starting with m_cached*)
745 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount(). 751 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modi ficationCount().
(...skipping 16 matching lines...) Expand all
762 static bool includesARIAWidgetRole(const String&); 768 static bool includesARIAWidgetRole(const String&);
763 static bool hasInteractiveARIAAttribute(const Element&); 769 static bool hasInteractiveARIAAttribute(const Element&);
764 }; 770 };
765 771
766 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 772 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
767 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate) 773 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, object.pred icate)
768 774
769 } // namespace blink 775 } // namespace blink
770 776
771 #endif // AXObject_h 777 #endif // AXObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698