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

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

Issue 2956053005: Keep track of fixed positioning in accessibility tree.
Patch Set: GetSimpleRelativeBounds, add failing test for fixed with transform Created 3 years, 5 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 bool ContainerLiveRegionBusy() const; 676 bool ContainerLiveRegionBusy() const;
677 677
678 // Every object's bounding box is returned relative to a 678 // Every object's bounding box is returned relative to a
679 // container object (which is guaranteed to be an ancestor) and 679 // container object (which is guaranteed to be an ancestor) and
680 // optionally a transformation matrix that needs to be applied too. 680 // optionally a transformation matrix that needs to be applied too.
681 // To compute the absolute bounding box of an element, start with its 681 // To compute the absolute bounding box of an element, start with its
682 // boundsInContainer and apply the transform. Then as long as its container is 682 // boundsInContainer and apply the transform. Then as long as its container is
683 // not null, walk up to its container and offset by the container's offset 683 // not null, walk up to its container and offset by the container's offset
684 // from origin, the container's scroll position if any, and apply the 684 // from origin, the container's scroll position if any, and apply the
685 // container's transform. Do this until you reach the root of the tree. 685 // container's transform. Do this until you reach the root of the tree.
686 // If |out_is_fixed_positioned| is set, the scroll position of the container
687 // should be ignored.
686 virtual void GetRelativeBounds(AXObject** out_container, 688 virtual void GetRelativeBounds(AXObject** out_container,
687 FloatRect& out_bounds_in_container, 689 FloatRect& out_bounds_in_container,
688 SkMatrix44& out_container_transform) const; 690 SkMatrix44& out_container_transform,
691 bool& out_is_fixed_positioned) const;
689 692
690 // Get the bounds in frame-relative coordinates as a LayoutRect. 693 // Get the bounds in frame-relative coordinates as a LayoutRect.
691 LayoutRect GetBoundsInFrameCoordinates() const; 694 LayoutRect GetBoundsInFrameCoordinates() const;
692 695
693 // Explicitly set an object's bounding rect and offset container. 696 // Explicitly set an object's bounding rect and offset container.
694 void SetElementRect(LayoutRect r, AXObject* container) { 697 void SetElementRect(LayoutRect r, AXObject* container) {
695 explicit_element_rect_ = r; 698 explicit_element_rect_ = r;
696 explicit_container_id_ = container->AxObjectID(); 699 explicit_container_id_ = container->AxObjectID();
697 } 700 }
698 701
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 849
847 bool CanReceiveAccessibilityFocus() const; 850 bool CanReceiveAccessibilityFocus() const;
848 bool NameFromContents(bool recursive) const; 851 bool NameFromContents(bool recursive) const;
849 852
850 AccessibilityRole ButtonRoleType() const; 853 AccessibilityRole ButtonRoleType() const;
851 854
852 virtual LayoutObject* LayoutObjectForRelativeBounds() const { 855 virtual LayoutObject* LayoutObjectForRelativeBounds() const {
853 return nullptr; 856 return nullptr;
854 } 857 }
855 858
859 // A simpler variant of GetRelativeBounds that can be overridden by
860 // subclasses that don't need to handle transformations or fixed
861 // positionining. Returns true if overridden by this subclass.
862 virtual bool GetSimpleRelativeBounds(
863 AXObject** out_container,
864 FloatRect& out_bounds_in_container) const {
865 return false;
866 }
867
856 const AXObject* InertRoot() const; 868 const AXObject* InertRoot() const;
857 869
858 mutable Member<AXObject> parent_; 870 mutable Member<AXObject> parent_;
859 871
860 // The following cached attribute values (the ones starting with m_cached*) 872 // The following cached attribute values (the ones starting with m_cached*)
861 // are only valid if m_lastModificationCount matches 873 // are only valid if m_lastModificationCount matches
862 // AXObjectCacheImpl::modificationCount(). 874 // AXObjectCacheImpl::modificationCount().
863 mutable int last_modification_count_; 875 mutable int last_modification_count_;
864 mutable RGBA32 cached_background_color_; 876 mutable RGBA32 cached_background_color_;
865 mutable bool cached_is_ignored_ : 1; 877 mutable bool cached_is_ignored_ : 1;
(...skipping 21 matching lines...) Expand all
887 static unsigned number_of_live_ax_objects_; 899 static unsigned number_of_live_ax_objects_;
888 }; 900 };
889 901
890 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \ 902 #define DEFINE_AX_OBJECT_TYPE_CASTS(thisType, predicate) \
891 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \ 903 DEFINE_TYPE_CASTS(thisType, AXObject, object, object->predicate, \
892 object.predicate) 904 object.predicate)
893 905
894 } // namespace blink 906 } // namespace blink
895 907
896 #endif // AXObject_h 908 #endif // AXObject_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698