| OLD | NEW |
| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 enum TextStyle { | 302 enum TextStyle { |
| 303 TextStyleNone = 0, | 303 TextStyleNone = 0, |
| 304 TextStyleBold = 1 << 0, | 304 TextStyleBold = 1 << 0, |
| 305 TextStyleItalic = 1 << 1, | 305 TextStyleItalic = 1 << 1, |
| 306 TextStyleUnderline = 1 << 2, | 306 TextStyleUnderline = 1 << 2, |
| 307 TextStyleLineThrough = 1 << 3 | 307 TextStyleLineThrough = 1 << 3 |
| 308 }; | 308 }; |
| 309 | 309 |
| 310 enum TextUnderElementMode { | 310 enum TextUnderElementMode { |
| 311 TextUnderElementAll, | 311 TextUnderElementAll, |
| 312 TextUnderElementAny // If the text is unimportant, just whether or not it's p
resent | 312 TextUnderElementAny // If the text is unimportant, just whether or not it's |
| 313 // present |
| 313 }; | 314 }; |
| 314 | 315 |
| 315 // The source of the accessible name of an element. This is needed | 316 // The source of the accessible name of an element. This is needed |
| 316 // because on some platforms this determines how the accessible name | 317 // because on some platforms this determines how the accessible name |
| 317 // is exposed. | 318 // is exposed. |
| 318 enum AXNameFrom { | 319 enum AXNameFrom { |
| 319 AXNameFromUninitialized = -1, | 320 AXNameFromUninitialized = -1, |
| 320 AXNameFromAttribute = 0, | 321 AXNameFromAttribute = 0, |
| 321 AXNameFromCaption, | 322 AXNameFromCaption, |
| 322 AXNameFromContents, | 323 AXNameFromContents, |
| 323 AXNameFromPlaceholder, | 324 AXNameFromPlaceholder, |
| 324 AXNameFromRelatedElement, | 325 AXNameFromRelatedElement, |
| 325 AXNameFromValue, | 326 AXNameFromValue, |
| 326 AXNameFromTitle, | 327 AXNameFromTitle, |
| 327 }; | 328 }; |
| 328 | 329 |
| 329 // The potential native HTML-based text (name, description or placeholder) sourc
es for an element. | 330 // The potential native HTML-based text (name, description or placeholder) |
| 330 // See http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-
and-description-calculation | 331 // sources for an element. See |
| 332 // http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-name-and-
description-calculation |
| 331 enum AXTextFromNativeHTML { | 333 enum AXTextFromNativeHTML { |
| 332 AXTextFromNativeHTMLUninitialized = -1, | 334 AXTextFromNativeHTMLUninitialized = -1, |
| 333 AXTextFromNativeHTMLFigcaption, | 335 AXTextFromNativeHTMLFigcaption, |
| 334 AXTextFromNativeHTMLLabel, | 336 AXTextFromNativeHTMLLabel, |
| 335 AXTextFromNativeHTMLLabelFor, | 337 AXTextFromNativeHTMLLabelFor, |
| 336 AXTextFromNativeHTMLLabelWrapped, | 338 AXTextFromNativeHTMLLabelWrapped, |
| 337 AXTextFromNativeHTMLLegend, | 339 AXTextFromNativeHTMLLegend, |
| 338 AXTextFromNativeHTMLTableCaption, | 340 AXTextFromNativeHTMLTableCaption, |
| 339 AXTextFromNativeHTMLTitleElement, | 341 AXTextFromNativeHTMLTitleElement, |
| 340 }; | 342 }; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 focusObject(focusObject), | 513 focusObject(focusObject), |
| 512 focusOffset(focusOffset), | 514 focusOffset(focusOffset), |
| 513 focusAffinity(focusAffinity) {} | 515 focusAffinity(focusAffinity) {} |
| 514 | 516 |
| 515 bool isValid() const { | 517 bool isValid() const { |
| 516 return ((anchorObject && focusObject) || | 518 return ((anchorObject && focusObject) || |
| 517 (!anchorObject && !focusObject)) && | 519 (!anchorObject && !focusObject)) && |
| 518 anchorOffset >= 0 && focusOffset >= 0; | 520 anchorOffset >= 0 && focusOffset >= 0; |
| 519 } | 521 } |
| 520 | 522 |
| 521 // Determines if the range only refers to text offsets under the current obj
ect. | 523 // Determines if the range only refers to text offsets under the current |
| 524 // object. |
| 522 bool isSimple() const { | 525 bool isSimple() const { |
| 523 return anchorObject == focusObject || !anchorObject || !focusObject; | 526 return anchorObject == focusObject || !anchorObject || !focusObject; |
| 524 } | 527 } |
| 525 }; | 528 }; |
| 526 | 529 |
| 527 protected: | 530 protected: |
| 528 AXObject(AXObjectCacheImpl&); | 531 AXObject(AXObjectCacheImpl&); |
| 529 | 532 |
| 530 public: | 533 public: |
| 531 virtual ~AXObject(); | 534 virtual ~AXObject(); |
| 532 DECLARE_VIRTUAL_TRACE(); | 535 DECLARE_VIRTUAL_TRACE(); |
| 533 | 536 |
| 534 static unsigned numberOfLiveAXObjects() { return s_numberOfLiveAXObjects; } | 537 static unsigned numberOfLiveAXObjects() { return s_numberOfLiveAXObjects; } |
| 535 | 538 |
| 536 // After constructing an AXObject, it must be given a | 539 // After constructing an AXObject, it must be given a |
| 537 // unique ID, then added to AXObjectCacheImpl, and finally init() must | 540 // unique ID, then added to AXObjectCacheImpl, and finally init() must |
| 538 // be called last. | 541 // be called last. |
| 539 void setAXObjectID(AXID axObjectID) { m_id = axObjectID; } | 542 void setAXObjectID(AXID axObjectID) { m_id = axObjectID; } |
| 540 virtual void init() {} | 543 virtual void init() {} |
| 541 | 544 |
| 542 // When the corresponding WebCore object that this AXObject | 545 // When the corresponding WebCore object that this AXObject |
| 543 // wraps is deleted, it must be detached. | 546 // wraps is deleted, it must be detached. |
| 544 virtual void detach(); | 547 virtual void detach(); |
| 545 virtual bool isDetached() const; | 548 virtual bool isDetached() const; |
| 546 | 549 |
| 547 // If the parent of this object is known, this can be faster than using comput
eParent(). | 550 // If the parent of this object is known, this can be faster than using |
| 551 // computeParent(). |
| 548 virtual void setParent(AXObject* parent) { m_parent = parent; } | 552 virtual void setParent(AXObject* parent) { m_parent = parent; } |
| 549 | 553 |
| 550 // The AXObjectCacheImpl that owns this object, and its unique ID within this
cache. | 554 // The AXObjectCacheImpl that owns this object, and its unique ID within this |
| 555 // cache. |
| 551 AXObjectCacheImpl& axObjectCache() const { | 556 AXObjectCacheImpl& axObjectCache() const { |
| 552 ASSERT(m_axObjectCache); | 557 ASSERT(m_axObjectCache); |
| 553 return *m_axObjectCache; | 558 return *m_axObjectCache; |
| 554 } | 559 } |
| 555 | 560 |
| 556 AXID axObjectID() const { return m_id; } | 561 AXID axObjectID() const { return m_id; } |
| 557 | 562 |
| 558 // Determine subclass type. | 563 // Determine subclass type. |
| 559 virtual bool isAXNodeObject() const { return false; } | 564 virtual bool isAXNodeObject() const { return false; } |
| 560 virtual bool isAXLayoutObject() const { return false; } | 565 virtual bool isAXLayoutObject() const { return false; } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 672 void setLastKnownIsIgnoredValue(bool); | 677 void setLastKnownIsIgnoredValue(bool); |
| 673 bool hasInheritedPresentationalRole() const; | 678 bool hasInheritedPresentationalRole() const; |
| 674 bool isPresentationalChild() const; | 679 bool isPresentationalChild() const; |
| 675 bool ancestorExposesActiveDescendant() const; | 680 bool ancestorExposesActiveDescendant() const; |
| 676 bool computeAncestorExposesActiveDescendant() const; | 681 bool computeAncestorExposesActiveDescendant() const; |
| 677 | 682 |
| 678 // | 683 // |
| 679 // Accessible name calculation | 684 // Accessible name calculation |
| 680 // | 685 // |
| 681 | 686 |
| 682 // Retrieves the accessible name of the object, an enum indicating where the n
ame | 687 // Retrieves the accessible name of the object, an enum indicating where the |
| 683 // was derived from, and a list of objects that were used to derive the name,
if any. | 688 // name was derived from, and a list of objects that were used to derive the |
| 689 // name, if any. |
| 684 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const; | 690 virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const; |
| 685 | 691 |
| 686 typedef HeapVector<NameSource> NameSources; | 692 typedef HeapVector<NameSource> NameSources; |
| 687 // Retrieves the accessible name of the object and a list of all potential sou
rces | 693 // Retrieves the accessible name of the object and a list of all potential |
| 688 // for the name, indicating which were used. | 694 // sources for the name, indicating which were used. |
| 689 virtual String name(NameSources*) const; | 695 virtual String name(NameSources*) const; |
| 690 | 696 |
| 691 typedef HeapVector<DescriptionSource> DescriptionSources; | 697 typedef HeapVector<DescriptionSource> DescriptionSources; |
| 692 // Takes the result of nameFrom from calling |name|, above, and retrieves the | 698 // Takes the result of nameFrom from calling |name|, above, and retrieves the |
| 693 // accessible description of the object, which is secondary to |name|, an enum
indicating | 699 // accessible description of the object, which is secondary to |name|, an enum |
| 694 // where the description was derived from, and a list of objects that were use
d to | 700 // indicating where the description was derived from, and a list of objects |
| 695 // derive the description, if any. | 701 // that were used to derive the description, if any. |
| 696 virtual String description(AXNameFrom, | 702 virtual String description(AXNameFrom, |
| 697 AXDescriptionFrom&, | 703 AXDescriptionFrom&, |
| 698 AXObjectVector* descriptionObjects) const { | 704 AXObjectVector* descriptionObjects) const { |
| 699 return String(); | 705 return String(); |
| 700 } | 706 } |
| 701 | 707 |
| 702 // Same as above, but returns a list of all potential sources for the descript
ion, indicating which were used. | 708 // Same as above, but returns a list of all potential sources for the |
| 709 // description, indicating which were used. |
| 703 virtual String description(AXNameFrom, | 710 virtual String description(AXNameFrom, |
| 704 AXDescriptionFrom&, | 711 AXDescriptionFrom&, |
| 705 DescriptionSources*, | 712 DescriptionSources*, |
| 706 AXRelatedObjectVector*) const { | 713 AXRelatedObjectVector*) const { |
| 707 return String(); | 714 return String(); |
| 708 } | 715 } |
| 709 | 716 |
| 710 // Takes the result of nameFrom and descriptionFrom from calling |name| and |d
escription|, | 717 // Takes the result of nameFrom and descriptionFrom from calling |name| and |
| 711 // above, and retrieves the placeholder of the object, if present and if it wa
sn't already | 718 // |description|, above, and retrieves the placeholder of the object, if |
| 712 // exposed by one of the two functions above. | 719 // present and if it wasn't already exposed by one of the two functions above. |
| 713 virtual String placeholder(AXNameFrom, AXDescriptionFrom) const { | 720 virtual String placeholder(AXNameFrom, AXDescriptionFrom) const { |
| 714 return String(); | 721 return String(); |
| 715 } | 722 } |
| 716 | 723 |
| 717 // Internal functions used by name and description, above. | 724 // Internal functions used by name and description, above. |
| 718 typedef HeapHashSet<Member<const AXObject>> AXObjectSet; | 725 typedef HeapHashSet<Member<const AXObject>> AXObjectSet; |
| 719 virtual String textAlternative(bool recursive, | 726 virtual String textAlternative(bool recursive, |
| 720 bool inAriaLabelledByTraversal, | 727 bool inAriaLabelledByTraversal, |
| 721 AXObjectSet& visited, | 728 AXObjectSet& visited, |
| 722 AXNameFrom& nameFrom, | 729 AXNameFrom& nameFrom, |
| 723 AXRelatedObjectVector* relatedObjects, | 730 AXRelatedObjectVector* relatedObjects, |
| 724 NameSources* nameSources) const { | 731 NameSources* nameSources) const { |
| 725 return String(); | 732 return String(); |
| 726 } | 733 } |
| 727 virtual String textFromDescendants(AXObjectSet& visited, | 734 virtual String textFromDescendants(AXObjectSet& visited, |
| 728 bool recursive) const { | 735 bool recursive) const { |
| 729 return String(); | 736 return String(); |
| 730 } | 737 } |
| 731 | 738 |
| 732 // Returns result of Accessible Name Calculation algorithm. | 739 // Returns result of Accessible Name Calculation algorithm. |
| 733 // This is a simpler high-level interface to |name| used by Inspector. | 740 // This is a simpler high-level interface to |name| used by Inspector. |
| 734 String computedName() const; | 741 String computedName() const; |
| 735 | 742 |
| 736 // Internal function used to determine whether the result of calling |name| on
this object would | 743 // Internal function used to determine whether the result of calling |name| on |
| 737 // return text that came from the an HTML label element or not. This is intend
ed to be faster than calling | 744 // this object would return text that came from the an HTML label element or |
| 738 // |name| or |textAlternative|, and without side effects (it won't call axObje
ctCache->getOrCreate). | 745 // not. This is intended to be faster than calling |name| or |
| 746 // |textAlternative|, and without side effects (it won't call |
| 747 // axObjectCache->getOrCreate). |
| 739 virtual bool nameFromLabelElement() const { return false; } | 748 virtual bool nameFromLabelElement() const { return false; } |
| 740 | 749 |
| 741 // | 750 // |
| 742 // Properties of static elements. | 751 // Properties of static elements. |
| 743 // | 752 // |
| 744 | 753 |
| 745 virtual const AtomicString& accessKey() const { return nullAtom; } | 754 virtual const AtomicString& accessKey() const { return nullAtom; } |
| 746 RGBA32 backgroundColor() const; | 755 RGBA32 backgroundColor() const; |
| 747 virtual RGBA32 computeBackgroundColor() const { return Color::transparent; } | 756 virtual RGBA32 computeBackgroundColor() const { return Color::transparent; } |
| 748 virtual RGBA32 color() const { return Color::black; } | 757 virtual RGBA32 color() const { return Color::black; } |
| (...skipping 23 matching lines...) Expand all Loading... |
| 772 // Walk the AXObjects on the same line. This is supported on any | 781 // Walk the AXObjects on the same line. This is supported on any |
| 773 // object type but primarily intended to be used for inline text boxes. | 782 // object type but primarily intended to be used for inline text boxes. |
| 774 virtual AXObject* nextOnLine() const { return nullptr; } | 783 virtual AXObject* nextOnLine() const { return nullptr; } |
| 775 virtual AXObject* previousOnLine() const { return nullptr; } | 784 virtual AXObject* previousOnLine() const { return nullptr; } |
| 776 | 785 |
| 777 // For all node objects. The start and end character offset of each | 786 // For all node objects. The start and end character offset of each |
| 778 // marker, such as spelling or grammar error. | 787 // marker, such as spelling or grammar error. |
| 779 virtual void markers(Vector<DocumentMarker::MarkerType>&, | 788 virtual void markers(Vector<DocumentMarker::MarkerType>&, |
| 780 Vector<AXRange>&) const {} | 789 Vector<AXRange>&) const {} |
| 781 // For an inline text box. | 790 // For an inline text box. |
| 782 // The integer horizontal pixel offset of each character in the string; negati
ve values for RTL. | 791 // The integer horizontal pixel offset of each character in the string; |
| 792 // negative values for RTL. |
| 783 virtual void textCharacterOffsets(Vector<int>&) const {} | 793 virtual void textCharacterOffsets(Vector<int>&) const {} |
| 784 // The start and end character offset of each word in the object's text. | 794 // The start and end character offset of each word in the object's text. |
| 785 virtual void wordBoundaries(Vector<AXRange>&) const {} | 795 virtual void wordBoundaries(Vector<AXRange>&) const {} |
| 786 | 796 |
| 787 // Properties of interactive elements. | 797 // Properties of interactive elements. |
| 788 String actionVerb() const; | 798 String actionVerb() const; |
| 789 virtual AccessibilityButtonState checkboxOrRadioValue() const; | 799 virtual AccessibilityButtonState checkboxOrRadioValue() const; |
| 790 virtual AriaCurrentState ariaCurrentState() const { | 800 virtual AriaCurrentState ariaCurrentState() const { |
| 791 return AriaCurrentStateUndefined; | 801 return AriaCurrentStateUndefined; |
| 792 } | 802 } |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 const AtomicString& containerLiveRegionStatus() const; | 859 const AtomicString& containerLiveRegionStatus() const; |
| 850 const AtomicString& containerLiveRegionRelevant() const; | 860 const AtomicString& containerLiveRegionRelevant() const; |
| 851 bool containerLiveRegionAtomic() const; | 861 bool containerLiveRegionAtomic() const; |
| 852 bool containerLiveRegionBusy() const; | 862 bool containerLiveRegionBusy() const; |
| 853 | 863 |
| 854 // Every object's bounding box is returned relative to a | 864 // Every object's bounding box is returned relative to a |
| 855 // container object (which is guaranteed to be an ancestor) and | 865 // container object (which is guaranteed to be an ancestor) and |
| 856 // optionally a transformation matrix that needs to be applied too. | 866 // optionally a transformation matrix that needs to be applied too. |
| 857 // To compute the absolute bounding box of an element, start with its | 867 // To compute the absolute bounding box of an element, start with its |
| 858 // boundsInContainer and apply the transform. Then as long as its container is | 868 // boundsInContainer and apply the transform. Then as long as its container is |
| 859 // not null, walk up to its container and offset by the container's offset fro
m | 869 // not null, walk up to its container and offset by the container's offset |
| 860 // origin, the container's scroll position if any, and apply the container's t
ransform. | 870 // from origin, the container's scroll position if any, and apply the |
| 861 // Do this until you reach the root of the tree. | 871 // container's transform. Do this until you reach the root of the tree. |
| 862 virtual void getRelativeBounds(AXObject** outContainer, | 872 virtual void getRelativeBounds(AXObject** outContainer, |
| 863 FloatRect& outBoundsInContainer, | 873 FloatRect& outBoundsInContainer, |
| 864 SkMatrix44& outContainerTransform) const; | 874 SkMatrix44& outContainerTransform) const; |
| 865 | 875 |
| 866 // Get the bounds in frame-relative coordinates as a LayoutRect. | 876 // Get the bounds in frame-relative coordinates as a LayoutRect. |
| 867 LayoutRect getBoundsInFrameCoordinates() const; | 877 LayoutRect getBoundsInFrameCoordinates() const; |
| 868 | 878 |
| 869 // Explicitly set an object's bounding rect and offset container. | 879 // Explicitly set an object's bounding rect and offset container. |
| 870 void setElementRect(LayoutRect r, AXObject* container) { | 880 void setElementRect(LayoutRect r, AXObject* container) { |
| 871 m_explicitElementRect = r; | 881 m_explicitElementRect = r; |
| 872 m_explicitContainerID = container->axObjectID(); | 882 m_explicitContainerID = container->axObjectID(); |
| 873 } | 883 } |
| 874 | 884 |
| 875 // Hit testing. | 885 // Hit testing. |
| 876 // Called on the root AX object to return the deepest available element. | 886 // Called on the root AX object to return the deepest available element. |
| 877 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } | 887 virtual AXObject* accessibilityHitTest(const IntPoint&) const { return 0; } |
| 878 // Called on the AX object after the layout tree determines which is the right
AXLayoutObject. | 888 // Called on the AX object after the layout tree determines which is the right |
| 889 // AXLayoutObject. |
| 879 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; | 890 virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const; |
| 880 | 891 |
| 881 // High-level accessibility tree access. Other modules should only use these f
unctions. | 892 // High-level accessibility tree access. Other modules should only use these |
| 893 // functions. |
| 882 const AXObjectVector& children(); | 894 const AXObjectVector& children(); |
| 883 AXObject* parentObject() const; | 895 AXObject* parentObject() const; |
| 884 AXObject* parentObjectIfExists() const; | 896 AXObject* parentObjectIfExists() const; |
| 885 virtual AXObject* computeParent() const = 0; | 897 virtual AXObject* computeParent() const = 0; |
| 886 virtual AXObject* computeParentIfExists() const { return 0; } | 898 virtual AXObject* computeParentIfExists() const { return 0; } |
| 887 AXObject* cachedParentObject() const { return m_parent; } | 899 AXObject* cachedParentObject() const { return m_parent; } |
| 888 AXObject* parentObjectUnignored() const; | 900 AXObject* parentObjectUnignored() const; |
| 889 | 901 |
| 890 // Low-level accessibility tree exploration, only for use within the accessibi
lity module. | 902 // Low-level accessibility tree exploration, only for use within the |
| 903 // accessibility module. |
| 891 virtual AXObject* rawFirstChild() const { return 0; } | 904 virtual AXObject* rawFirstChild() const { return 0; } |
| 892 virtual AXObject* rawNextSibling() const { return 0; } | 905 virtual AXObject* rawNextSibling() const { return 0; } |
| 893 virtual void addChildren() {} | 906 virtual void addChildren() {} |
| 894 virtual bool canHaveChildren() const { return true; } | 907 virtual bool canHaveChildren() const { return true; } |
| 895 bool hasChildren() const { return m_haveChildren; } | 908 bool hasChildren() const { return m_haveChildren; } |
| 896 virtual void updateChildrenIfNecessary(); | 909 virtual void updateChildrenIfNecessary(); |
| 897 virtual bool needsToUpdateChildren() const { return false; } | 910 virtual bool needsToUpdateChildren() const { return false; } |
| 898 virtual void setNeedsToUpdateChildren() {} | 911 virtual void setNeedsToUpdateChildren() {} |
| 899 virtual void clearChildren(); | 912 virtual void clearChildren(); |
| 900 virtual void detachFromParent() { m_parent = 0; } | 913 virtual void detachFromParent() { m_parent = 0; } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 932 void setScrollOffset(const IntPoint&) const; | 945 void setScrollOffset(const IntPoint&) const; |
| 933 | 946 |
| 934 // If this object itself scrolls, return its ScrollableArea. | 947 // If this object itself scrolls, return its ScrollableArea. |
| 935 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } | 948 virtual ScrollableArea* getScrollableAreaIfScrollable() const { return 0; } |
| 936 | 949 |
| 937 // Modify or take an action on an object. | 950 // Modify or take an action on an object. |
| 938 virtual void increment() {} | 951 virtual void increment() {} |
| 939 virtual void decrement() {} | 952 virtual void decrement() {} |
| 940 bool performDefaultAction() const { return press(); } | 953 bool performDefaultAction() const { return press(); } |
| 941 virtual bool press() const; | 954 virtual bool press() const; |
| 942 // Make this object visible by scrolling as many nested scrollable views as ne
eded. | 955 // Make this object visible by scrolling as many nested scrollable views as |
| 956 // needed. |
| 943 void scrollToMakeVisible() const; | 957 void scrollToMakeVisible() const; |
| 944 // Same, but if the whole object can't be made visible, try for this subrect,
in local coordinates. | 958 // Same, but if the whole object can't be made visible, try for this subrect, |
| 959 // in local coordinates. |
| 945 void scrollToMakeVisibleWithSubFocus(const IntRect&) const; | 960 void scrollToMakeVisibleWithSubFocus(const IntRect&) const; |
| 946 // Scroll this object to a given point in global coordinates of the top-level
window. | 961 // Scroll this object to a given point in global coordinates of the top-level |
| 962 // window. |
| 947 void scrollToGlobalPoint(const IntPoint&) const; | 963 void scrollToGlobalPoint(const IntPoint&) const; |
| 948 virtual void setFocused(bool) {} | 964 virtual void setFocused(bool) {} |
| 949 virtual void setSelected(bool) {} | 965 virtual void setSelected(bool) {} |
| 950 virtual void setValue(const String&) {} | 966 virtual void setValue(const String&) {} |
| 951 virtual void setValue(float) {} | 967 virtual void setValue(float) {} |
| 952 | 968 |
| 953 // Notifications that this object may have changed. | 969 // Notifications that this object may have changed. |
| 954 virtual void childrenChanged() {} | 970 virtual void childrenChanged() {} |
| 955 virtual void handleActiveDescendantChanged() {} | 971 virtual void handleActiveDescendantChanged() {} |
| 956 virtual void handleAriaExpandedChanged() {} | 972 virtual void handleAriaExpandedChanged() {} |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 | 1031 |
| 1016 AccessibilityRole buttonRoleType() const; | 1032 AccessibilityRole buttonRoleType() const; |
| 1017 | 1033 |
| 1018 virtual LayoutObject* layoutObjectForRelativeBounds() const { | 1034 virtual LayoutObject* layoutObjectForRelativeBounds() const { |
| 1019 return nullptr; | 1035 return nullptr; |
| 1020 } | 1036 } |
| 1021 | 1037 |
| 1022 mutable Member<AXObject> m_parent; | 1038 mutable Member<AXObject> m_parent; |
| 1023 | 1039 |
| 1024 // The following cached attribute values (the ones starting with m_cached*) | 1040 // The following cached attribute values (the ones starting with m_cached*) |
| 1025 // are only valid if m_lastModificationCount matches AXObjectCacheImpl::modifi
cationCount(). | 1041 // are only valid if m_lastModificationCount matches |
| 1042 // AXObjectCacheImpl::modificationCount(). |
| 1026 mutable int m_lastModificationCount; | 1043 mutable int m_lastModificationCount; |
| 1027 mutable RGBA32 m_cachedBackgroundColor; | 1044 mutable RGBA32 m_cachedBackgroundColor; |
| 1028 mutable bool m_cachedIsIgnored : 1; | 1045 mutable bool m_cachedIsIgnored : 1; |
| 1029 mutable bool m_cachedIsInertOrAriaHidden : 1; | 1046 mutable bool m_cachedIsInertOrAriaHidden : 1; |
| 1030 mutable bool m_cachedIsDescendantOfLeafNode : 1; | 1047 mutable bool m_cachedIsDescendantOfLeafNode : 1; |
| 1031 mutable bool m_cachedIsDescendantOfDisabledNode : 1; | 1048 mutable bool m_cachedIsDescendantOfDisabledNode : 1; |
| 1032 mutable bool m_cachedHasInheritedPresentationalRole : 1; | 1049 mutable bool m_cachedHasInheritedPresentationalRole : 1; |
| 1033 mutable bool m_cachedIsPresentationalChild : 1; | 1050 mutable bool m_cachedIsPresentationalChild : 1; |
| 1034 mutable bool m_cachedAncestorExposesActiveDescendant : 1; | 1051 mutable bool m_cachedAncestorExposesActiveDescendant : 1; |
| 1035 mutable Member<AXObject> m_cachedLiveRegionRoot; | 1052 mutable Member<AXObject> m_cachedLiveRegionRoot; |
| 1036 | 1053 |
| 1037 Member<AXObjectCacheImpl> m_axObjectCache; | 1054 Member<AXObjectCacheImpl> m_axObjectCache; |
| 1038 | 1055 |
| 1039 // Updates the cached attribute values. This may be recursive, so to prevent d
eadlocks, | 1056 // Updates the cached attribute values. This may be recursive, so to prevent |
| 1057 // deadlocks, |
| 1040 // functions called here may only search up the tree (ancestors), not down. | 1058 // functions called here may only search up the tree (ancestors), not down. |
| 1041 void updateCachedAttributeValuesIfNeeded() const; | 1059 void updateCachedAttributeValuesIfNeeded() const; |
| 1042 | 1060 |
| 1043 private: | 1061 private: |
| 1044 static bool includesARIAWidgetRole(const String&); | 1062 static bool includesARIAWidgetRole(const String&); |
| 1045 static bool hasInteractiveARIAAttribute(const Element&); | 1063 static bool hasInteractiveARIAAttribute(const Element&); |
| 1046 | 1064 |
| 1047 static unsigned s_numberOfLiveAXObjects; | 1065 static unsigned s_numberOfLiveAXObjects; |
| 1048 }; | 1066 }; |
| 1049 | 1067 |
| 1050 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ | 1068 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ |
| 1051 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ | 1069 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ |
| 1052 object.predicate) | 1070 object.predicate) |
| 1053 | 1071 |
| 1054 } // namespace blink | 1072 } // namespace blink |
| 1055 | 1073 |
| 1056 #endif // AXObject_h | 1074 #endif // AXObject_h |
| OLD | NEW |