#ifndef HTMLAreaElement_h
#define HTMLAreaElement_h
#include "HTMLAnchorElement.h"
#include "LayoutRect.h"
#include <memory>
namespace WebCore {
class HitTestResult;
class HTMLImageElement;
class Path;
class HTMLAreaElement final : public HTMLAnchorElement {
public:
static Ref<HTMLAreaElement> create(const QualifiedName&, Document&);
bool isDefault() const { return m_shape == Default; }
bool mapMouseEvent(LayoutPoint location, const LayoutSize&, HitTestResult&);
LayoutRect computeRect(RenderObject*) const;
Path computePath(RenderObject*) const;
Path computePathForFocusRing(const LayoutSize& elementSize) const;
HTMLImageElement* imageElement() const;
private:
HTMLAreaElement(const QualifiedName&, Document&);
void parseAttribute(const QualifiedName&, const AtomicString&) final;
bool supportsFocus() const final;
String target() const final;
bool isKeyboardFocusable(KeyboardEvent*) const final;
bool isMouseFocusable() const final;
bool isFocusable() const final;
void updateFocusAppearance(SelectionRestorationMode, SelectionRevealMode) final;
void setFocus(bool) final;
enum Shape { Default, Poly, Rect, Circle, Unknown };
Path getRegion(const LayoutSize&) const;
void invalidateCachedRegion();
std::unique_ptr<Path> m_region;
std::unique_ptr<Length[]> m_coords;
int m_coordsLen;
LayoutSize m_lastSize;
Shape m_shape;
};
}
#endif