| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2000 Simon Hausmann <hausmann@kde.org> | 4 * (C) 2000 Simon Hausmann <hausmann@kde.org> |
| 5 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 // RelationSidebar = 0x00008000, | 54 // RelationSidebar = 0x00008000, |
| 55 // RelationTag = 0x00010000, | 55 // RelationTag = 0x00010000, |
| 56 // RelationUp = 0x00020000, | 56 // RelationUp = 0x00020000, |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 class CORE_EXPORT HTMLAnchorElement : public HTMLElement, public DOMURLUtils { | 59 class CORE_EXPORT HTMLAnchorElement : public HTMLElement, public DOMURLUtils { |
| 60 DEFINE_WRAPPERTYPEINFO(); | 60 DEFINE_WRAPPERTYPEINFO(); |
| 61 public: | 61 public: |
| 62 static PassRefPtrWillBeRawPtr<HTMLAnchorElement> create(Document&); | 62 static PassRefPtrWillBeRawPtr<HTMLAnchorElement> create(Document&); |
| 63 | 63 |
| 64 virtual ~HTMLAnchorElement(); | 64 ~HTMLAnchorElement() override; |
| 65 | 65 |
| 66 KURL href() const; | 66 KURL href() const; |
| 67 void setHref(const AtomicString&); | 67 void setHref(const AtomicString&); |
| 68 | 68 |
| 69 const AtomicString& name() const; | 69 const AtomicString& name() const; |
| 70 | 70 |
| 71 virtual KURL url() const override final; | 71 KURL url() const final; |
| 72 virtual void setURL(const KURL&) override final; | 72 void setURL(const KURL&) final; |
| 73 | 73 |
| 74 virtual String input() const override final; | 74 String input() const final; |
| 75 virtual void setInput(const String&) override final; | 75 void setInput(const String&) final; |
| 76 | 76 |
| 77 virtual bool isLiveLink() const override final; | 77 bool isLiveLink() const final; |
| 78 | 78 |
| 79 virtual bool willRespondToMouseClickEvents() override final; | 79 bool willRespondToMouseClickEvents() final; |
| 80 | 80 |
| 81 bool hasRel(uint32_t relation) const; | 81 bool hasRel(uint32_t relation) const; |
| 82 void setRel(const AtomicString&); | 82 void setRel(const AtomicString&); |
| 83 | 83 |
| 84 LinkHash visitedLinkHash() const; | 84 LinkHash visitedLinkHash() const; |
| 85 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; } | 85 void invalidateCachedVisitedLinkHash() { m_cachedVisitedLinkHash = 0; } |
| 86 | 86 |
| 87 void sendPings(const KURL& destinationURL) const; | 87 void sendPings(const KURL& destinationURL) const; |
| 88 | 88 |
| 89 protected: | 89 protected: |
| 90 HTMLAnchorElement(const QualifiedName&, Document&); | 90 HTMLAnchorElement(const QualifiedName&, Document&); |
| 91 | 91 |
| 92 virtual void attributeWillChange(const QualifiedName&, const AtomicString& o
ldValue, const AtomicString& newValue) override; | 92 void attributeWillChange(const QualifiedName&, const AtomicString& oldValue,
const AtomicString& newValue) override; |
| 93 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr
ide; | 93 void parseAttribute(const QualifiedName&, const AtomicString&) override; |
| 94 virtual bool supportsFocus() const override; | 94 bool supportsFocus() const override; |
| 95 | 95 |
| 96 private: | 96 private: |
| 97 virtual bool shouldHaveFocusAppearance() const override final; | 97 bool shouldHaveFocusAppearance() const final; |
| 98 virtual void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType) ov
erride; | 98 void dispatchFocusEvent(Element* oldFocusedElement, WebFocusType) override; |
| 99 virtual void dispatchBlurEvent(Element* newFocusedElement, WebFocusType) ove
rride; | 99 void dispatchBlurEvent(Element* newFocusedElement, WebFocusType) override; |
| 100 virtual bool isMouseFocusable() const override; | 100 bool isMouseFocusable() const override; |
| 101 virtual bool isKeyboardFocusable() const override; | 101 bool isKeyboardFocusable() const override; |
| 102 virtual void defaultEventHandler(Event*) override final; | 102 void defaultEventHandler(Event*) final; |
| 103 virtual void setActive(bool = true) override final; | 103 void setActive(bool = true) final; |
| 104 virtual void accessKeyAction(bool sendMouseEvents) override final; | 104 void accessKeyAction(bool sendMouseEvents) final; |
| 105 virtual bool isURLAttribute(const Attribute&) const override final; | 105 bool isURLAttribute(const Attribute&) const final; |
| 106 virtual bool hasLegalLinkAttribute(const QualifiedName&) const override fina
l; | 106 bool hasLegalLinkAttribute(const QualifiedName&) const final; |
| 107 virtual bool canStartSelection() const override final; | 107 bool canStartSelection() const final; |
| 108 virtual short tabIndex() const override final; | 108 short tabIndex() const final; |
| 109 virtual bool draggable() const override final; | 109 bool draggable() const final; |
| 110 virtual bool isInteractiveContent() const override final; | 110 bool isInteractiveContent() const final; |
| 111 virtual InsertionNotificationRequest insertedInto(ContainerNode*) override; | 111 InsertionNotificationRequest insertedInto(ContainerNode*) override; |
| 112 void handleClick(Event*); | 112 void handleClick(Event*); |
| 113 | 113 |
| 114 uint32_t m_linkRelations; | 114 uint32_t m_linkRelations; |
| 115 mutable LinkHash m_cachedVisitedLinkHash; | 115 mutable LinkHash m_cachedVisitedLinkHash; |
| 116 bool m_wasFocusedByMouse; | 116 bool m_wasFocusedByMouse; |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 inline LinkHash HTMLAnchorElement::visitedLinkHash() const | 119 inline LinkHash HTMLAnchorElement::visitedLinkHash() const |
| 120 { | 120 { |
| 121 if (!m_cachedVisitedLinkHash) | 121 if (!m_cachedVisitedLinkHash) |
| 122 m_cachedVisitedLinkHash = blink::visitedLinkHash(document().baseURL(), f
astGetAttribute(HTMLNames::hrefAttr)); | 122 m_cachedVisitedLinkHash = blink::visitedLinkHash(document().baseURL(), f
astGetAttribute(HTMLNames::hrefAttr)); |
| 123 return m_cachedVisitedLinkHash; | 123 return m_cachedVisitedLinkHash; |
| 124 } | 124 } |
| 125 | 125 |
| 126 // Functions shared with the other anchor elements (i.e., SVG). | 126 // Functions shared with the other anchor elements (i.e., SVG). |
| 127 | 127 |
| 128 bool isEnterKeyKeydownEvent(Event*); | 128 bool isEnterKeyKeydownEvent(Event*); |
| 129 bool isLinkClick(Event*); | 129 bool isLinkClick(Event*); |
| 130 | 130 |
| 131 } // namespace blink | 131 } // namespace blink |
| 132 | 132 |
| 133 #endif // HTMLAnchorElement_h | 133 #endif // HTMLAnchorElement_h |
| OLD | NEW |