#ifndef AXRenderObject_h
#define AXRenderObject_h
#include "core/accessibility/AXNodeObject.h"
#include "platform/geometry/LayoutRect.h"
#include "wtf/Forward.h"
namespace WebCore {
class AXSVGRoot;
class AXObjectCache;
class Element;
class LocalFrame;
class FrameView;
class HitTestResult;
class HTMLAnchorElement;
class HTMLAreaElement;
class HTMLElement;
class HTMLLabelElement;
class HTMLMapElement;
class HTMLSelectElement;
class IntPoint;
class IntSize;
class Node;
class RenderListBox;
class RenderTextControl;
class RenderView;
class VisibleSelection;
class Widget;
class AXRenderObject : public AXNodeObject {
protected:
explicit AXRenderObject(RenderObject*);
public:
static PassRefPtr<AXRenderObject> create(RenderObject*);
virtual ~AXRenderObject();
virtual RenderObject* renderer() const OVERRIDE FINAL { return m_renderer; }
virtual LayoutRect elementRect() const OVERRIDE;
void setRenderer(RenderObject*);
RenderBoxModelObject* renderBoxModelObject() const;
RenderView* topRenderer() const;
Document* topDocument() const;
bool shouldNotifyActiveDescendant() const;
virtual ScrollableArea* getScrollableAreaIfScrollable() const OVERRIDE FINAL;
virtual AccessibilityRole determineAccessibilityRole() OVERRIDE;
void checkCachedElementRect() const;
void updateCachedElementRect() const;
protected:
RenderObject* m_renderer;
mutable LayoutRect m_cachedElementRect;
mutable LayoutRect m_cachedFrameRect;
mutable IntPoint m_cachedScrollPosition;
mutable bool m_cachedElementRectDirty;
virtual void init() OVERRIDE;
virtual void detach() OVERRIDE;
virtual bool isDetached() const OVERRIDE { return !m_renderer; }
virtual bool isAXRenderObject() const OVERRIDE { return true; }
virtual bool isAttachment() const OVERRIDE;
virtual bool isFileUploadButton() const OVERRIDE;
virtual bool isLinked() const OVERRIDE;
virtual bool isLoaded() const OVERRIDE;
virtual bool isOffScreen() const OVERRIDE;
virtual bool isReadOnly() const OVERRIDE;
virtual bool isVisited() const OVERRIDE;
virtual bool isFocused() const OVERRIDE;
virtual bool isSelected() const OVERRIDE;
virtual AXObjectInclusion defaultObjectInclusion() const OVERRIDE;
virtual bool computeAccessibilityIsIgnored() const OVERRIDE;
virtual const AtomicString& accessKey() const OVERRIDE;
virtual AccessibilityOrientation orientation() const OVERRIDE;
virtual String text() const OVERRIDE;
virtual int textLength() const OVERRIDE;
virtual KURL url() const OVERRIDE;
virtual String actionVerb() const OVERRIDE;
virtual void selectedChildren(AccessibilityChildrenVector&) OVERRIDE;
virtual String stringValue() const OVERRIDE;
virtual AXObject* activeDescendant() const OVERRIDE;
virtual void ariaFlowToElements(AccessibilityChildrenVector&) const OVERRIDE;
virtual void ariaControlsElements(AccessibilityChildrenVector&) const OVERRIDE;
virtual void ariaDescribedbyElements(AccessibilityChildrenVector&) const OVERRIDE;
virtual void ariaLabelledbyElements(AccessibilityChildrenVector&) const OVERRIDE;
virtual void ariaOwnsElements(AccessibilityChildrenVector&) const OVERRIDE;
virtual bool ariaHasPopup() const OVERRIDE;
virtual bool ariaRoleHasPresentationalChildren() const OVERRIDE;
virtual bool isPresentationalChildOfAriaRole() const OVERRIDE;
virtual bool shouldFocusActiveDescendant() const OVERRIDE;
virtual bool supportsARIADragging() const OVERRIDE;
virtual bool supportsARIADropping() const OVERRIDE;
virtual bool supportsARIAFlowTo() const OVERRIDE;
virtual bool supportsARIAOwns() const OVERRIDE;
virtual const AtomicString& ariaLiveRegionStatus() const OVERRIDE;
virtual const AtomicString& ariaLiveRegionRelevant() const OVERRIDE;
virtual bool ariaLiveRegionAtomic() const OVERRIDE;
virtual bool ariaLiveRegionBusy() const OVERRIDE;
virtual String textUnderElement() const OVERRIDE;
virtual String helpText() const OVERRIDE;
virtual void markCachedElementRectDirty() const OVERRIDE;
virtual IntPoint clickPoint() OVERRIDE;
virtual AXObject* accessibilityHitTest(const IntPoint&) const OVERRIDE;
virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const OVERRIDE;
virtual AXObject* parentObject() const OVERRIDE;
virtual AXObject* parentObjectIfExists() const OVERRIDE;
virtual AXObject* firstChild() const OVERRIDE;
virtual AXObject* nextSibling() const OVERRIDE;
virtual void addChildren() OVERRIDE;
virtual bool canHaveChildren() const OVERRIDE;
virtual void updateChildrenIfNecessary() OVERRIDE;
virtual bool needsToUpdateChildren() const { return m_childrenDirty; }
virtual void setNeedsToUpdateChildren() OVERRIDE { m_childrenDirty = true; }
virtual void clearChildren() OVERRIDE;
virtual AXObject* observableObject() const OVERRIDE;
virtual double estimatedLoadingProgress() const OVERRIDE;
virtual Node* node() const OVERRIDE;
virtual Document* document() const OVERRIDE;
virtual FrameView* documentFrameView() const OVERRIDE;
virtual Element* anchorElement() const OVERRIDE;
virtual Widget* widgetForAttachmentView() const OVERRIDE;
virtual PlainTextRange selectedTextRange() const OVERRIDE;
virtual void setSelectedTextRange(const PlainTextRange&) OVERRIDE;
virtual void setValue(const String&) OVERRIDE;
virtual void scrollTo(const IntPoint&) const OVERRIDE;
virtual void handleActiveDescendantChanged() OVERRIDE;
virtual void handleAriaExpandedChanged() OVERRIDE;
virtual void textChanged() OVERRIDE;
virtual int index(const VisiblePosition&) const OVERRIDE;
virtual VisiblePosition visiblePositionForIndex(int) const OVERRIDE;
virtual void lineBreaks(Vector<int>&) const OVERRIDE;
private:
bool isAllowedChildOfTree() const;
void ariaListboxSelectedChildren(AccessibilityChildrenVector&);
PlainTextRange ariaSelectedTextRange() const;
bool nodeIsTextControl(const Node*) const;
bool isTabItemSelected() const;
AXObject* internalLinkElement() const;
AXObject* accessibilityImageMapHitTest(HTMLAreaElement*, const IntPoint&) const;
bool renderObjectIsObservable(RenderObject*) const;
RenderObject* renderParentObject() const;
bool isDescendantOfElementType(const QualifiedName& tagName) const;
bool isSVGImage() const;
void detachRemoteSVGRoot();
AXSVGRoot* remoteSVGRootElement() const;
AXObject* remoteSVGElementHitTest(const IntPoint&) const;
void offsetBoundingBoxForRemoteSVGElement(LayoutRect&) const;
void addHiddenChildren();
void addTextFieldChildren();
void addImageMapChildren();
void addCanvasChildren();
void addAttachmentChildren();
void addRemoteSVGChildren();
void addInlineTextBoxChildren();
void ariaSelectedRows(AccessibilityChildrenVector&);
bool elementAttributeValue(const QualifiedName&) const;
bool inheritsPresentationalRole() const;
LayoutRect computeElementRect() const;
VisibleSelection selection() const;
int indexForVisiblePosition(const VisiblePosition&) const;
void accessibilityChildrenFromAttribute(QualifiedName attr, AccessibilityChildrenVector&) const;
};
DEFINE_AX_OBJECT_TYPE_CASTS(AXRenderObject, isAXRenderObject());
}
#endif